PDA

View Full Version : Setting up a pane inside a window for OpenGL?



Eber Kain
03-03-2001, 07:57 AM
heres what im trying, but its not working

HWND hwnd = LogoWin->Handle;
HDC dc = GetDC(hwnd);
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
24,
0,0,0,0,0,0,
0,0,
0,0,0,0,0,
16,
0,
0,
PFD_MAIN_PLANE,
0,
0,0,0
};
int PixelFormat = ChoosePixelFormat(dc, &pfd);
SetPixelFormat(dc, PixelFormat, &pfd);
HGLRC glrc=wglCreateContext(dc);
wglMakeCurrent(dc,glrc);

glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();

any ideas?
LogoWin is a panel.
and im useing borland.