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.

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 on other sites
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.

Share on other sites
Quote:
 Original post by MJPIDirect3DTexture9 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 on other sites
Quote:
Original post by sirob
Quote:
 Original post by MJPIDirect3DTexture9 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.

• 15
• 11
• 9
• 49
• 12
• Forum Statistics

• Total Topics
631391
• Total Posts
2999730
×