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: SDL_GL_RED_SIZE - how many bits the red component of the color buffer occupies SDL_GL_GREEN_SIZE - the size of the green color component in bits SDL_GL_BLUE_SIZE - the size of the blue color component in bits SDL_GL_ALPHA_SIZE - the size of the alpha buffer in bits. Note that in OpenGL, the alpha buffer is NOT connected to the color buffer, so the size of the alpha value does not need to be included in SDL_GL_BUFFER_SIZE. SDL_GL_DOUBLEBUFFER - specifies whether or not double buffering (the ability to render to an offscreen buffer and then flip with `SDL_GL_SwapBuffers`. 1 is true, 0 is false. SDL_GL_DEPTH_SIZE - the size of the depth buffer, in bits. SDL_GL_BUFFER_SIZE - the number of bits in the OpenGL color buffer. Usually set by the call to `SDL_SetVideoMode()`, you should not need to set this by hand. SDL_GL_STENCIL_SIZE - the number of bits in the OpenGL stencil buffer. SDL_GL_ACCUM_RED_SIZE - the number of bits in the red component of the OpenGL accumulator buffer. SDL_GL_ACCUM_GREEN_SIZE - the number of bits in the green component of the OpenGL accumulator buffer. SDL_GL_ACCUM_BLUE_SIZE - the number of bits in the blue component of the OpenGL accumulator buffer. SDL_GL_ACCUM_ALPHA_SIZE: the number of bits in the alpha component of the OpenGL accumulator buffer. `extern void SDL_GL_SwapBuffers(void);` Swaps the OpenGL buffers, if double buffering is enabled.