开发者

Using OpenGL in a regular window (Win32)

开发者 https://www.devze.com 2022-12-29 08:18 出处:网络
I want to use OpenGL i开发者_开发问答n 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 w

I want to use OpenGL i开发者_开发问答n 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?


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消