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 1311 - iPod touch 2nd gen crash due missing opengles2
Summary: iPod touch 2nd gen crash due missing opengles2
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch iOS (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-09 16:14 UTC by IvanG
Modified: 2012-01-07 21:05 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 IvanG 2011-10-09 16:14:12 UTC
Crash happens on iPodTouch 2nd generation (os version 4.2.1)

when SDL_SetVideoMode() is called (only flag set was SDL_HWSURFACE) crash happens in:

SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) in SDL_uikitopengles.m gets called trying to create "opengles2" renderer.

    /* construct our view, passing in SDL's OpenGL configuration data */
    view = [[SDL_uikitopenglview alloc] initWithFrame: [uiwindow bounds] \
                                    retainBacking: _this->gl_config.retained_backing \
                                    rBits: _this->gl_config.red_size \
                                    gBits: _this->gl_config.green_size \
                                    bBits: _this->gl_config.blue_size \
                                    aBits: _this->gl_config.alpha_size \
                                    depthBits: _this->gl_config.depth_size \
                                    majorVersion: _this->gl_config.major_version];
// above call returns NULL
    data->view = view;
// crash happens on next line because view is NULL:
    view->viewcontroller = data->viewcontroller;
    if (view->viewcontroller != nil) {
        [view->viewcontroller setView:view];
        [view->viewcontroller retain];
    }


As workaround I'm using
SDL_SetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION, "opengles");
prior to SDL_SetVideoMode() call
Comment 1 Sam Lantinga 2012-01-07 21:05:09 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/a83eb92704f3