From d70d96031bc7f2fb3d4fd2cccf5e4928b1204109 Mon Sep 17 00:00:00 2001 From: cutealien Date: Thu, 16 Jun 2022 14:26:53 +0000 Subject: [PATCH] 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 --- examples/26.OcclusionQuery/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/26.OcclusionQuery/main.cpp b/examples/26.OcclusionQuery/main.cpp index 6aea63cb..d078a680 100644 --- a/examples/26.OcclusionQuery/main.cpp +++ b/examples/26.OcclusionQuery/main.cpp @@ -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; } }