Video Events OpenGL Audio CD-ROM Threads Time

OpenGL Context Manager Function Reference


Introduction Function List Function Reference Examples

extern int SDL_GL_LoadLibrary(const char *path);

You normally link your application with the OpenGL library directly, but it is possible to have SDL load a GL library for your use at runtime. If you do this, you will need to retrieve all of the GL functions used in your program from the dynamic library using SDL_GL_GetProcAddress(). This is mainly used by graphics-intensive games which need to load special libraries to cope with various types of hardware.

This function is only supported on platforms where dynamic library linking is supported (e.g. Win32 and Linux)

extern void *SDL_GL_GetProcAddress(const char *proc);

This function returns the address of the GL procedure with the name specified in proc. Generally, this is used for loading extensions. This is only supported on platforms where dynamic library linking is supported (e.g. Win32 and Linux)

extern int SDL_GL_GetAttribute (SDL_GLattr attr, int *value);

Gets an attribute of the OpenGL subsystem from the windowing interface, such as glX. This is of course different than getting it from SDL's internal OpenGL subsystem, which only stores the values that you request before initialization. Developers should track the values that they pass to SDL_GL_SetAttribute() themselves if they wish to retrieve these values.

extern int SDL_GL_SetAttribute(SDL_GLattr attr, int value);

Sets internal information about the OpenGL video mode before it's loaded. All the appropriate values should be set with SDL_GL_SetAttribute before the call to SDL_SetVideoMode is made. attr can be one of:

extern void SDL_GL_SwapBuffers(void);

Swaps the OpenGL buffers, if double buffering is enabled.