Jump to content
  • Advertisement
Sign in to follow this  
vs322

DirectX Release vs. Debug Bug

This topic is 3654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Noticed what seems like a bug to me with the release version of DirectX. When I am using the debug version the code
D3DXCreateTextureFromFile(pd3dDevice,"MobStateFlags.tga", &TexStateFlags);
int iStateTexDim = TexStateFlags->Width;


sets iStateTexDim to 1024, which is correct. However with the release version it is set to 21. I am wondering if anyone else has encountered this or something similar. I am using the June '08 sdk, vsc++ 2005 express, and am switching between the 2 versions using dxcpl.exe. Any input would be great. thanks -vs EDIT: for now I am getting around it like this:
	D3DXIMAGE_INFO pSrcInfo;
	char* stTexFile = "MobStateFlags.tga";
	D3DXGetImageInfoFromFile(stTexFile,&pSrcInfo);
	D3DXCreateTextureFromFile(pd3dDevice,stTexFile, &TexStateFlags);
	iStateTexDim = pSrcInfo.Width;

which is probably the more correct way to do it anyway.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by MJP
IDirect3DTexture9 doesn't have a "Width" member...if you want the dimensions of a texture's top-level surface you need to use IDirect3DTexture9::GetSurfaceLevel.

Those are a part of the additional debugging tools, but unfortunately they are out-of-date. Some of the values are swapped. Avoid using these. You need to set a define for them to show up.

Share this post


Link to post
Share on other sites
Quote:
Original post by sirob
Quote:
Original post by MJP
IDirect3DTexture9 doesn't have a "Width" member...if you want the dimensions of a texture's top-level surface you need to use IDirect3DTexture9::GetSurfaceLevel.

Those are a part of the additional debugging tools, but unfortunately they are out-of-date. Some of the values are swapped. Avoid using these. You need to set a define for them to show up.


Thanks to you both. I came across them just from intelesence and I sorta knew I was doing something wrong as they weren't in the docs. Anyway I've already moved away from them, but I like knowing why they were there in the first place.

-Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!