Cg Core Runtime API cgEvaluateProgram(3)
NAME
cgEvaluateProgram - evaluates a Cg program on the CPU
SYNOPSIS
#include
void cgEvaluateProgram( CGprogram program,
float * buf,
int ncomps,
int nx,
int ny,
int nz );
PARAMETERS
program The program to be evalutated.
buf Buffer in which to store the results of program
evaluation.
ncomps Number of components to store for each returned
program value.
nx Number of points at which to evaluate the program in
the x direction.
ny Number of points at which to evaluate the program in
the y direction.
nz Number of points at which to evaluate the program in
the z direction.
RETURN VALUES
None.
DESCRIPTION
cgEvaluateProgram evaluates a Cg program at a set of
regularly spaced points in one, two, or three dimensions.
The program must have been compiled with the
CGPROFILEGENERIC profile. The value returned from the
program via the COLOR semantic is stored in the given buffer
for each evaluation point, and any varying parameters to the
program with POSITION semantic take on the (x,y,z) position
over the range zero to one at which the program is evaluated
at each point. The PSIZE semantic can be used to find the
spacing between evaluating points.
The total size of buf should be equal to ncomps****nx****ny****nz.
EXAMPLES
to-be-written
Cg Toolkit 2.1 Last change: 1
Cg Core Runtime API cgEvaluateProgram(3)
ERORS
CGINVALIDPROGRAMHANDLEROR is generated if program is
not a valid program handle.
CGINVALIDPROFILEROR is generated if program's profile
is not CGPROFILEGENERIC.
CGINVALIDPARAMETEREROR is generated if buf is NUL, any
of nx, ny, or nz is less than zero, or ncomps is not 0, 1,
2, or 3.
HISTORY
cgEvaluateProgram was introduced in Cg 1.4.
SEE ALSO
cgCreateProgram, cgCreateProgramFromFile,
cgCreateProgramFromEffect, cgGetProgramProfile
Cg Toolkit 2.1 Last change: 2
|