Jump to content
  • Advertisement
Sign in to follow this  
prux

Direct3D 8.1 Clear triggers D3DERR_INVALIDCALL

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

hey, here is my Clear function calling which drops error: Clear (0, nil, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1, 0); Z buffer is enabled. Actualy, normally it does work, but now that I set a surface to render to, it fails. I heard I should attach a zbuffer or stencil buffer to this 2nd surface, but how?

Share this post


Link to post
Share on other sites
Advertisement
It returns D3DERR_INVALIDCALL because the render target you're Clear()ing doesn't have a z-buffer attached to it. You need to attach one with a call to SetDepthStencilSurface() (At least that's what you do in DX9, it's probably the same in DX8).

Out of interest, why are you using DX8?

Share this post


Link to post
Share on other sites
on another way:

Device->CreateDepthStencilSurface (ResolutionX,ResolutionY, D3DFMT_D16, D3DMULTISAMPLE_NONE, newstencil)

and

Device->SetRenderTarget (3rdSurface, newstencil)
drawings
Device->SetRenderTarget (BackBuffer, 0)

I get a little "crashed" image, it looks as if I didnt clear something. I clear like this:

Clear (0,null, D3DCLEAR_ZBUFFER | D3DCLEAR_TARGET, 0x000000, 1, 0)

and no change. Without setting "newstencil", it worked good.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!