When I was trying to make my own version of the Quake3 Map tutorial, I always had problems. The map I was trying to load was a 3ds max file, so therefore it was too slow for the software renderer. I downloaded IrrDX v1.1 so I can be able to compile the Direct3D into my program(I use Dev-C++). After I did, though, everytime I run the program, I get an error report. Here is my code:
Code: Select all
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
IrrlichtDevice *device =
createDevice(EDT_DIRECT3D9, dimension2d<s32>(800, 600), 32,
false, false, false, 0);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
device->getFileSystem()->addZipFileArchive("map.3ds");
IAnimatedMesh* mesh = smgr->getMesh("map.3ds");
ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
int lastFPS = -1;
while(device->run())
{
driver->beginScene(true, true, SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
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;
}