SDL and multisampling AA does not work

Recommended Posts

Enrico    316
Hi, yesterday I noticed, that Multisampling AA does not work anymore in any of my applications. I am creating a window with this code without any errors:
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);

SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

// should enable 4x AA
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);

Then I create a window with SDL_SetVideoMode() and enable multisampling
glEnable(GL_MULTISAMPLE);

But nothing is smoothed :-( I read out the values for SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES after window creation and both are set to 0. Graphics card is a ATI X800XT with Catalyst 6.2 and SDL 1.2.7 on Windows. Could you please give me a hint? Thanks, Enrico

Enrico    316
nobody? :(

Share on other sites
basement    229
I think you should specify a size for the alpha channel (8), you seem to put only R,G,B via SDL_GL_SetAttribute.

And I believe the "glEnable(GL_MULTISAMPLE)" is redundant. I have FSAA in my app and it works fine without it.

EDIT: and if that doesn't help then check your driver settings maybe AA is forced disabled.

Share on other sites
Enrico    316
Thanks :)
It is working now. FSAA only works with a 24 Bit depth buffer on ATI cards and I had a 32 Bit depth buffer :-/