tags:

views:

51

answers:

2

I want to use OpenGL in my WndProc but I'm not sure how. I also don't want GL to occupy the whole screen, just a portion of the screen. In the end I basically want to make a drawing win32 app but use OGL instead of GDI. so how can I tell GL to use my control (a panel) 's hdc for drawing?

Thanks

+1  A: 

When you call wglCreateContext, pass the control's HDC instead of the window. The same thing works on OpenGL and DirectX.

peachykeen
A: 

You can use wglCreateContext on any HDC, but you can't mix the drawing with GDI.

Axel Gneiting
Isn't there a flag you can pass at context creation/pixel format selection that allows GDI interop?
genpfault