Commit 47611a90 authored by hybrid's avatar hybrid

Add all three render window selections possible in Irrlicht to example.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2985 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 1d2a2cd8
...@@ -80,6 +80,16 @@ int main() ...@@ -80,6 +80,16 @@ int main()
default: return 1; default: return 1;
} }
printf("Select the render window (some dead window may exist too):\n"\
" (a) Window with button (via CreationParam)\n"\
" (b) Window with button (via beginScene)\n"\
" (c) Own Irrlicht window (default behavior)\n"\
" (otherKey) exit\n\n");
std::cin >> key;
if (key != 'a' && key != 'b' && key != 'c')
return 1;
HINSTANCE hInstance = 0; HINSTANCE hInstance = 0;
// create dialog // create dialog
...@@ -142,8 +152,9 @@ int main() ...@@ -142,8 +152,9 @@ int main()
// create irrlicht device in the button window // create irrlicht device in the button window
irr::SIrrlichtCreationParameters param; irr::SIrrlichtCreationParameters param;
param.WindowId = reinterpret_cast<void*>(hIrrlichtWindow); // hColorButton
param.DriverType = driverType; param.DriverType = driverType;
if (key=='a')
param.WindowId = reinterpret_cast<void*>(hIrrlichtWindow);
irr::IrrlichtDevice* device = irr::createDeviceEx(param); irr::IrrlichtDevice* device = irr::createDeviceEx(param);
...@@ -196,7 +207,7 @@ int main() ...@@ -196,7 +207,7 @@ int main()
while (device->run()) while (device->run())
{ {
driver->beginScene(true, true, 0); driver->beginScene(true, true, 0, (key=='b')?hIrrlichtWindow:0);
smgr->drawAll(); smgr->drawAll();
driver->endScene(); driver->endScene();
} }
...@@ -222,7 +233,7 @@ int main() ...@@ -222,7 +233,7 @@ int main()
device->getTimer()->tick(); device->getTimer()->tick();
// draw engine picture // draw engine picture
driver->beginScene(true, true, 0); driver->beginScene(true, true, 0, (key=='c')?hIrrlichtWindow:0);
smgr->drawAll(); smgr->drawAll();
driver->endScene(); driver->endScene();
}*/ }*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment