texture problem (always not resolved : see last post)
Quote:Original post by blueShadow
i do :
HRESULT hr=D3DXCreateTextureFromFile(myIDirect3DDevice9, "veg004.jpg", firstTexture);
_ASSERT(hr);
and nothing appends, so i think that it's good.
That assert isn't correct, you want something like:
_ASSERT(!FAILED(hr));
yes, i tried but the error comes from D3DXCreateTextureFromFile which don't load the texture :-(
i do that
if(FAILED((D3DXCreateTextureFromFile(myIDirect3DDevice9, "D:\\veg004.jpg", firstTexture))))
MessageBox(...);
the variable first texture didn't have a new asigned to it, so i have done before these lines :
firstTexture = new LPDIRECT3DTEXTURE9() ;
am i wrong ? because now the program crashes on :
myIDirect3DDevice9->DrawIndexedPrimitive(D3DPT_TRIANGLEFAN , //PrimitiveType
0, 0, 6, 0,
2); //PrimitiveCount
i do that
if(FAILED((D3DXCreateTextureFromFile(myIDirect3DDevice9, "D:\\veg004.jpg", firstTexture))))
MessageBox(...);
the variable first texture didn't have a new asigned to it, so i have done before these lines :
firstTexture = new LPDIRECT3DTEXTURE9() ;
am i wrong ? because now the program crashes on :
myIDirect3DDevice9->DrawIndexedPrimitive(D3DPT_TRIANGLEFAN , //PrimitiveType
0, 0, 6, 0,
2); //PrimitiveCount
i don't think you can create LPD3DXTEXTUREs with "new".
I don't know how you've declared firstTexture, but try this:
(LP means, that it is already a pointer, so if you declared it like this: LPDIRECT3DTEXTURE9* firstTexture, that could cause your problems)
Hope this helps!
I don't know how you've declared firstTexture, but try this:
LPDIRECT3DTEXTURE9 firstTexture;f(FAILED((D3DXCreateTextureFromFile(myIDirect3DDevice9, "D:\\veg004.jpg", &firstTexture))))MessageBox(...);
(LP means, that it is already a pointer, so if you declared it like this: LPDIRECT3DTEXTURE9* firstTexture, that could cause your problems)
Hope this helps!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement