[SDL] How to dynamically check for SDL_GL_SWAP_INTERVAL support

Stephen Anthony sa666666 at gmail.com
Mon Dec 4 09:47:00 PST 2006


Hi, I'm wondering how to check (at runtime) if I can use the GL command:

    SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 1 );

This only works on SDL > 1.2.10, I think.  The problem is, how do I 
check this at runtime, since the SDL lib will be dynamically linked?  
And just because it's available at compile-time doesn't mean it will be 
at run-time (and vice-versa).

Basically, I need to determine at run-time if the 
enum 'SDL_GL_SWAP_CONTROL' is actually defined.  Does anyone have any 
advice?  I know I could just define that variable to whatever SDL 
1.2.10 uses and just always call the function, but that seems a hacky 
way of doing things.

Thanks for any info,
Steve




More information about the SDL mailing list