2
0
Josh Yelon 20 жил өмнө
parent
commit
8f06d9e0d3

+ 5 - 5
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -68,8 +68,8 @@
 #include "shader.h"
 #include "shaderMode.h"
 
-#ifdef CGGL
-#include "Cg/CgGL.h"
+#ifdef HAVE_CGGL
+#include "Cg/cgGL.h"
 #endif
 
 #include <algorithm>
@@ -859,7 +859,7 @@ reset() {
 
   _error_count = 0;
 
-#ifdef CGGL
+#ifdef HAVE_CGGL
   _cg_context = cgCreateContext();
   if (_cg_context != 0) {
     _cg_vprofile = cgGLGetLatestProfile(CG_GL_VERTEX);
@@ -4762,9 +4762,9 @@ finish_modify_state() {
 ////////////////////////////////////////////////////////////////////
 void CLP(GraphicsStateGuardian)::
 free_pointers() {
-#ifdef CGGL
+#ifdef HAVE_CGGL
   if (_cg_context) {
-    cgDeleteContext(_cg_context);
+    cgDestroyContext(_cg_context);
     _cg_context = 0;
   }
 #endif

+ 3 - 3
panda/src/glstuff/glGraphicsStateGuardian_src.h

@@ -41,8 +41,8 @@
 #include "shader.h"
 #include "shaderMode.h"
 
-#ifdef CGGL
-#include "Cg/CgGL.h"
+#ifdef HAVE_CGGL
+#include "Cg/cgGL.h"
 #endif
 
 class PlaneNode;
@@ -389,7 +389,7 @@ public:
   typedef pvector<GLuint> DeletedDisplayLists;
   DeletedDisplayLists _deleted_display_lists;
 
-#ifdef CGGL
+#ifdef HAVE_CGGL
   CGcontext _cg_context;
   CGprofile _cg_vprofile;
   CGprofile _cg_fprofile;

+ 5 - 5
panda/src/glstuff/glShaderContext_src.cxx

@@ -31,7 +31,7 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *gsg, Shader *s) : ShaderContext(s
   s->parse_init();
   s->parse_line(header, true, true);
   
-#ifdef CGGL
+#ifdef HAVE_CGGL
   _cg_vprogram = 0;
   _cg_fprogram = 0;
 
@@ -46,11 +46,11 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *gsg, Shader *s) : ShaderContext(s
     s->parse_upto(fs, "---*---", false);
 
     _cg_vprogram = cgCreateProgram(_gsg->_cg_context, CG_SOURCE,
-                                   vp.c_str(), _gsg->_cg_vprofile,
-                                   "main", (char**)NULL);
+                                   vs.c_str(), _gsg->_cg_vprofile,
+                                   "main", (const char**)NULL);
     _cg_fprogram = cgCreateProgram(_gsg->_cg_context, CG_SOURCE,
-                                   fp.c_str(), _gsg->_cg_fprofile,
-                                   "main", (char**)NULL);
+                                   fs.c_str(), _gsg->_cg_fprofile,
+                                   "main", (const char**)NULL);
     
     if ((_cg_vprogram==0)||(_cg_fprogram == 0)) {
       if (_cg_vprogram != 0) cgDestroyProgram(_cg_vprogram);

+ 3 - 3
panda/src/glstuff/glShaderContext_src.h

@@ -18,8 +18,8 @@
 
 #include "pandabase.h"
 #include "shaderContext.h"
-#ifdef CGGL
-#include "Cg/CgGL.h"
+#ifdef HAVE_CGGL
+#include "Cg/cgGL.h"
 #endif
 
 class CLP(GraphicsStateGuardian);
@@ -43,7 +43,7 @@ public:
 private:
   CLP(GraphicsStateGuardian) *_gsg;
   
-#ifdef CGGL
+#ifdef HAVE_CGGL
   CGprogram _cg_vprogram;
   CGprogram _cg_fprogram;
 #endif