Need help with CreateTexutre

Started by
3 comments, last by Nytegard 22 years, 8 months ago
I can't seem to get this to work for any reason whatsoever.
    
HRESULT returnvalue;
IDirect3DSurface8 *BitmapTexture;
returnvalue = d3dDevice->CreateTexture(32, 32, 0, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED, &BitmapTexture);
  
The problem is, returnvalue always returns with a value of D3DERR_INVALIDCALL. I know the device is working correctly because if I use D3DXCreateTexture it works, but I don't want to use the D3DX library. Edited by - Nytegard on August 3, 2001 9:01:54 AM
Advertisement
From the docs of D3DXCreateTexure:
Remarks:
Internally, D3DXCreateTexture uses D3DXCheckTextureRequirements to adjust the calling parameters. Therefore, calls to D3DXCreateTexture will often succeed where calls to IDirect3Ddevice8::CreateTexture would fail.

So this means that if you call D3DXCT with D3DFMT_X8R8G8B8 the created texture does not have to be in this format (to get the format use the GetLevelDesc method). Use CheckDeviceFormat to ensure your selected format is supported by the device.

Bjørn.
We are boki. The rest is known.
CheckDeviceFormat returned D3D_OK when I passed D3DFMT_X8R8G8B8.
I''m using this on a GeForce 3, and I''m pretty sure it accepts this value even without CheckDeviceFormat.

Guess it''s time to try switching video drivers and see if that fixes the problem.
Ok, as the AP mentioned in the other thread use IDirect3DTexture8 instead of IDirect3DSurface8.

Bjørn.
We are boki. The rest is known.
Oops, guess I was in a hurry to convert my DX7 code to DX8 code. Thanks.

This topic is closed to new replies.

Advertisement