diff --git a/panda/src/dxgsg9/config_dxgsg9.cxx b/panda/src/dxgsg9/config_dxgsg9.cxx index 74b0521c04..16f822112c 100755 --- a/panda/src/dxgsg9/config_dxgsg9.cxx +++ b/panda/src/dxgsg9/config_dxgsg9.cxx @@ -21,6 +21,7 @@ #include "dxTextureContext9.h" #include "dxVertexBufferContext9.h" #include "dxIndexBufferContext9.h" +#include "dxShaderContext9.h" #include "dxGeomMunger9.h" #include "graphicsPipeSelection.h" #include "wdxGraphicsWindow9.h" @@ -202,6 +203,7 @@ init_libdxgsg9() { DXTextureContext9::init_type(); DXVertexBufferContext9::init_type(); DXIndexBufferContext9::init_type(); + CLP(ShaderContext)::init_type(); DXGeomMunger9::init_type(); wdxGraphicsPipe9::init_type(); diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 236f37042d..c2fe811ba3 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -2432,15 +2432,13 @@ reset() { } #ifdef HAVE_CGDX9 - if (_cg_context) { - cgD3D9SetDevice (NULL); - cgDestroyContext (_cg_context); - _cg_context = 0; - } if (_cg_context == 0) { _cg_context = cgCreateContext ( ); cgD3D9SetDevice (_d3d_device); } + else { + cgD3D9SetDevice (_d3d_device); + } #endif _max_vertices_per_array = d3d_caps.MaxVertexIndex;