Need a script that shows a picture...
Need a script that shows a picture...
I have a start menu picture (with "new game" only lol) and I need to show it once I draw the device in full screen. How can I post a simple picture in Irrlicht and wait for the Enter Key?
-
- Posts: 13
- Joined: Wed Oct 03, 2007 9:00 am
- Location: Milano, Italia
Hi,
I am currently studying the tutorials on Irrlicht3d.org and I think I'm starting to understand- until I hit a pitfall.
I understood creating devices and initializing etc, but now I'm confused at the end part of the tutorial.
Here's what I don't get:
And here's what I want to learn more of:
Can someone describe me what these two mean in english?
Thx
I am currently studying the tutorials on Irrlicht3d.org and I think I'm starting to understand- until I hit a pitfall.
I understood creating devices and initializing etc, but now I'm confused at the end part of the tutorial.
Here's what I don't get:
Code: Select all
int lastFPS = -1;while(device->run())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
smgr->drawAll();
driver->endScene(); 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;
}
}
Code: Select all
smgr->addCameraSceneNodeFPS();
Thx
the 1st is the main render loop...
it starts a new screen (clears it), draws all 3d stuff (SceneManager) and ends the drawing,,, then it gets the actual FPS (frames per second) rate and writes it to the window caption...
the 2nd simply adds a FPS (first person) camera to the scene...
search in the API docu (the help file) for more informations, also for other Irrlicht functions you don't know, all is explained there...
it starts a new screen (clears it), draws all 3d stuff (SceneManager) and ends the drawing,,, then it gets the actual FPS (frames per second) rate and writes it to the window caption...
the 2nd simply adds a FPS (first person) camera to the scene...
search in the API docu (the help file) for more informations, also for other Irrlicht functions you don't know, all is explained there...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
no, not exactly this way, but the code is a little bit unformatted...
here the same code better formatted and with comments:the comparsion of last FPS and actual FPS is not really neccessary but it saves CPU power and reduces flickering of the caption (try it without the if statement and you'll see it works too)...
here the same code better formatted and with comments:
Code: Select all
// get the actual FPS
int fps = driver->getFPS();
// compare lastFPS with actual FPS to see if the FPS rate has changed
if (lastFPS != fps){
// creating a string
core::stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += driver->getName();
str += "] FPS:";
str += fps;
// set the new window caption
device->setWindowCaption(str.c_str());
// set lastFPS to actual fps for next comparsion (if)
lastFPS = fps;
}
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Without the If command it flickers to much on my laptop (most likely because it isn't meant for gaming) but on my desktop it looks steady...
Would it still work if you removed the whole if command, device->getFPS() and the integer fps? I do not see why I would want to waste CPU power in my game because my game is Fullscreen, so screen captioning isn't neccessary.
Thx for helpin' me. Anyways, how can I use IGUIEnvironment to display pictures on the screen? I loaded a Quake 3 map and I want to display maybe a small logo at the top left corner. I know one of the examples has it but I don't know how they implemented it.
EDIT: Uhh, DUH! lol, a tut named 2d graphics was right in the tutorial section! Nevermind about the logo thing.
Would it still work if you removed the whole if command, device->getFPS() and the integer fps? I do not see why I would want to waste CPU power in my game because my game is Fullscreen, so screen captioning isn't neccessary.
Thx for helpin' me. Anyways, how can I use IGUIEnvironment to display pictures on the screen? I loaded a Quake 3 map and I want to display maybe a small logo at the top left corner. I know one of the examples has it but I don't know how they implemented it.
EDIT: Uhh, DUH! lol, a tut named 2d graphics was right in the tutorial section! Nevermind about the logo thing.
yes, it's normal, I told you the if reduces (almost turns off) the flickering of the caption...IrrGamer wrote:Without the If command it flickers to much on my laptop (most likely because it isn't meant for gaming) but on my desktop it looks steady...
Correct, or set the caption at the beginning so you still have a caption but don't update it...IrrGamer wrote:Would it still work if you removed the whole if command, device->getFPS() and the integer fps? I do not see why I would want to waste CPU power in my game because my game is Fullscreen, so screen captioning isn't neccessary.
npIrrGamer wrote:Thx for helpin' me.
ncIrrGamer wrote:Anyways, how can I use IGUIEnvironment to display pictures on the screen? I loaded a Quake 3 map and I want to display maybe a small logo at the top left corner. I know one of the examples has it but I don't know how they implemented it.
EDIT: Uhh, DUH! lol, a tut named 2d graphics was right in the tutorial section! Nevermind about the logo thing.
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java