OpenGL Anti-Aliasing?!

AHOY!

I have a problem, I like to use OGL AA with WGL_ARB_multisample from
NeHe, the problem is, the “HDC hDC = GetDC(hWnd);” in Windows XP…

What I need to do place in hWnd to work with OGL?!

Thx
Alexandre Ribeiro de S?

What I need to do place in hWnd to work with OGL?!

To get a multisample (FSAA) context, do this:

SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 2);
SDL_Surface *screen = SDL_SetVideoMode(640, 480, 0, SGL_OPENGL);

–ryan.

SDL_Surface *screen = SDL_SetVideoMode(640, 480, 0, SGL_OPENGL);

Er…SDL_OPENGL, not SGL.

The point is you set some GL attributes before creating the window, and
it Just Works in SDL.

After the window is created, you can see if you got what you wanted:

 glGetIntegerv( GL_SAMPLE_BUFFERS_ARB, &Buffers );
 glGetIntegerv( GL_SAMPLES_ARB, &Samples );
 if( !Buffers || !Samples ) {
      // you didn't get a FSAA context, probably older hardware.
      //  or you asked for more than one buffer, or you asked for
      //  some insane number of samples (2, 4, or 8 is about it)
 } else {
      // FSAA was enabled.
 }

–ryan.