mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-25 15:42:25 +01:00
Show number polygons in example 26
Just useful to understand what's going on. Also removing the _CRT_SECURE_NO_WARNINGS as I don't get warnings my VS versions and other examples don't do that (so maybe that was fixed otherwise?) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6407 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
8dbeba57cd
commit
d70d96031b
@ -35,8 +35,6 @@ of the objects and camera.
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// We'll also define this to stop MSVC complaining about sprintf().
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#pragma comment(lib, "Irrlicht.lib")
|
||||
#endif
|
||||
|
||||
@ -150,6 +148,7 @@ int main()
|
||||
*/
|
||||
smgr->addCameraSceneNode();
|
||||
int lastFPS = -1;
|
||||
u32 lastPrimitives = 0;
|
||||
u32 timeNow = device->getTimer()->getTime();
|
||||
bool nodeVisible=true;
|
||||
|
||||
@ -190,16 +189,20 @@ int main()
|
||||
driver->endScene();
|
||||
|
||||
int fps = driver->getFPS();
|
||||
u32 numPrimitives = driver->getPrimitiveCountDrawn();
|
||||
|
||||
if (lastFPS != fps)
|
||||
if (lastFPS != fps || lastPrimitives != numPrimitives)
|
||||
{
|
||||
core::stringw tmp(L"OcclusionQuery Example [");
|
||||
tmp += driver->getName();
|
||||
tmp += L"] fps: ";
|
||||
tmp += fps;
|
||||
tmp += L" polygons: ";
|
||||
tmp += numPrimitives;
|
||||
|
||||
device->setWindowCaption(tmp.c_str());
|
||||
lastFPS = fps;
|
||||
lastPrimitives = numPrimitives;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user