We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1133

Summary: IPhone Template - code should be updated for SDL_Render change
Product: SDL Reporter: Trent M <thm99>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Mac OS X 10.6   

Description Trent M 2011-02-20 10:01:14 UTC
fetched latest code from the tip @ '02/20/11 11:00 CST' (sorry new to mercurial & don't know rev/changeset).

Built the xcode-iphone 'PrepareXcodeProjectTemplate' target and then used the template to start a new xcode project.

the Main.c file fails on four calls to: SDL_SetRenderDrawColor, SDL_RenderClear, SDL_RenderFillRect, SDL_RenderPresent. Due to the SDL_Render expected but not passed.

My work around was to add to main.c in the template:
-> static SDL_Renderer *renderer;

Then pass in the renderer to these calls:
-> SDL_*(renderer, ...);
Comment 1 Trent M 2011-02-20 10:02:37 UTC
Also,

IDE: XCode 3.2.5
IPHONE SDK: 4.2
Comment 2 Sam Lantinga 2011-02-20 20:04:13 UTC
This should be fixed now:
http://hg.libsdl.org/SDL/rev/d032ec40e7c1

Please let me know if you have any more problems! :)

Thanks!
Comment 3 Trent M 2011-02-21 12:13:26 UTC
looks like the two additional calls at the start of render() are not valid.
SetRenderDrawColor is missing renderer & the Clear syntax looks invalid. I included what I had to modify:


    /* Clear the screen */
    SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
    SDL_RenderClear(renderer);
	

also in the main, the guard statement after the create render always evaluates true regardless.


    renderer = SDL_CreateRenderer(window, -1, 0);
    //if (renderer) {
    //    printf("Could not create renderer\n");
    //    return 1;
    //}
Comment 4 Sam Lantinga 2011-03-25 13:20:17 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/be843abc1f6c