[SDL] SDL_GL_SetAttribute problem.
Ryan C. Gordon
icculus at icculus.org
Thu Jan 4 17:27:55 PST 2007
> In windows, it doesn't seem to care if I set the colors before or after. On
> Linux the program will crash if I don't set the colors -after- calling
> SDL_SetVideoMode().
>
> So what's going on here?
It shouldn't crash before SetVideoMode...the function calls are
meaningless _after_ the video mode is set.
Likely there isn't a GL library loaded. Try SDL_GL_LoadLibrary() before
the SDL_GL_SetAttribute() calls. SDL_SetVideoMode() with SDL_OPENGL
forces SDL to load a default GL library if one isn't yet loaded, which
is why it ceases to crash at that point.
So do this, in this order:
- SDL_Init
- SDL_GL_LoadLibrary
- SDL_GL_SetAttribute
- SDL_SetVideoMode
- (the rest of your program)
- SDL_Quit
--ryan.
More information about the SDL
mailing list