Browse Source

CgShader added compile protection

Shalin Shodhan 21 years ago
parent
commit
91e54d09f3

+ 6 - 3
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -39,7 +39,9 @@
 #include "colorWriteAttrib.h"
 #include "colorWriteAttrib.h"
 #include "texMatrixAttrib.h"
 #include "texMatrixAttrib.h"
 #include "texGenAttrib.h"
 #include "texGenAttrib.h"
+#ifdef HAVE_CGGL
 #include "cgShaderAttrib.h"
 #include "cgShaderAttrib.h"
+#endif
 #include "materialAttrib.h"
 #include "materialAttrib.h"
 #include "renderModeAttrib.h"
 #include "renderModeAttrib.h"
 #include "fogAttrib.h"
 #include "fogAttrib.h"
@@ -2345,9 +2347,10 @@ issue_tex_matrix(const TexMatrixAttrib *attrib) {
 //               Also maintain the map of CgShader objects to
 //               Also maintain the map of CgShader objects to
 //               respective GLCgShaderContexts
 //               respective GLCgShaderContexts
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
+#ifdef HAVE_CGGL
 void CLP(GraphicsStateGuardian)::
 void CLP(GraphicsStateGuardian)::
 issue_cg_shader_bind(const CgShaderAttrib *attrib) {
 issue_cg_shader_bind(const CgShaderAttrib *attrib) {
-#ifdef HAVE_CGGL
+
   if (attrib->is_off()) { //Current node has no shaders
   if (attrib->is_off()) { //Current node has no shaders
     if (_cg_shader != (CgShader *) NULL) {
     if (_cg_shader != (CgShader *) NULL) {
       _gl_cg_shader_contexts[_cg_shader]->un_bind();// Prev node had shaders
       _gl_cg_shader_contexts[_cg_shader]->un_bind();// Prev node had shaders
@@ -2371,10 +2374,10 @@ issue_cg_shader_bind(const CgShaderAttrib *attrib) {
       csc->bind(this);// Bind the new shader
       csc->bind(this);// Bind the new shader
     }
     }
   }
   }
-#endif
 
 
-}
 
 
+}
+#endif
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CLP(GraphicsStateGuardian)::issue_tex_gen
 //     Function: CLP(GraphicsStateGuardian)::issue_tex_gen
 //       Access: Public, Virtual
 //       Access: Public, Virtual

+ 4 - 0
panda/src/glstuff/glGraphicsStateGuardian_src.h

@@ -35,7 +35,9 @@
 #include "graphicsWindow.h"
 #include "graphicsWindow.h"
 #include "pset.h"
 #include "pset.h"
 #include "pmap.h"
 #include "pmap.h"
+#ifdef HAVE_CGGL
 #include "cgShader.h"
 #include "cgShader.h"
+#endif
 class PlaneNode;
 class PlaneNode;
 class Light;
 class Light;
 
 
@@ -109,7 +111,9 @@ public:
   virtual void issue_fog(const FogAttrib *attrib);
   virtual void issue_fog(const FogAttrib *attrib);
   virtual void issue_depth_offset(const DepthOffsetAttrib *attrib);
   virtual void issue_depth_offset(const DepthOffsetAttrib *attrib);
   virtual void issue_tex_gen(const TexGenAttrib *attrib);
   virtual void issue_tex_gen(const TexGenAttrib *attrib);
+#ifdef HAVE_CGGL
   virtual void issue_cg_shader_bind(const CgShaderAttrib *attrib);
   virtual void issue_cg_shader_bind(const CgShaderAttrib *attrib);
+#endif
   //  virtual void issue_stencil(const StencilAttrib *attrib);
   //  virtual void issue_stencil(const StencilAttrib *attrib);
 
 
   virtual void bind_light(PointLight *light_obj, const NodePath &light, 
   virtual void bind_light(PointLight *light_obj, const NodePath &light,