本文主要是介绍Ogre + windows,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Ogre部分的修改
///创建窗口
Ogre::NameValuePairList params;
Ogre::String handle;
handle = Ogre::StringConverter::toString((size_t)(hWnd));
params["externalWindowHandle"] = handle;
m_pWindow = m_pRoot->createRenderWindow("OgreRenderWindow", uiWidth, uiHeight, false, ¶ms);
assert(NULL != m_pWindow);
if(NULL == m_pWindow)
return false;
///Ogre的初始化/
World* g_pWorld = NULL;
///创建Ogre
g_pWorld = new World();
assert(NULL != g_pWorld);
if(NULL == g_pWorld)
return FALSE;
g_pWorld->createWorld(hWnd, uiWidht, uiHeight);
/消息循环的修改/
// Main message loop:
while (true)
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(WM_QUIT == msg.message)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
if(g_pWorld)
{
g_pWorld->render();
}
}
}
这篇关于Ogre + windows的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!