Jump to content
  • Advertisement
Sign in to follow this  
akira32

How do I get the current CullMode

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

hr=pd3dDevice->SetRenderState( D3DRS_CULLMODE , D3DCULL_CCW  );
DWORD value=0;
hr=pd3dDevice->GetRenderState(D3DRS_CULLMODE,&value);//-2005530516

I want to get the current cullmoe by GetRenderState function. But the function of GetRenderState return the value of -2005530516. hr=-2005530516 HRESULT: 0x8876086c (2289436780) Name: D3DERR_INVALIDCALL Description: Invalid call Severity code: Failed Facility Code: FACILITY_D3D (2166) Error Code: 0x086c (2156) And it appears some message as blow: Direct3D9: (ERROR) :GetRenderState does not work in pure-device Windows has triggered a breakpoint in Shadow Map.exe. This may be due to a corruption of the heap, and indicates a bug in Shadow Map.exe or any of the DLLs it has loaded. The output window may have more diagnostic information

Share this post


Link to post
Share on other sites
Advertisement
Most Get*() calls fail for a pure device. Either create the device as non-pure (Don't include the D3DCREATE_PUREDEVICE flag when calling CreateDevice()), or cache it yourself in your app (I.e. a member variable of your renderer class containing the last set cull mode and any other render states you need).

Personally, I cache all device state in my renderer class so I can use Get*() calls with a pure device, and so I can correctly and gravefully recover from a device reset (Because all device state information gets reset to defaults when the device is reset).

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!