What's wrong with the texturing?

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
starsgt
Posts: 19
Joined: Tue Jun 29, 2010 3:49 pm

What's wrong with the texturing?

Post 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).
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: What's wrong with the texturing?

Post 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... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
conallmmcg
Posts: 23
Joined: Sun Oct 19, 2008 2:35 pm

Post 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)
starsgt
Posts: 19
Joined: Tue Jun 29, 2010 3:49 pm

Post 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.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post 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
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
starsgt
Posts: 19
Joined: Tue Jun 29, 2010 3:49 pm

Post by starsgt »

Acki wrote:I guess changeWorkingDirectoryTo(...) can help you... :lol:
So what exactly does it do? :shock:
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
starsgt
Posts: 19
Joined: Tue Jun 29, 2010 3:49 pm

Post by starsgt »

I'm somewhat bad @ C++ so I'll have to ask: what's "pure virtual"?
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post 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()).
starsgt
Posts: 19
Joined: Tue Jun 29, 2010 3:49 pm

Post by starsgt »

So can I have an example of how to use this line?
Post Reply