I have a sprite locate at "C:\Users\Jyhe\Documents\Visual Studio 2010\Projects\2D test\2D test\Resources\Sprites\crosshair.png"
and I'm trying to load it with the following code:
D3DXCreateTextureFromFile(rd3dDevice, (GetDirectory().c_str(), L"\\Resources\\Sprites\\crosshair.png"), &crosshair)
But it's failing to load the texture.
My GetDirectory function returns "C:\Users\Jyhe\Documents\Visual Studio 2010\Projects\2D test\2D test" and is as follows:
std::wstring GetDirectory()
{
return currentDir;
}
currentDir is defined as follow:
TCHAR currentDirectory[MAX_PATH + 1];
std::wstring currentDir;
... later on in code
GetCurrentDirectory(MAX_PATH + 1, currentDirectory);
currentDir = currentDirectory;
Any idea why this is failing?