SDL OpenGL Multisampling

I didnt find any infos in the documentation about this subject and i also didnt
find any example how to do actually multisampling in SDL and OpenGL.

I have testet one method but it doesn’t work so i don’t see any antialiasing.
That is how i’ve done it:

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);

SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);

screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL);

glEnable(GL_MULTISAMPLE_ARB);

What do i have to do to have multisampling work?

Gnaf wrote:

I didnt find any infos in the documentation about this subject and i also didnt
find any example how to do actually multisampling in SDL and OpenGL.

I have testet one method but it doesn’t work so i don’t see any antialiasing.
That is how i’ve done it:

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);

SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);

screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL);

glEnable(GL_MULTISAMPLE_ARB);

What do i have to do to have multisampling work?

What card do you have ? What platform ?
glxinfo list the supported video modes at the end. The last column
(called “ms” for multisample) list the number of samples used. If it’s
full of zeros, your current platform doesn’t support multisampling.

Stephane

Stephane Marchesin <stephane.marchesin wanadoo.fr> writes:

What card do you have ? What platform ?
glxinfo list the supported video modes at the end. The last column
(called “ms” for multisample) list the number of samples used. If it’s
full of zeros, your current platform doesn’t support multisampling.

Stephane

My card is: GeForce4 Ti 4200
I am using WinXP.
But i know that my card does support multisampling because i have played a lot
of games which used antialiasing…

But with SDL i don’t get multisampling to work…

Gnaf wrote:

My card is: GeForce4 Ti 4200
I am using WinXP.
But i know that my card does support multisampling because i have played a lot
of games which used antialiasing…

Well, antialiasing support doesn’t always mean multisampling support
(you’re right that the Geforce 4 Ti supports multisampling, but for
example a geforce 2 can do antialiasing but not multisampling).

What are the other OpenGL attributes you set ? Do you request stencil
and/or auxilliary buffers ?

Also, did you try removing the glEnable(GL_MULTISAMPLE_ARB) ? It’s not
needed.

Stephane