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 - IPhone Template - code should be updated for SDL_Render change
Summary: IPhone Template - code should be updated for SDL_Render change
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All Mac OS X 10.6
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-20 10:01 UTC by Trent M
Modified: 2011-03-25 13:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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