1. Create the window, CreateWindow(...)
2. Create a 2.1 context:
- set PIXELFORMATDESCRIPTOR named pfd
- int format = ChoosePixelFormat( hDC, &pfd )
- SetPixelFormat( hDC, format, &pfd )
- HGLRC tmpRC = wglCreateContext( hDC )
- wglMakeCurrent( hDC, tmpRC )
3. Initialise GLEW
4. Ask wgl for an extended pixel format:
int pfAttribs[] =
{
WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB, GL_TRUE,
WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
WGL_COLOR_BITS_ARB, 32,
WGL_DEPTH_BITS_ARB, 24,
WGL_STENCIL_BITS_ARB, 8,
WGL_SAMPLE_BUFFERS_ARB, 1,
WGL_SAMPLES_ARB, 8,
0
};
int formatEx;
UINT numFormats = 0;
wglChoosePixelFormatARB( hDC, pfAttribs, NULL, 1, &formatEx, &numFormats );
if( numFormats > 0 )
SetPixelFormat( hDC, formatEx, &pfd );
5. Continue by creating a 3.2 context and making it current then at last show the window.
6. In init: glEnable( GL_MULTISAMPLE )