Low FPS on the second tutorial ( loading Quake 3 maps )
Low FPS on the second tutorial ( loading Quake 3 maps )
Hey everyone!
First, let me tell you that I've just started using the Irrlicht engine, but I love it!
Now, for my question. In the second tutorial ( loading Quake 3 maps ) the FPS is VERY low ( the highest I got was 5! ). I don't think it's a problem with my computer, since I ran Doom 3 on High Settings smoothly.
Does anyone know how I can fix this?
Thanks for your time!
First, let me tell you that I've just started using the Irrlicht engine, but I love it!
Now, for my question. In the second tutorial ( loading Quake 3 maps ) the FPS is VERY low ( the highest I got was 5! ). I don't think it's a problem with my computer, since I ran Doom 3 on High Settings smoothly.
Does anyone know how I can fix this?
Thanks for your time!
Umm . . . I could post the source code but that would be useless, because it's the same as the second tutorial's source code.
But, oh well, I'll post it anyways. I took out all the comments to save space.
#include <irrlicht/irrlicht.h>
#include <iostream>
using namespace irr;
#pragma comment ( lib, "Irrlicht.lib" )
int main()
{
video::E_DRIVER_TYPE driverType = video::EDT_DIRECTX9;
printf ( "Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.2\n"\
" (d) Software Renderer\n (e) NullDevice\n (otherKey) exit\n\n" );
char i;
std::cin >> i;
switch ( i )
{
case 'a': driverType = video::EDT_DIRECTX9; break;
case 'b': driverType = video::EDT_DIRECTX8; break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_NULL; break;
default: return 1;
}
IrrlichtDevice *device =
createDevice ( driverType, core::dimension2d<s32>(640, 480 ) );
if ( device == 0 )
return 1;
video::IVideoDriver *driver = device->getVideoDriver();
scene::ISceneManager *smgr = device->getSceneManager();
device->getFileSystem()->addZipFileArchive ( "../media/map-20kdm2.pk3" );
scene::IAnimatedMesh *mesh = smgr->getMesh ( "20kdm2.bsp" );
scene::ISceneNode *node = 0;
if ( mesh )
node = smgr->addOctTreeSceneNode ( mesh->getMesh ( 0 ) );
if ( node )
node->setPosition ( core::vector3df ( -1300, -144, -1249 ) );
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible ( false );
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;
}
}
device->drop();
return 0;
}
But, oh well, I'll post it anyways. I took out all the comments to save space.
#include <irrlicht/irrlicht.h>
#include <iostream>
using namespace irr;
#pragma comment ( lib, "Irrlicht.lib" )
int main()
{
video::E_DRIVER_TYPE driverType = video::EDT_DIRECTX9;
printf ( "Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.2\n"\
" (d) Software Renderer\n (e) NullDevice\n (otherKey) exit\n\n" );
char i;
std::cin >> i;
switch ( i )
{
case 'a': driverType = video::EDT_DIRECTX9; break;
case 'b': driverType = video::EDT_DIRECTX8; break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_NULL; break;
default: return 1;
}
IrrlichtDevice *device =
createDevice ( driverType, core::dimension2d<s32>(640, 480 ) );
if ( device == 0 )
return 1;
video::IVideoDriver *driver = device->getVideoDriver();
scene::ISceneManager *smgr = device->getSceneManager();
device->getFileSystem()->addZipFileArchive ( "../media/map-20kdm2.pk3" );
scene::IAnimatedMesh *mesh = smgr->getMesh ( "20kdm2.bsp" );
scene::ISceneNode *node = 0;
if ( mesh )
node = smgr->addOctTreeSceneNode ( mesh->getMesh ( 0 ) );
if ( node )
node->setPosition ( core::vector3df ( -1300, -144, -1249 ) );
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible ( false );
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;
}
}
device->drop();
return 0;
}
You really believe I haven't searched? It may not seem like it, but I'm not dumb!puh wrote:Hmm, i thought that all Linux-powered users are at least able to search in contrast all that noobs with windows...
PizzaTheHutt - this question was discussed so many times, try to use search in forum, please.
Thanks anyways.
Hmm, maybe you are right, PizzaTheHutt... At least you have compiled Irr in Linux is worth to respect you.
Just another one link: http://irrlicht.sourceforge.net/phpBB2/ ... php?t=7024
Couldn't help you much though as i'm myself just a stupid windows noob
Just another one link: http://irrlicht.sourceforge.net/phpBB2/ ... php?t=7024
Couldn't help you much though as i'm myself just a stupid windows noob