Try setting some GL attributes before your SDL_SetVideoMode()
call:
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
Also, pass in SDL_OPENGL
instead of SDL_HWSURFACE | SDL_DOUBLEBUF
:
if (!(surf = SDL_SetVideoMode(sx, sy, bpp, SDL_OPENGL)))
genpfault
2010-05-17 18:19:10