Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Cg.cpp File Reference

#include "Cg.h"
#include <assert.h>

Go to the source code of this file.

Functions

CgObjectsCg ()
 Access to global Cg Objects.

void releaseCg ()
 Release all resources associated with Cg (excluding shader objects).


Variables

CgObjectsg_pCg = NULL


Function Documentation

CgObjects* Cg  ) 
 

Access to global Cg Objects.

Global objects are created when this function is first called. They must be destroyed manually after all shaders are deleted using a call to releaseCg()

Definition at line 92 of file Cg.cpp.

References g_pCg.

Referenced by CgObjects::cgErrorCallback(), CgFragmentProgram::setup(), CgVertexProgram::setup(), and CgProgram::setup().

00093 {
00094   if (g_pCg == NULL) {
00095     printf( "Initializing Cg ... " );
00096     g_pCg = new CgObjects;
00097     printf( "done.\n" );
00098   }
00099   return g_pCg;
00100 }

void releaseCg  ) 
 

Release all resources associated with Cg (excluding shader objects).

Definition at line 102 of file Cg.cpp.

References g_pCg.

00103 {
00104   printf( "Destroying Cg Objects ....\n" );
00105   delete g_pCg;
00106   g_pCg = NULL;
00107 }


Variable Documentation

CgObjects* g_pCg = NULL [static]
 

Definition at line 6 of file Cg.cpp.

Referenced by Cg(), and releaseCg().


Generated on Thu Jan 20 02:47:13 2005 for Projective_Texture_Effect_Demo by doxygen 1.3.6