Public Group

# glut: can not find tga file.

This topic is 2850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
hi,
i just want to add that i was getting the source of gltReadTGABits() from superBible 5th.

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
hi hodgman:

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

##### Share on other sites

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

##### Share on other sites

[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.

##### Share on other sites
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.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 17
• 25
• 20