diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/examples/12.TerrainRendering/tutorial.html | 244 |
1 files changed, 122 insertions, 122 deletions
diff --git a/libraries/irrlicht-1.8/examples/12.TerrainRendering/tutorial.html b/libraries/irrlicht-1.8/examples/12.TerrainRendering/tutorial.html index f3d765f..f81d815 100644 --- a/libraries/irrlicht-1.8/examples/12.TerrainRendering/tutorial.html +++ b/libraries/irrlicht-1.8/examples/12.TerrainRendering/tutorial.html | |||
@@ -1,122 +1,122 @@ | |||
1 | <html> | 1 | <html> |
2 | <head> | 2 | <head> |
3 | <title>Irrlicht Engine Tutorial</title> | 3 | <title>Irrlicht Engine Tutorial</title> |
4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | 4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
5 | </head> | 5 | </head> |
6 | 6 | ||
7 | <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> | 7 | <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> |
8 | <br> | 8 | <br> |
9 | <table width="95%" border="0" cellspacing="0" cellpadding="2" align="center"> | 9 | <table width="95%" border="0" cellspacing="0" cellpadding="2" align="center"> |
10 | <tr> | 10 | <tr> |
11 | <td bgcolor="#666699" width="10"><b><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="../../media/irrlichtlogo.jpg" width="88" height="31" border="0"></a></b></td> | 11 | <td bgcolor="#666699" width="10"><b><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="../../media/irrlichtlogo.jpg" width="88" height="31" border="0"></a></b></td> |
12 | <td bgcolor="#666699" width="100%"> | 12 | <td bgcolor="#666699" width="100%"> |
13 | <div align="center"> | 13 | <div align="center"> |
14 | <div align="left"><b><font color="#FFFFFF">Tutorial 12. Terrain Rendering</font></b></div> | 14 | <div align="left"><b><font color="#FFFFFF">Tutorial 12. Terrain Rendering</font></b></div> |
15 | </div> | 15 | </div> |
16 | </td> | 16 | </td> |
17 | </tr> | 17 | </tr> |
18 | <tr bgcolor="#eeeeff"> | 18 | <tr bgcolor="#eeeeff"> |
19 | <td height="90" colspan="2"> | 19 | <td height="90" colspan="2"> |
20 | <div align="left"> | 20 | <div align="left"> |
21 | <p> This tutorial will briefly show how to use the terrain renderer of | 21 | <p> This tutorial will briefly show how to use the terrain renderer of |
22 | Irrlicht. It will also show the terrain renderer triangle selector to | 22 | Irrlicht. It will also show the terrain renderer triangle selector to |
23 | be able to do collision detection with terrain.</p> | 23 | be able to do collision detection with terrain.</p> |
24 | <p>The program which is described here will look like this:</p> | 24 | <p>The program which is described here will look like this:</p> |
25 | <p align="center"><img src="../../media/012shot.jpg" width="258" height="202"></p> | 25 | <p align="center"><img src="../../media/012shot.jpg" width="258" height="202"></p> |
26 | <p align="left"><br> | 26 | <p align="left"><br> |
27 | Note that the terrain renderer in Irrlicht is based the terrain renderer | 27 | Note that the terrain renderer in Irrlicht is based the terrain renderer |
28 | by Soconne and the GeoMipMapSceneNode developed by Spinz, lots of thanks | 28 | by Soconne and the GeoMipMapSceneNode developed by Spinz, lots of thanks |
29 | go to them.</p> | 29 | go to them.</p> |
30 | </div> | 30 | </div> |
31 | </td> | 31 | </td> |
32 | </tr> | 32 | </tr> |
33 | </table> | 33 | </table> |
34 | <br> | 34 | <br> |
35 | <table width="95%" border="0" cellspacing="0" cellpadding="2" align="center"> | 35 | <table width="95%" border="0" cellspacing="0" cellpadding="2" align="center"> |
36 | <tr> | 36 | <tr> |
37 | <td bgcolor="#666699"> <b><font color="#FFFFFF">Lets start!</font></b></td> | 37 | <td bgcolor="#666699"> <b><font color="#FFFFFF">Lets start!</font></b></td> |
38 | </tr> | 38 | </tr> |
39 | <tr> | 39 | <tr> |
40 | <td height="90" bgcolor="#eeeeff" valign="top"> <div align="left"> | 40 | <td height="90" bgcolor="#eeeeff" valign="top"> <div align="left"> |
41 | <div align="left"> | 41 | <div align="left"> |
42 | <p> In the beginning there is nothing special. We include the needed | 42 | <p> In the beginning there is nothing special. We include the needed |
43 | header files and create an event listener to listen if the user presses | 43 | header files and create an event listener to listen if the user presses |
44 | the 'W' key so we can switch to wireframe mode and if he presses 'D' | 44 | the 'W' key so we can switch to wireframe mode and if he presses 'D' |
45 | we toggle to material between solid and detail mapped.</p> | 45 | we toggle to material between solid and detail mapped.</p> |
46 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> | 46 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> |
47 | <tr> | 47 | <tr> |
48 | <td> <pre>#include <irrlicht.h><br>#include <iostream><br>using namespace irr;<br><br>#pragma comment(lib, "Irrlicht.lib")<br><br>class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> MyEventReceiver(scene::ISceneNode* terrain)<br> {<br><font color="#006600"> // store pointer to terrain so we can change its drawing mode<br></font> Terrain = terrain;<br> }<br><br> bool OnEvent(const SEvent& event)<br> {<br> <font color="#006600"> // check if user presses the key 'W' or 'D'</font><br> if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)<br> {<br> switch (event.KeyInput.Key)<br> {<br> case irr::KEY_KEY_W:<font color="#006600"> // switch wire frame mode</font><br> Terrain->setMaterialFlag(video::EMF_WIREFRAME, !Terrain->getMaterial(0).Wireframe);<br> return true;<br> case irr::KEY_KEY_D:<font color="#006600"> // toggle detail map</font><br> Terrain->setMaterialType(<br> Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? <br> video::EMT_DETAIL_MAP : video::EMT_SOLID);<br> return true;<br> }<br> }<br> return false;<br> }<br><br>private:<br> scene::ISceneNode* Terrain;<br>};<br><br></pre></td> | 48 | <td> <pre>#include <irrlicht.h><br>#include <iostream><br>using namespace irr;<br><br>#pragma comment(lib, "Irrlicht.lib")<br><br>class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> MyEventReceiver(scene::ISceneNode* terrain)<br> {<br><font color="#006600"> // store pointer to terrain so we can change its drawing mode<br></font> Terrain = terrain;<br> }<br><br> bool OnEvent(const SEvent& event)<br> {<br> <font color="#006600"> // check if user presses the key 'W' or 'D'</font><br> if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)<br> {<br> switch (event.KeyInput.Key)<br> {<br> case irr::KEY_KEY_W:<font color="#006600"> // switch wire frame mode</font><br> Terrain->setMaterialFlag(video::EMF_WIREFRAME, !Terrain->getMaterial(0).Wireframe);<br> return true;<br> case irr::KEY_KEY_D:<font color="#006600"> // toggle detail map</font><br> Terrain->setMaterialType(<br> Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? <br> video::EMT_DETAIL_MAP : video::EMT_SOLID);<br> return true;<br> }<br> }<br> return false;<br> }<br><br>private:<br> scene::ISceneNode* Terrain;<br>};<br><br></pre></td> |
49 | </tr> | 49 | </tr> |
50 | </table> | 50 | </table> |
51 | <p>The start of the main function starts like in most other example. | 51 | <p>The start of the main function starts like in most other example. |
52 | We ask the user for the desired renderer and start it up. </p> | 52 | We ask the user for the desired renderer and start it up. </p> |
53 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> | 53 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> |
54 | <tr> | 54 | <tr> |
55 | <td> <pre>int main()<br>{<br><font color="#006600"> // let user select driver type<br></font><br> video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;<br><br> printf("Please select the driver you want for this example:\n"\<br> " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\<br> " (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\<br> " (f) NullDevice\n (otherKey) exit\n\n");<br><br> char i;<br> std::cin >> i;<br><br> switch(i)<br> {<br> case 'a': driverType = video::EDT_DIRECT3D9;break;<br> case 'b': driverType = video::EDT_DIRECT3D8;break;<br> case 'c': driverType = video::EDT_OPENGL; break;<br> case 'd': driverType = video::EDT_SOFTWARE; break;<br> case 'e': driverType = video::EDT_BURNINGSVIDEO;break;<br> case 'f': driverType = video::EDT_NULL; break;<br> default: return 1;<br> } <br><font color="#006600"><br> // create device<br></font> IrrlichtDevice* device = createDevice(driverType, core::dimension2d<s32>(640, 480));<br><br> if (device == 0)<br> return 1; <font color="#006600">// could not create selected driver.</font><br></pre></td> | 55 | <td> <pre>int main()<br>{<br><font color="#006600"> // let user select driver type<br></font><br> video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;<br><br> printf("Please select the driver you want for this example:\n"\<br> " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\<br> " (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\<br> " (f) NullDevice\n (otherKey) exit\n\n");<br><br> char i;<br> std::cin >> i;<br><br> switch(i)<br> {<br> case 'a': driverType = video::EDT_DIRECT3D9;break;<br> case 'b': driverType = video::EDT_DIRECT3D8;break;<br> case 'c': driverType = video::EDT_OPENGL; break;<br> case 'd': driverType = video::EDT_SOFTWARE; break;<br> case 'e': driverType = video::EDT_BURNINGSVIDEO;break;<br> case 'f': driverType = video::EDT_NULL; break;<br> default: return 1;<br> } <br><font color="#006600"><br> // create device<br></font> IrrlichtDevice* device = createDevice(driverType, core::dimension2d<s32>(640, 480));<br><br> if (device == 0)<br> return 1; <font color="#006600">// could not create selected driver.</font><br></pre></td> |
56 | </tr> | 56 | </tr> |
57 | </table> | 57 | </table> |
58 | <p> First, we add standard stuff to the scene: A nice irrlicht engine | 58 | <p> First, we add standard stuff to the scene: A nice irrlicht engine |
59 | logo, a small help text, a user controlled camera, and we disable | 59 | logo, a small help text, a user controlled camera, and we disable |
60 | the mouse cursor.</p> | 60 | the mouse cursor.</p> |
61 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> | 61 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> |
62 | <tr> | 62 | <tr> |
63 | <td> <pre>video::IVideoDriver* driver = device->getVideoDriver();<br>scene::ISceneManager* smgr = device->getSceneManager();<br>gui::IGUIEnvironment* env = device->getGUIEnvironment();<br><br>driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);<br><br><font color="#006600">// add irrlicht logo<br></font>env->addImage(driver->getTexture("../../media/irrlichtlogoalpha.tga"),<br> core::position2d<s32>(10,10));<br> | 63 | <td> <pre>video::IVideoDriver* driver = device->getVideoDriver();<br>scene::ISceneManager* smgr = device->getSceneManager();<br>gui::IGUIEnvironment* env = device->getGUIEnvironment();<br><br>driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);<br><br><font color="#006600">// add irrlicht logo<br></font>env->addImage(driver->getTexture("../../media/irrlichtlogoalpha.tga"),<br> core::position2d<s32>(10,10));<br> |
64 | <font color="#006600">// add some help text<br></font>gui::IGUIStaticText* text = env->addStaticText(<br> L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map",<br> core::rect<s32>(10,453,200,475), true, true, 0, -1, true);<br> | 64 | <font color="#006600">// add some help text<br></font>gui::IGUIStaticText* text = env->addStaticText(<br> L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map",<br> core::rect<s32>(10,453,200,475), true, true, 0, -1, true);<br> |
65 | <font color="#006600">// add camera<br></font>scene::ICameraSceneNode* camera = <br> smgr->addCameraSceneNodeFPS(0,100.0f,1200.0f);<br>camera->setPosition(core::vector3df(1900*2,255*2,3700*2));<br>camera->setTarget(core::vector3df(2397*2,343*2,2700*2));<br>camera->setFarValue(12000.0f);<br><br><font color="#006600">// disable mouse cursor<br></font>device->getCursorControl()->setVisible(false);</pre></td> | 65 | <font color="#006600">// add camera<br></font>scene::ICameraSceneNode* camera = <br> smgr->addCameraSceneNodeFPS(0,100.0f,1200.0f);<br>camera->setPosition(core::vector3df(1900*2,255*2,3700*2));<br>camera->setTarget(core::vector3df(2397*2,343*2,2700*2));<br>camera->setFarValue(12000.0f);<br><br><font color="#006600">// disable mouse cursor<br></font>device->getCursorControl()->setVisible(false);</pre></td> |
66 | </tr> | 66 | </tr> |
67 | </table> | 67 | </table> |
68 | <p> Here comes the terrain renderer scene node: We add it just like | 68 | <p> Here comes the terrain renderer scene node: We add it just like |
69 | any other scene node to the scene using ISceneManager::addTerrainSceneNode(). | 69 | any other scene node to the scene using ISceneManager::addTerrainSceneNode(). |
70 | The only parameter we use is a file name to the heightmap we use. | 70 | The only parameter we use is a file name to the heightmap we use. |
71 | A heightmap is simply a gray scale texture. The terrain renderer loads | 71 | A heightmap is simply a gray scale texture. The terrain renderer loads |
72 | it and creates the 3D terrain from it.<br> | 72 | it and creates the 3D terrain from it.<br> |
73 | To make the terrain look more big, we change the scale factor of it | 73 | To make the terrain look more big, we change the scale factor of it |
74 | to (40, 4.4, 40). Because we don't have any dynamic lights in the | 74 | to (40, 4.4, 40). Because we don't have any dynamic lights in the |
75 | scene, we switch off the lighting, and we set the file terrain-texture.jpg | 75 | scene, we switch off the lighting, and we set the file terrain-texture.jpg |
76 | as texture for the terrain and detailmap3.jpg as second texture, called | 76 | as texture for the terrain and detailmap3.jpg as second texture, called |
77 | detail map. At last, we set the scale values for the texture: The | 77 | detail map. At last, we set the scale values for the texture: The |
78 | first texture will be repeated only one time over the whole terrain, | 78 | first texture will be repeated only one time over the whole terrain, |
79 | and the second one (detail map) 20 times. </p> | 79 | and the second one (detail map) 20 times. </p> |
80 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> | 80 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> |
81 | <tr> | 81 | <tr> |
82 | <td> <pre><font color="#006600">// add terrain scene node<br></font>scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( <br> "../../media/terrain-heightmap.bmp");<br><br>terrain->setScale(core::vector3df(40, 4.4f, 40));<br>terrain->setMaterialFlag(video::EMF_LIGHTING, false);<br><br>terrain->setMaterialTexture(0, driver->getTexture("../../media/terrain-texture.jpg"));<br>terrain->setMaterialTexture(1, driver->getTexture("../../media/detailmap3.jpg"));<br> <br>terrain->setMaterialType(video::EMT_DETAIL_MAP);<br>terrain->scaleTexture(1.0f, 20.0f);<font color="#006600"><br></font></pre></td> | 82 | <td> <pre><font color="#006600">// add terrain scene node<br></font>scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( <br> "../../media/terrain-heightmap.bmp");<br><br>terrain->setScale(core::vector3df(40, 4.4f, 40));<br>terrain->setMaterialFlag(video::EMF_LIGHTING, false);<br><br>terrain->setMaterialTexture(0, driver->getTexture("../../media/terrain-texture.jpg"));<br>terrain->setMaterialTexture(1, driver->getTexture("../../media/detailmap3.jpg"));<br> <br>terrain->setMaterialType(video::EMT_DETAIL_MAP);<br>terrain->scaleTexture(1.0f, 20.0f);<font color="#006600"><br></font></pre></td> |
83 | </tr> | 83 | </tr> |
84 | </table> | 84 | </table> |
85 | <p> To be able to do collision with the terrain, we create a triangle | 85 | <p> To be able to do collision with the terrain, we create a triangle |
86 | selector. If you want to know what triangle selectors do, just take | 86 | selector. If you want to know what triangle selectors do, just take |
87 | a look into the collision tutorial. The terrain triangle selector | 87 | a look into the collision tutorial. The terrain triangle selector |
88 | works together with the terrain. To demonstrate this, we create a | 88 | works together with the terrain. To demonstrate this, we create a |
89 | collision response animator and attach it to the camera, so that the | 89 | collision response animator and attach it to the camera, so that the |
90 | camera will not be able to fly through the terrain. </p> | 90 | camera will not be able to fly through the terrain. </p> |
91 | </div> | 91 | </div> |
92 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> | 92 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> |
93 | <tr> | 93 | <tr> |
94 | <td> <pre><font color="#006600">// create triangle selector for the terrain <br></font>scene::ITriangleSelector* selector =<br> smgr->createTerrainTriangleSelector(terrain, 0);<br>terrain->setTriangleSelector(selector);<br><br><font color="#006600">// create collision response animator and attach it to the camera<br></font>scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(<br> selector, camera, core::vector3df(60,100,60),<br> core::vector3df(0,0,0), <br> core::vector3df(0,50,0));<br>selector->drop();<br>camera->addAnimator(anim);<br>anim->drop();</pre></td> | 94 | <td> <pre><font color="#006600">// create triangle selector for the terrain <br></font>scene::ITriangleSelector* selector =<br> smgr->createTerrainTriangleSelector(terrain, 0);<br>terrain->setTriangleSelector(selector);<br><br><font color="#006600">// create collision response animator and attach it to the camera<br></font>scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(<br> selector, camera, core::vector3df(60,100,60),<br> core::vector3df(0,0,0), <br> core::vector3df(0,50,0));<br>selector->drop();<br>camera->addAnimator(anim);<br>anim->drop();</pre></td> |
95 | </tr> | 95 | </tr> |
96 | </table> | 96 | </table> |
97 | <p> To make the user be able to switch between normal and wireframe mode, | 97 | <p> To make the user be able to switch between normal and wireframe mode, |
98 | we create an instance of the event reciever from above and let Irrlicht | 98 | we create an instance of the event reciever from above and let Irrlicht |
99 | know about it. In addition, we add the skybox which we already used | 99 | know about it. In addition, we add the skybox which we already used |
100 | in lots of Irrlicht examples.</p> | 100 | in lots of Irrlicht examples.</p> |
101 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> | 101 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> |
102 | <tr> | 102 | <tr> |
103 | <td><pre><font color="#006600">// create event receiver<br></font>MyEventReceiver receiver(terrain);<br>device->setEventReceiver(&receiver);<br><br><font color="#006600">// create skybox<br></font>driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);<br><br>smgr->addSkyBoxSceneNode(<br> driver->getTexture("../../media/irrlicht2_up.jpg"),<br> driver->getTexture("../../media/irrlicht2_dn.jpg"),<br> driver->getTexture("../../media/irrlicht2_lf.jpg"),<br> driver->getTexture("../../media/irrlicht2_rt.jpg"),<br> driver->getTexture("../../media/irrlicht2_ft.jpg"),<br> driver->getTexture("../../media/irrlicht2_bk.jpg"));<br> | 103 | <td><pre><font color="#006600">// create event receiver<br></font>MyEventReceiver receiver(terrain);<br>device->setEventReceiver(&receiver);<br><br><font color="#006600">// create skybox<br></font>driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);<br><br>smgr->addSkyBoxSceneNode(<br> driver->getTexture("../../media/irrlicht2_up.jpg"),<br> driver->getTexture("../../media/irrlicht2_dn.jpg"),<br> driver->getTexture("../../media/irrlicht2_lf.jpg"),<br> driver->getTexture("../../media/irrlicht2_rt.jpg"),<br> driver->getTexture("../../media/irrlicht2_ft.jpg"),<br> driver->getTexture("../../media/irrlicht2_bk.jpg"));<br> |
104 | driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);<br></pre></td> | 104 | driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);<br></pre></td> |
105 | </tr> | 105 | </tr> |
106 | </table> | 106 | </table> |
107 | <p> That's it, draw everything. Now you know how to use terrain in Irrlicht.</p> | 107 | <p> That's it, draw everything. Now you know how to use terrain in Irrlicht.</p> |
108 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> | 108 | <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> |
109 | <tr> | 109 | <tr> |
110 | <td><pre> int lastFPS = -1;<br><br> while(device->run())<br> if (device->isWindowActive())<br> {<br> driver->beginScene(true, true, 0 );<br><br> smgr->drawAll();<br> env->drawAll();<br><br> driver->endScene(); | 110 | <td><pre> int lastFPS = -1;<br><br> while(device->run())<br> if (device->isWindowActive())<br> {<br> driver->beginScene(true, true, 0 );<br><br> smgr->drawAll();<br> env->drawAll();<br><br> driver->endScene(); |
111 | <br><font color="#006600"> // display frames per second in window title | 111 | <br><font color="#006600"> // display frames per second in window title |
112 | </font> int fps = driver->getFPS();<br><br> if (lastFPS != fps)<br> {<br> core::stringw str = L"Terrain Renderer - Irrlicht Engine [";<br> str += driver->getName();<br> str += "] FPS:";<br> str += fps;<br> device->setWindowCaption(str.c_str());<br> lastFPS = fps;<br> }<br> }<br><br> device->drop();<br> <br> return 0;<br>}</pre></td> | 112 | </font> int fps = driver->getFPS();<br><br> if (lastFPS != fps)<br> {<br> core::stringw str = L"Terrain Renderer - Irrlicht Engine [";<br> str += driver->getName();<br> str += "] FPS:";<br> str += fps;<br> device->setWindowCaption(str.c_str());<br> lastFPS = fps;<br> }<br> }<br><br> device->drop();<br> <br> return 0;<br>}</pre></td> |
113 | </tr> | 113 | </tr> |
114 | </table> | 114 | </table> |
115 | <p> </p> | 115 | <p> </p> |
116 | </div> | 116 | </div> |
117 | </td> | 117 | </td> |
118 | </tr> | 118 | </tr> |
119 | </table> | 119 | </table> |
120 | <p> </p> | 120 | <p> </p> |
121 | </body> | 121 | </body> |
122 | </html> | 122 | </html> |