|
Files
Class List
Class Members
Class Hierarchy
|
|
cyCgProgramContainer Class Template Reference#include <cyCg.h>
List of all members.
Detailed Description
template<class T>
class cyCgProgramContainer< T >
Multiple versions of the same Cg program.
Sometimes you may want to compile several versions of the same Cg program with different compiler options. This template class makes this process easier. It keeps an array of Cg programs. You can compile them all at once, and access them individually.
|
Public Member Functions |
| void | CreateFromFile (int numProgs, int type, const char *program_file, const char *entry,...) |
| | Creates a number of programs using the same file and same program entry with different compiler options.
|
|
T & | operator[] (int id) |
| | You can access each individual program using this operator.
|
|
void | Bind (int id) |
| | Binds the specified Cg program.
|
Protected Attributes |
|
T * | progs |
Member Function Documentation
| void CreateFromFile |
( |
int |
numProgs, |
|
|
int |
type, |
|
|
const char * |
program_file, |
|
|
const char * |
entry, |
|
|
|
... |
|
) |
[inline] |
|
|
|
Creates a number of programs using the same file and same program entry with different compiler options.
The argument numProgs defines the number of programs, type is either CG_GL_VERTEX or CG_GL_FRAGMENT, program_file is the file name of the Cg program, and entry is the name of the shader. This method expects a separate argument string for each program. Ex: CreateFromFile( 2, CG_GL_VERTEX, file, entry, "-DLEVEL=1", "-DLEVEL=2" ); |
|