Page 1 of 1

What's wrong with the texturing?

Posted: Sun Jul 18, 2010 11:03 pm
by starsgt
I've been trying to put on a PNG image on an object, but it seems like it doesn't work. It says the file isn't found. Anyone know how to import the PNG into the program and use it? (Note: Putting it in the default folder or the project folder didn't work).

Re: What's wrong with the texturing?

Posted: Sun Jul 18, 2010 11:59 pm
by Acki
starsgt wrote:It says the file isn't found. Anyone know how to import the PNG into the program and use it? (Note: Putting it in the default folder or the project folder didn't work).
just make sure it can be found by the app !!! :lol:
I'm 100% sure the path is wrong !!!
check the working directory and that you use the correct path... ;)

Posted: Mon Jul 19, 2010 3:06 am
by conallmmcg
i'm not gonna lie and say i know irrlicht inside out, but for example just because your model file says it needs for eg C:/examples/texture.png.
does not necessarily mean irrlicht will recognise this.
You must specify in your application that the texture resides in a certain folder or a zip archive for example and load it.
for eg.
you have a model "model.irrmesh" that requires "texture.png"
put them both in a zip file for eg: "example.zip".
and declare in your application , device->getFileSystem()->addZipFileArchive("/path/to/example.zip");

(if you do put them in an archive make sure your model file, do not reference your texture in a specified way for eg. texture = c:/path/to/texture.png(unless you want this)
but let it specify texture = texture.png as what i have experienced is if it is in the same zip file as the model you do not need it referencing it by its path as usually "addZipFileArchive()" sorts all this out)

Posted: Mon Jul 19, 2010 4:15 pm
by starsgt
@Acki - I am also 100% sure that the file path is correct. I triple checked it and it still doesn't work. I tried adding png/bmp/jpg at the end and it still doesn't work.

@conallmmcg - Hold on. What other functions do "getFileSystem" have? It might have what I need.

And no I didn't reference my texture in a specified way.
Thanks in advance.

Posted: Mon Jul 19, 2010 4:46 pm
by slavik262
starsgt wrote:@conallmmcg - Hold on. What other functions do "getFileSystem" have? It might have what I need.
Image

Here you go! You'll find that the API documentation (http://irrlicht.sourceforge.net/docu/index.html) can help you out a lot and save you time. :D

Posted: Mon Jul 19, 2010 4:49 pm
by Acki
starsgt wrote:@Acki - I am also 100% sure that the file path is correct. I triple checked it and it still doesn't work. I tried adding png/bmp/jpg at the end and it still doesn't work.
we'll see at the end... :lol:
starsgt wrote:What other functions do "getFileSystem" have? It might have what I need.
I guess changeWorkingDirectoryTo(...) can help you... :lol:

Posted: Tue Jul 20, 2010 4:28 pm
by starsgt
Acki wrote:I guess changeWorkingDirectoryTo(...) can help you... :lol:
So what exactly does it do? :shock:

Posted: Tue Jul 20, 2010 4:36 pm
by Acki

Posted: Tue Jul 20, 2010 5:47 pm
by starsgt
I'm somewhat bad @ C++ so I'll have to ask: what's "pure virtual"?

Posted: Tue Jul 20, 2010 5:56 pm
by slavik262
Pure virtual means that you're looking at a function that's implemented in a child class of the class you're looking at.

IFileSystem (and almost every other class starting with I) are Interfaces. That means that they just specify what classes like it do, but they don't actually perform those actions themselves. This is useful because even though the file systems for Windows, Mac, and Linux might be different, you can still access each one through a unified interface (IFileSystem from getFileSystem()).

Posted: Tue Jul 20, 2010 6:28 pm
by starsgt
So can I have an example of how to use this line?