Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texture Path finding...

Started by GENTS Jan 20, 2005 at 4:30 PM 4 replies 1.2k views
Original Post
GENTS
GENTS
I've a problem in solving this siutation: I've a texture name and his extension and I want to use a D3DXCreateTextureFromFileEx() Function to load it in my app... I want to add to texture name the folder path... I've tried using some strcpy(), strcat() functions and even if results is ok when I try to print it in a file or in debug, it still doesn't load any texture... How can i solve this problem?! Is there any function to add my path to texture name and then to pass it to D3DXCreateTextureFromFileEx() function?! THANKS A LOT!!! PS: I've solved Load params from FX files!!! Thanks to you all ^__^
Mercury
Mercury
Why don't you keep a configuration file with the path to the game data? With the path, just append the filename when loading it. No matter where you run the executable and have the configuration file in the same directory, it will know from the configuration file where its data is.
Mercury
Mercury
It's pretty basic string stuff:

	char Path[] = "C:\\Dir\\";	char File[] = "FunkyNess.ext";	char PathFilename[MAX_PATH];	strcpy( PathFilename, Path );	strcat( PathFilename, File );
eFoDay
eFoDay
std::ostringstream oss;oss << "textures/" << d3dxMtrls.pTextureFilename;D3DXCreateTextureFromFileEx(pDevice, oss.str().c_str(), D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTexture);

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.