NAME
cgGetNextEffect - iterate through effects in a context
SYNOPSIS
#include <Cg/cg.h> CGeffect cgGetNextEffect( CGeffect effect );PARAMETERS
- effect
Specifies the current effect.
DESCRIPTION
The effects within a context can be iterated over by using the cgGetNextEffect function. The following example code illustrates one way to do this:
CGeffect effect = cgGetFirstEffect( ctx ); while( effect ) { /* do something with effect */ effect = cgGetNextEffect( effect ); }Note that no specific order of traversal is defined by this mechanism. The only guarantee is that each effect will be visited exactly once. No guarantees can be made if effects are created or deleted during iteration.
RETURN VALUES
cgGetNextEffect returns the next effect in the context's internal sequence of effects. Returns 0 when prog is the last effect in the context.
ERRORS
CG_INVALID_EFFECT_HANDLE_ERROR is generated if effect does not refer to a valid effect.
SEE ALSO