glut: can not find tga file.

Started by
6 comments, last by nickme 12 years, 2 months ago
hi
i tried to load a TGA files from my harddisk but the gltReadTGABits() always return NULL. i tried to copy the TGA file next to where the source file is and copy it to the debug folder(i was in the debug mode), i check and recheck the file name, but it still return NULL. does anybody have any idea what i should check again? i

thanks
Advertisement
hi,
i just want to add that i was getting the source of gltReadTGABits() from superBible 5th.
You say you are in debug mode, does that mean launching the application from your IDE (eg Visual Studio, Code::Blocks)? If you do, try launching it from the folder the executable is in.
When you launch from your IDE, it will set the working directory to a particular path (which you can configure in your IDE's debugging properties).

Any file paths that you use in your program will be relative to this working directory.
hi hodgman:

the wikipedia is dark today, i will look at it tomorrow.
thanks

When you launch from your IDE, it will set the working directory to a particular path (which you can configure in your IDE's debugging properties).

Any file paths that you use in your program will be relative to this working directory.


hi,
i checked the project property and found that the working directory is $(ProjectDir). it should be OK, right? is there a way to peek at what $(ProjectDir) represent?

thanks

[quote name='Hodgman' timestamp='1326860046' post='4903881']
When you launch from your IDE, it will set the working directory to a particular path (which you can configure in your IDE's debugging properties).

Any file paths that you use in your program will be relative to this working directory.


hi,
i checked the project property and found that the working directory is $(ProjectDir). it should be OK, right? is there a way to peek at what $(ProjectDir) represent?

thanks
[/quote]

The ProjectDirectory is where your code files are, not where the final .exe file is. Make sure that the .tga and .exe files are in the same place, and then try launching the exe NOT from the IDE, but from Explorer.
hi
thanks for the help. as it turned out the original tga file that i created was in compressed format. after i found that out, i changed the format, now it run as expected.

thanks again.

This topic is closed to new replies.

Advertisement