Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DX9 Fails on second CreateTexture

24 views
Skip to first unread message

gd

unread,
Nov 22, 2009, 10:56:21 PM11/22/09
to
i got a problem when creating my own texture twice.

IDirect3DTexture9* pDiffuseTexture = 0;
IDirect3DTexture9* pNormalMapTexture = 0;
HRESULT hr = 0;

hr = g_pd3d9Device->CreateTexture(256, 256, 1, 0, D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT, &pDiffuseTexture, 0)));
hr = g_pd3d9Device->CreateTexture(256, 256, 1, 0, D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT, &pNormalMapTexture, 0)));

on first pass, it returns S_OK. But second pass it returns
D3DERR_INVALIDCALL. The parameter is same.
what is the problem actually?

thanks.

Richard [Microsoft Direct3D MVP]

unread,
Nov 23, 2009, 7:52:30 AM11/23/09
to
[Please do not mail me a copy of your followup]

Direct3D Programming Tip #5: Use the Debug Runtime
<http://legalizeadulthood.wordpress.com/2009/06/28/direct3d-programming-tip-5-use-the-debug-runtime/>

--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

gd

unread,
Nov 23, 2009, 11:25:42 AM11/23/09
to
thanks, i did. but on output stream shows this message.

Direct3D9: (ERROR) :Invalid format specified for texture
Direct3D9: (ERROR) :Failure trying to create a texture

i checked on caps viewier that my graphic card affords uses D3DFMT_A8R8G8B8.
but i didn't understant, on second pass still fails.

"Richard [Microsoft Direct3D MVP]" <legaliz...@mail.xmission.com>
ditulis dalam berita pesan:OFaQSvDb...@TK2MSFTNGP05.phx.gbl...

Richard [Microsoft Direct3D MVP]

unread,
Nov 23, 2009, 4:31:26 PM11/23/09
to
[Please do not mail me a copy of your followup]

"gd" <gedebo...@gmail.com> spake the secret code
<F86C2931-2180-4F63...@microsoft.com> thusly:

>thanks, i did. but on output stream shows this message.
>
>Direct3D9: (ERROR) :Invalid format specified for texture
>Direct3D9: (ERROR) :Failure trying to create a texture
>
>i checked on caps viewier that my graphic card affords uses D3DFMT_A8R8G8B8.
>but i didn't understant, on second pass still fails.

Then it seems the process is elsewhere, since I see nothing wrong with
the 5 lines of code you posted. Unless of course that isn't the
*actual* code you're executing, but just your paraphrase of what is
executing. I notice that in the code you posted, you store the
HRESULT from the function, but don't actually check it.

Richard [Microsoft Direct3D MVP]

unread,
Nov 23, 2009, 5:24:57 PM11/23/09
to
[Please do not mail me a copy of your followup]

(Richard) legaliz...@mail.xmission.com spake the secret code
<OApKRRIb...@TK2MSFTNGP06.phx.gbl> thusly:

>Then it seems the process is elsewhere, [...]

That should be "it seems the *problem* is elsewhere".

0 new messages