将子窗口(glfwCreateWindow)作为子对象嵌入C ++ MFC父窗体 [英] embed window(glfwCreateWindow) as child to C++ MFC parent form
本文介绍了将子窗口(glfwCreateWindow)作为子对象嵌入C ++ MFC父窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请参考此链接
如何使用VC ++将glfw窗口嵌入到父窗体中来实现相同的目的?
How can the same achieved by using VC++ to embed glfw window to Parent form?
推荐答案
尝试一下:
- 调用
glfwWindowHint()
将GLFW_DECORATED
和GLFW_VISIBLE
设置为false
. - 调用
glfwCreateWindow()
. - 调用
glfwGetWin32Window()
以获取OpenGL窗口的本机句柄. - 调用
SetParent()
将您的表单设置为OpenGL窗口的新父级. - 调用
GetWindowLong()
/SetWindowLong()
删除WS_POPUP
并为其添加WS_CHILDWINDOW
样式OpenGL窗口. - 调用
ShowWindow()
最终使OpenGL窗口可见.
- Call
glfwWindowHint()
to setGLFW_DECORATED
andGLFW_VISIBLE
tofalse
. - Call
glfwCreateWindow()
. - Call
glfwGetWin32Window()
to get the native handle of the OpenGL window. - Call
SetParent()
to set your form as the new parent of the OpenGL window. - Call
GetWindowLong()
/SetWindowLong()
to remove theWS_POPUP
and add theWS_CHILDWINDOW
style for the OpenGL window. - Call
ShowWindow()
to finally make the OpenGL window visible.
我从 github.com/Chronial/foo_chronflow ::EngineWindow.cpp .
您还可以调用 SetWindowPos()
来调整OpenGL窗口在表单中的位置.
You might also call SetWindowPos()
to adjust the position of the OpenGL window within your form.
这篇关于将子窗口(glfwCreateWindow)作为子对象嵌入C ++ MFC父窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文