Advertisement

SDL\Linux port problem

Started by August 11, 2004 10:58 AM
2 comments, last by C-Junkie 20 years, 3 months ago
Hi all,
I really don't know where to post this thread, OpenGL, SDL, Nix,...? I finally choose Nehe.

In fact, i'm running Redhat linux 9.0 and using the SDL\Linux port for NeHe's tutorials. Everything is ok, compile,link,run! Everything is fine when i call the program from the terminal, but when i click on it, the textures just don't show up. What's wrong?
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"
My guess is that the paths to the texture files are relative paths. So it's likely when you launch from a terminal, the process is launched from its parent directory, but *not* when launched from a file manager.
A good solution is to modify the program so that it'll manage to find the textures directory.
Hints :
- argv[0] will give a path to the binary (use the dirname function) ;
- the PATH environment variable might be necessary if this path is not absolute.
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Advertisement
another possibility is case sensitivity.

file "Texture.jpg"
you call "texture.jpg"

that sort of thing.
path relativity is correct.

from terminal, the CWD is where the program is, from the GUI, the CWD is probably the home directory.

This topic is closed to new replies.

Advertisement