Stack Overflow
01-10-2003, 10:50 AM
When I enable double buffering in Win98 it seems to update strangely (it jitters), but for Win2k it updates nicely (and smoothly). Is there problem with my GL Screen Initialization?
void InitGL( HWND hWnd, HDC & hDC, HGLRC & hRC ) {
PIXELFORMATDESCRIPTOR pfd;
ZeroMemory( &pfd, sizeof pfd );
pfd.nSize = sizeof pfd;
pfd.nVersion = 1;
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
hDC = GetDC( hWnd );
int i = ChoosePixelFormat( hDC, &pfd );
SetPixelFormat( hDC, i, &pfd );
hRC = wglCreateContext( hDC );
wglMakeCurrent( hDC, hRC );
}
- VC6-OGL
void InitGL( HWND hWnd, HDC & hDC, HGLRC & hRC ) {
PIXELFORMATDESCRIPTOR pfd;
ZeroMemory( &pfd, sizeof pfd );
pfd.nSize = sizeof pfd;
pfd.nVersion = 1;
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
hDC = GetDC( hWnd );
int i = ChoosePixelFormat( hDC, &pfd );
SetPixelFormat( hDC, i, &pfd );
hRC = wglCreateContext( hDC );
wglMakeCurrent( hDC, hRC );
}
- VC6-OGL