jmasterx
jmasterx

Reputation: 54173

Using OpenGL in a regular window (Win32)

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?

Upvotes: 2

Views: 1273

Answers (2)

Axel Gneiting
Axel Gneiting

Reputation: 5413

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

Upvotes: 0

ssube
ssube

Reputation: 48327

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

Upvotes: 4

Related Questions