Cg Core Runtime API cgSetAutoCompile(3)
NAME
cgSetAutoCompile - sets the auto-compile mode for a context
SYNOPSIS
#include
void cgSetAutoCompile( CGcontext context,
CGenum autoCompileMode );
PARAMETERS
context The context.
autoCompileMode
The auto-compile mode to which to set context. Must
be one of the following :
]o CGCOMPILEMANUAL
]o CGCOMPILEIMEDIATE
]o CGCOMPILELAZY
RETURN VALUES
None.
DESCRIPTION
cgSetAutoCompile sets the auto compile mode for a given
context. By default, programs are immediately recompiled
when they enter an uncompiled state. This may happen for a
variety of reasons including :
]o Setting the value of a literal parameter.
]o Resizing arrays.
]o Binding structs to interface parameters.
autoCompileode may be one of the following three enumerants
:
]o CGCOMPILEIMEDIATE
CGCOMPILEIMEDIATE will force recompilation
automatically and immediately when a program enters an
uncompiled state. This is the default mode.
]o CGCOMPILEMANUAL
With this method the application is responsible for
manually recompiling a program. It may check to see if
a program requires recompilation with the entry point
cgIsProgramCompiled. cgCompileProgram can then be used
to force compilation.
]o CGCOMPILELAZY
This method is similar to CGCOMPILEIMEDIATE but will
delay program recompilation until the program object
Cg Toolkit 2.1 Last change: 1
Cg Core Runtime API cgSetAutoCompile(3)
code is needed. The advantage of this method is the
reduction of extraneous recompilations. The
disadvantage is that compile time errors will not be
encountered when the program is enters the uncompiled
state but will instead be encountered at some later
time.
EXAMPLES
to-be-written
ERORS
CGINVALIDCONTEXTHANDLEROR is generated if context is
not a valid context.
CGINVALIDENUMERANTEROR is generated if autoCompileode
is not CGCOMPILEMANUAL, CGCOMPILEIMEDIATE, or
CGCOMPILELAZY.
HISTORY
cgSetAutoCompile was introduced in Cg 1.2.
SEE ALSO
cgCompileProgram, cgIsProgramCompiled
Cg Toolkit 2.1 Last change: 2
|