// create texture
BOOL Window_main::CreateTexture()
{
if(FAILED(D3DXCreateTextureFromFile(pointer_deviced3d,"Image2.bmp", &pointer_texture)))
return FALSE;
}
Error creating texture
I'm trying to draw a texture in directX but this line keeps returning false, id it possible that my graphics card or an uninstalled DLL is the cause of this?
in case it matters : Image2 is a 4 KB large Bitmap Image in the section where my all my source code's and headers can be found.
Two things immediately spring to mind.
1) The image has to be in the application's current working directory. That isn't necessarily the same as your source folder. If you're using Visual C++ then check in the project properties, in the debug section and there's a box to change the start folder when debugging.
2) Your graphics card doesn't support images of that size (although, if it's fairly recent then it should). Run the DXCapsViewer tool and it's listed in the "D3D Device Types/HAL/Caps" section.
HTH.
1) The image has to be in the application's current working directory. That isn't necessarily the same as your source folder. If you're using Visual C++ then check in the project properties, in the debug section and there's a box to change the start folder when debugging.
2) Your graphics card doesn't support images of that size (although, if it's fairly recent then it should). Run the DXCapsViewer tool and it's listed in the "D3D Device Types/HAL/Caps" section.
HTH.
Is that the *entire* function?
If so, is there any *particular* reason you would expect it to return TRUE if the D3DXCreateTextureFromFile succeeded? If it does, you reach the end of the function without explicitly returning anything. :\
If so, is there any *particular* reason you would expect it to return TRUE if the D3DXCreateTextureFromFile succeeded? If it does, you reach the end of the function without explicitly returning anything. :\
Quote:Original post by Zahlman
Is that the *entire* function?
If so, is there any *particular* reason you would expect it to return TRUE if the D3DXCreateTextureFromFile succeeded? If it does, you reach the end of the function without explicitly returning anything. :\
Save time writing brackets, lose time debugging the resulting bugs ;).
If it is the whole function, his code should not even compile, the function has to return a bool value, while it only does when the statement is true.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement