The following code for C++ DirectX Visual Studio 2012:
HRESULT result;
sprite = NULL;
result = D3DXCreateSprite( gfx.d3dDevice, &sprite );
assert( !FAILED( result ) );
gTexture = NULL;
result = D3DXCreateTextureFromFile( gfx.d3dDevice, _fileName, &gTexture );
assert( !FAILED( result ) );
says that the first assert the result is S_OK, but when it gets to the second assert, it just states a pointer and gives an assertion fail error window? I can't tell what's wrong with it because it is giving me nothing to work with!
Any ideas what I'm doing wrong?
_filename is a .jpg -> "Images/Scene/Area/Background.jpg"
EDIT:: I have found the problem but still, how do I get back a result that would help me solve this issue better? It was a bad file path... I don't understand why result doesn't give me anything back?
You can use the DXGetErrorString
and DXGetErrorDescription
functions to get info about the errors.
Also, you shouldn't use assertions for this. These are errors that can happen under normal circumstances, not development errors.