NAME

cgGetNextEffect - iterate through effects in a context

SYNOPSIS

  #include <Cg/cg.h>

  CGeffect cgGetNextEffect( CGeffect effect );

PARAMETERS

effect

The current effect.

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.

DESCRIPTION

The effects within a context can be iterated over by using the cgGetNextEffect function.

EXAMPLES

The following example code illustrates one way to do this:

  CGeffect effect = cgGetFirstEffect( context );
  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.

ERRORS

CG_INVALID_EFFECT_HANDLE_ERROR is generated if effect does not refer to a valid effect.

HISTORY

cgGetNextEffect was introduced in Cg 1.4.

SEE ALSO

cgGetFirstEffect