Original Post
Okay, I''ve written OpenGL in Win32 before, but this problem eludes me... there''s bound to be something i''m forgetting here. Here''s my function that is supposed to enable opengl:
void EnableOpenGL()
dc = GetDC(global_hwnd);
PIXELFORMATDESCRIPTOR pfd;
int format;
ZeroMemory(&pfd, sizeof (pfd));
pfd.nSize = sizeof ( PIXELFORMATDESCRIPTOR );
pfd.nVersion = 1;
pfd.cColorBits = 24;
pfd.cDepthBits = 16;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.dwFlags = PFD_DOUBLEBUFFER / PFD_DRAW_TO_WINDOW /
PFD_SUPPORT_OPENGL;
format = ChoosePixelFormat(dc, &pfd);
SetPixelFormat(dc, format, &pfd);
rc = wglCreateContext(dc);
wglMakeCurrent(dc, rc);
}
DC and RC are both global, everything compiles/links fine, except that when I issue OpenGL commands nothing happens. It''s probably something simple that I''m missing, but please clue me in.
Hi there, I''m AnCcE, and you''d be too if you weren''t somebody else.