Can't load pk3 file
Posted: Sat Mar 06, 2010 6:28 pm
I'm new and i have problem. I try to load my pk3 file, but i see only grey window. It's code:
In consol is somthing like this:Needed 0ms to create OctTree SceneNode.(0 nodesm o polys)
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
int main()
{
IrrlichtDevice* device = createDevice( EDT_OPENGL, dimension2d<s32>(800, 600),
32, false, false, false, 0);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
device->setWindowCaption(L"Test");//nagłówek okna
device->getFileSystem()->addZipFileArchive("test.pk3");
IAnimatedMesh* mesh = smgr->getMesh("test.bsp");
ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0), 0, -1, 1024);
node = smgr->addMeshSceneNode(mesh->getMesh(0));
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
int lastFPS = -1;
while(device->run())
{
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(255,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;
}
}
else
device->yield();
}
}