• Advertisement
Sign in to follow this  

Error: Default value for D3DSAMP_DMAPOFFSET....

This topic is 4230 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

Hi, I'm writing my own small engine... and it !(works) ^_^ I've this error while I'm trying to create a texture with the method D3DXCreateTextureFromFile(device,texfname,&texture); The texture loading is managed by a class: It has these members private: LPDIRECT3DDEVICE9 device; //Pointer to a d3d device IDirect3DTexture9 *texture; //Pointer to a d3d texture LPCTSTR texfname; //filename of the texture The constructor I invoke is this OTexture::OTexture(LPDIRECT3DDEVICE9 dev, LPCTSTR fname) { device=dev; device->AddRef(); texfname=fname; LoadTexture(); } This class is inherited from a virtual class ITexture; A texture is created froma another class that mantein a list of textures. So I pass the device to this storage class and then I pass the device to each texture created! The HRESULT of the create texture is: D3DXERR_INVALIDDATA But the filename is correct stored in the texfname member. The address of the device is even the same. I don't know what's happened! I've read other posts of this problem... but I've not found in them a solution. Please help me... here I post the full log of the direct 3d debug mode Direct3D9: (INFO) :======================= Hal SWVP device selected D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.44115e+017f. This is ok. D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[0] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[1] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[2] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[3] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[4] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[5] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[6] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[7] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[8] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[9] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[10] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[11] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[12] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[13] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[14] is incorrect. Expected 0x100, Returned 0x0 D3D9 Helper: Error: Default value for D3DSAMP_DMAPOFFSET[15] is incorrect. Expected 0x100, Returned 0x0

Share this post


Link to post
Share on other sites
Advertisement
I seem to recall that's a known issue on nVidia cards, and it's nothing to worry about - it's unrelated to your problem.

Are you sure the filename is correct, and the file is valid? And are you sure the texture format you're selecting is valid too? It may be worthwhile using D3DXCreateTextureFromFileEx so you can set the texture format.

Also, if you link to d3dx9d.lib instead of d3dx9.lib (If you're not already), you should get some additional help in the debug output, telling you what part of the data is invalid.

Share this post


Link to post
Share on other sites
Hi...

thanks for the help!

I've found the error in the filename of the texture... but there is not normal I think!

texfname is an LPCTSTR... I pass in the constructor the filename and I assign it on texfname.

So when I call the loadtexture, before call in this function the D3DXCreateTexture... I save in a text file the contents of the texfname member... and it contains the right name!!! but the D3DXCreateTexture... fails!!

So I've passed the texture filename as constant L"tex.bmp" directly in the D3DXCreateTexture... and now it works!

I hope to discover this problem!

Share this post


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

  • Advertisement