openGl屏幕上的控件

openGl屏幕上的控件

问题描述:

你好,
是否可以在openGL屏幕上放置控件按钮?

hello,
Is it possible to place control buttons on openGL screen??

不建议将本机"控件(使用GDI/GDI +绘制)添加到OpenGL中(或DirectX)窗口,请不要这样做.

但是,我可以检查此链接:
http://en.wikipedia.org/wiki/GLUI [
It is not recommaned to add "native" controls (drawn with GDI/GDI+) into an OpenGL (or DirectX) window, so don''t do that.

However, I can check this link:
http://en.wikipedia.org/wiki/GLUI[^]
This is an OpenGL based library to add controls into your OpenGL window.

The best option would probably be to:
- use a dialog box
- use a container for your OpenGL drawings (a Picture Control for example)
- put classical controls in the dialiog (do not place any control inside the OpenGL container)
- initialize your OpenGL device with the Picture Control handle (give an ID to your container, not IDC_STATIC, and get the handle with GetDlgItem(IDC_YOUR_ID)->m_hWnd).