Hi! It's my first post here, and I don't know if this is the right place to post this
I'm doing a little Demo as an university project. I currently have configured de sceneary in irrEdit, but when I want to load it with irrlicht, i can't.
The scenary is this
I set up a work directory in irrEdit, and it can load everything, but irrlicht doesn't. It shows me this messeage:
Unable to open scene file: ../../Media/Escenario/escenario.irr
I follow the "loading a .irr file" tutorial, and I don't know what is happening.....
And here is the blog of the project
http://thedarknesshunterproject.blogspot.com/
Does anybody knows what is happening??
Can't load .irr files?? :S:S
Could you post for us a short section of your code showing us your attempt to load your .irr file? Otherwise we can only guess as to what your problem may be.
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
"I'll find out if what I deleted was vital here shortly..." -d3jake
Ok! The code is very very simple
There are two different crashes.... the first one (the one I post yesterday) I think that is becouse I didn't specified the .irr file path ok, but when I change it to the one I think is the correct it found the .irr but can't load meshes, textures, lights...... It's rare, becouse when I open the .irr file with irrEdit, it detect everything......
Code: Select all
#include "irrlicht.h"
#include "iostream"
using namespace irr;
#ifdef _MSC_VER
#pragma comment (lib,"Irrlicht.lib")
#endif
int main(int argc, char** argv)
{
//Preguntemos que tipo de driver queremos
video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
printf ("DARKNESS HUNTER\n\nPor favor, seleccione el driver que desee antes de comenzar:\n\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Renderizado por software\n (otra) Salir\n");
char i;
std::cin >> i;
switch (i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL;break;
case 'd': driverType = video::EDT_SOFTWARE;break;
default: return 1;
}
//Creamos el device y salimos si pulsamos otras teclas
IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32>(640,480));
if (device == 0)
return 1;
//Ponemos el titulo a la ventana
device->setWindowCaption(L"Darkness Hunter");
//Creamos los punteros a IVideoDriver e ISceneManager
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
//Cargamos la escena del archivo.irr
if (argc>1)
smgr->loadScene(argv[1]);
else
smgr->loadScene("../Media/escenario1.irr");
//Ahora creamos la camara
smgr->addCameraSceneNodeFPS(0, 50.f, 0.1f);
//Ejecutamos el bucle
while (device->run())
if (device->isWindowActive())
{
driver->beginScene(true,true,video::SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
You have to set the proper path in IrrEdit (set it to you application's working directory), and make sure your IDE has set the right working path as well (as the code::blocks template sets the working path to Irrlicht's path instead of the application path).
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
-
- Posts: 3
- Joined: Fri Mar 05, 2010 3:34 am