Kimi
Kimi

Reputation: 14109

SDL multisampling and OpenGL

To enable multisampling I am using the following code in my project:

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

Do I also need to call glEnable(GL_MULTISAMPLE);?

I see no difference if I don't call it.

Upvotes: 2

Views: 2532

Answers (1)

datenwolf
datenwolf

Reputation: 162317

Yes, without enabling multisampling primitives will get rendered aliased. This is a feature, because some graphics algorithms break if multisampling gets applied to them, so it's desireable to deliberately enable and disable it throughout rendering.

That being said, double buffering and depth resolution have nothing to do with multisampling. The relevant attributes are SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES

Upvotes: 3

Related Questions