Strange initialization problem.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
LarryTM
Posts: 8
Joined: Wed Aug 17, 2005 10:26 am
Location: Warsaw, Poland.
Contact:

Strange initialization problem.

Post by LarryTM »

Hi,

how to initialize filesystem before CreateDevice() ? I need to do this for read default configuration file which contains screen resolution, etc.

this one works fine (but its not what i want):

Code: Select all

 device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(1024,768 ),32,false ,true,false); 
 driver = device->getVideoDriver();
 smgr = device->getSceneManager(); 
	
 bspReader = new addon::CBspFileEntityReader(device->getFileSystem());
 device->getFileSystem()->addZipFileArchive("data/data.pk3");
and this hangs up my program. Why?

Code: Select all

 bspReader = new addon::CBspFileEntityReader(device->getFileSystem());
 device->getFileSystem()->addZipFileArchive("data/data.pk3");

 device = createDevice(video::EDT_OPENGL,  core::dimension2d<s32>(1024,768 ),32,false ,true,false); 
 driver = device->getVideoDriver();
 smgr = device->getSceneManager();
/lar
ry
Posts: 8
Joined: Mon Dec 12, 2005 4:15 am
Contact:

Post by ry »

In the second sample(your code), the 'device' is defined after the level is loaded, when loading the file it has to have an active window.

So you might have to leave the device before the level loading, but you could change when the level is loaded(e.g. after a certain button is pressed it loads the map and nodes)

Don't know if this is any help I'm fairly new to irrlicht, so this post isn't 100% credible
hybrid

Post by hybrid »

The Null device is meant for such purposes. Create a NULL device, do the file handling, close the device and reopen the one which has the specified driver.
LarryTM
Posts: 8
Joined: Wed Aug 17, 2005 10:26 am
Location: Warsaw, Poland.
Contact:

Post by LarryTM »

well that's what i need. Thanks! :)

/lar
Guest

Post by Guest »

or do it the "recomended" way and use the registry! ;)

->app start
->read settings from registry
->create device with them
->create actual filesystem for game saves and level loading etc

:)
hybrid

Post by hybrid »

Anonymous wrote:or do it the "recomended" way and use the registry! ;)
After searching about two hours for "registry" in ISO C++ standards and Linux programming guides I give up. So what is this fancy new "recommended" and portable technique :?:
:lol: :lol: :lol: You failed :!:
BTW: How would you choose the driver initially without having a device and thus without having a GUI? And using files is not restricted to Irrlicht devices, so you could use C++ methods for this as well. This would keep portability instead of mess with registry.
Guest

Post by Guest »

he said he was reading a config FILE and did not mention portability or a user selecting a driver on startup. reading the registry is far cleaner than creating a null device just to loose it. if that is ALL he want's to do. The stuff you added are different question all together to which I would never have answered as I did previously :)

Read up on MS guidlines sometime, your job as a windows coder is not to follow c++ standards if it means making tasks more convoluted and unclean on windows systems. You can read the registry with a few simple calls using mssdks files (just copy the code into your own files job done).

If he is writing for some other OS then he should specifiy that, I think it's safe to assume windows is being used unless specified.
hybrid

Post by hybrid »

If you're following Windows guidelines you won't be able to use OpenGL in the near future, so what should be the choice for the user? So in this case just try DirectX9, if that fails use DirectX8. So what?
LarryTM
Posts: 8
Joined: Wed Aug 17, 2005 10:26 am
Location: Warsaw, Poland.
Contact:

Post by LarryTM »

you are wrong.

OpenGL will be not 'directly' supported only in windowed mode (in windowed mode the library will translate opengl instructions in directX instructions). There will be full support for opengl in fullscreen mode.

/lar
Guest

Post by Guest »

i thought support means windows want help you develope with it?

Does that means opengl will lose os independency?
Post Reply