Skip to main content
gamedev.net
🔒 Locked

Creating texture

Started by ji yan Apr 21, 2002 at 12:46 AM 9 replies 500+ views
Original Post
ji yan
ji yan
I created my texture in this way: if(FAILED(m_pd3dDevice->CreateTexture(256, 256, 0, 0, D3DFMT_P8, D3DPOOL_MANAGED, &m_pFiremap))) { return E_FAIL; } the parameter D3DFMT_P8, according to doc, defines the surface format as 8-bit color indexed. But I do not know why the value returned is E_FAIL. Can anyone give some ideas? Thanks for any help!!!
IndirectX
IndirectX
Switch to the debug runtime, and it should give you a hint.
---visit #directxdev on afternet <- not just for directx, despite the name
ji yan
ji yan
can you tell me how to do that???
IndirectX
IndirectX
Go to control panel, DX, D3D, and select use debug runtime. I also check ''break on assert'' box. If you don''t have DX in control panel, install debug runtime from the SDK.
---visit #directxdev on afternet <- not just for directx, despite the name
ji yan
ji yan
even more weird thing happend: code that runs well under retail version now doen''t work under debug version. Here is the piece of code that failed:

if(FAILED(m_pd3dDevice->SetPaletteEntries(currIndex + 1 ,m_mypal)))
return E_FAIL;

Oh, and my original error still exists and I got no response at all from debug version???
IndirectX
IndirectX
Did you set ''debug output level'' slider to maximum?
---visit #directxdev on afternet <- not just for directx, despite the name
ji yan
ji yan
Yes sir, not a bit of hint!!!

The function just returned a E_FAIL value and the program ends unexpectedly!!

IndirectX
IndirectX
You have to look in the debug output to see the information from D3D debug runtime. In MSVC6, use Alt+2.
---visit #directxdev on afternet <- not just for directx, despite the name
ji yan
ji yan
I did what you told me to do and the output is faliure creating texture which does not help much.
IndirectX
IndirectX
Well, if the debug runtime gives you absolutely zero information, I''d say that your texture format is incompatible with your device. Try 16-bit or 32-bit ones.
---visit #directxdev on afternet <- not just for directx, despite the name
ji yan
ji yan
I guess so, too. Thanks for your help!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.