Shader changes

This commit is contained in:
Josh Yelon 2005-09-06 22:45:24 +00:00
parent 45aca0885e
commit 8f06d9e0d3
4 changed files with 16 additions and 16 deletions

View File

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

View File

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

View File

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

View File

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