i wanted to put the frame rate on screen (i use fullscreen) so i did a search and kinda get it working.
here is the code :
Code: Select all
int lastFPS = -1;
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
smgr->drawAll();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
IGUIEnvironment* guienv = device->getGUIEnvironment();
IGUIStaticText* debug_panel =
guienv->addStaticText(L"Hello World",
rect<s32>(5, 5, 200, 100),false,true,0,-1,false);
s32 framerate = driver->getFPS();
debug_panel->setText(stringw(framerate).c_str());
device->getGUIEnvironment()->drawAll();
driver->endScene();
}
device->drop();
return 0;if(framerate != 0) refresh the screen or something; but i dont really know how to do that.
i also put "vector" in the title because with this code, i kinda found a way to put a string previously set but what about vector ?
i mean, if for example i have something like setRotation(vector3df(0,0,0));, what should i use to write it kinda like setRotation(vector3df(myVector)); ?
thx
cya