diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index a5541de340..ccbedf7141 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -546,7 +546,8 @@ do_clear(const RenderBuffer &buffer) { if (FAILED(hr2)) { dxgsg8_cat.error() << "Unable to clear depth buffer; removing.\n"; - _current_properties->set_depth_bits(0); + // This is really hacky code. + ((FrameBufferProperties *)_current_properties)->set_depth_bits(0); } } if (buffer_type & RenderBuffer::T_stencil) { @@ -556,7 +557,8 @@ do_clear(const RenderBuffer &buffer) { if (FAILED(hr2)) { dxgsg8_cat.error() << "Unable to clear stencil buffer; removing.\n"; - _current_properties->set_stencil_bits(0); + // This is really hacky code. + ((FrameBufferProperties *)_current_properties)->set_stencil_bits(0); } } } diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index fc1508bcbc..1faf934246 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -838,7 +838,8 @@ do_clear(const RenderBuffer &buffer) { if (FAILED(hr2)) { dxgsg9_cat.error() << "Unable to clear depth buffer; removing.\n"; - _current_properties->set_depth_bits(0); + // This is really hacky code. + ((FrameBufferProperties *)_current_properties)->set_depth_bits(0); } } if (buffer_type & RenderBuffer::T_stencil) { @@ -848,7 +849,8 @@ do_clear(const RenderBuffer &buffer) { if (FAILED(hr2)) { dxgsg9_cat.error() << "Unable to clear stencil buffer; removing.\n"; - _current_properties->set_stencil_bits(0); + // This is really hacky code. + ((FrameBufferProperties *)_current_properties)->set_stencil_bits(0); } } }