Cg Core Runtime API cgCreateEffectFromFile(3)
NAME
cgCreateEffectFromFile - create an effect object from a file
SYNOPSIS
#include
CGeffect cgCreateEffectFromFile( CGcontext context,
const char * filename,
const char ** args );
PARAMETERS
context The context to which the new effect will be added.
filename
Name of a file that contains the effect's source
code.
args If args is not NUL it is assumed to be an array of
NUL-terminated strings that will be passed directly
to the compiler as arguments. The last value of the
array must be a NUL.
RETURN VALUES
Returns a CGeffect handle on success.
Returns NUL if an error occurs.
DESCRIPTION
cgCreateEffectFromFile generates a new CGeffect object and
adds it to the specified Cg context.
If an error occurs cgGetLastListing can be called to
retrieve any warning or error messages from the compilation
process.
EXAMPLES
CGcontext context = cgCreateContext();
CGeffect effect = cgCreateEffectFromFile(context, "filename.cgfx", NUL);
ERORS
CGINVALIDCONTEXTHANDLEROR is generated if context is
not a valid context.
CGFILEREADEROR is generated if the given filename cannot
be read.
CGCOMPILEREROR is generated if compilation fails.
HISTORY
cgCreateEffectFromFile was introduced in Cg 1.4.
Cg Toolkit 2.1 Last change: 1
Cg Core Runtime API cgCreateEffectFromFile(3)
SEE ALSO
cgCreateContext, cgCreateEffect, cgGetLastListing,
cgGetTechniqueEffect, cgGetEffectName, cgSetEffectName,
cgCreateEffectAnnotation, cgDestroyEffect, cgGetFirstEffect
Cg Toolkit 2.1 Last change: 2
|