From 8f06d9e0d33bd216de5bf7f20793210f520fbe83 Mon Sep 17 00:00:00 2001 From: Josh Yelon Date: Tue, 6 Sep 2005 22:45:24 +0000 Subject: [PATCH] Shader changes --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 10 +++++----- panda/src/glstuff/glGraphicsStateGuardian_src.h | 6 +++--- panda/src/glstuff/glShaderContext_src.cxx | 10 +++++----- panda/src/glstuff/glShaderContext_src.h | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 2677e3a82c..6e791f46f2 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/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 @@ -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 diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 68ecd61b76..3ce0deb003 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/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 DeletedDisplayLists; DeletedDisplayLists _deleted_display_lists; -#ifdef CGGL +#ifdef HAVE_CGGL CGcontext _cg_context; CGprofile _cg_vprofile; CGprofile _cg_fprofile; diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 03d80fc45b..1ff4667ea5 100755 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/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); diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index 4765021d7f..2afb40ede2 100755 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/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