
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.