Fix shader issues on D3D Device Reset (resize window, ...)

Do not create a new shader context, but reuse old context and just set the D3D device for Cg.
This commit is contained in:
aignacio_sf 2006-03-28 02:11:38 +00:00
parent 338791f68b
commit cb90d793d0
2 changed files with 5 additions and 5 deletions

View File

@ -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();

View File

@ -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;