X11 glx multisampling support patch

As defined in the ARB_multisample OpenGL extension (available at
http://oss.sgi.com/projects/ogl-sample/registry/ARB/multisample.txt), in
order to turn on multisampling (aka full screen anti-aliasing) on X11
you must pass in GLX_SAMPLE_BUFFERS_ARB and GL_SAMPLES_ARB to
glXChooseVisual(). This patch adds some new SDL_GLattr tokens for those
two OpenGL constants so you can call SDL_SetAttribute
(SDL_GL_SAMPLE_BUFFERS_SIZE, value) and
SDL_SetAttribute(SDL_GL_SAMPLES_SIZE, value) to turn on support for
multisampling on the requested glx visual. As it is in the current SDL
code, you cannot turn on anti-aliasing from within the application.

Notes:

  1. SDL_GL_SAMPLE_BUFFERS_SIZE and SDL_GL_SAMPLES_SIZE might be poor
    names. Feel free to rename them.
  2. The multisampling extension was added to OpenGL 1.4. It seems they
    renamed the constants to drop the _ARB naming scheme, but it also seems
    that the _ARB names were kept for backward compatibility. Since the
    _ARB version also works with OpenGL versions prior to 1.4, I choose to
    use those.
  3. Since SDL tries to make things as easy as possible, you might want to
    consider only exposing the SDL_GL_SAMPLES_SIZE constant for this, and
    toggling GLX_SAMPLE_BUFFERS_ARB to 1 if GLX_SAMPLES_ARB is set to be
    higher than 1.
  4. This does not add support for multisampling to any other
    implementation other than the glX drivers. My apologies for this.

Jon
-------------- next part --------------
A non-text attachment was scrubbed…
Name: patch.txt
Type: text/x-patch
Size: 3289 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030404/ce78d6bc/attachment.bin