Datafiles with Irrlicht

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
emf2718
Posts: 4
Joined: Tue Feb 03, 2009 5:07 am

Datafiles with Irrlicht

Post by emf2718 »

I don't know how many here are familiar with Allegro, but it has a nifty feature: It has built-in support for datafiles so users can store graphics, fonts, sounds, etc. in a single data file so files aren't thrown everywhere. I really like Irrilcht but the only data files that Irrlicht supports as far as I can see are level data (.irr files). What I'm looking for is the ability to store media in a single file, then load the datafile, then create a scene based on the graphics data in that file.

Does Irrlicht support datafiles like that?

(EDIT: I'd like to create a 2D scene before a 3D scene, so the data file should contain only graphics and/or sound data, no meshes yet...)
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

yes, irrlicht can load ZIP files.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
emf2718
Posts: 4
Joined: Tue Feb 03, 2009 5:07 am

...How?

Post by emf2718 »

I saw in the demo that comes with Irrlicht a few minutes after I posted that it can use zip files with the method addZipFileArchive. But I'm a bit confused as to how it's used. The file has two jpeg's, but neither are referenced in the demo program. Note that I'm not talking about loading a 3D map from a zip file, but loading an image that I can use in a 2D-ish program right now.
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

you just add the zip file using addZipFileArchive() and then you can load the files in the archive like they we on the disk.

So for example you have a zip file "my.zip" with the file "texture..jpg" you would load the texture like that:

Code: Select all

FileSystem->addZipFileArchive( "my.zip" );
ITexture* tex = VideoDriver->getTexture( "texture.jpg" );
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
emf2718
Posts: 4
Joined: Tue Feb 03, 2009 5:07 am

Woah.

Post by emf2718 »

:shock: Never would have guessed it would be that simple...Wow this is one easy engine. :)
Post Reply