NAME

cgGetNumParentTypes - gets the number of parent types of a given type

SYNOPSIS

  #include <Cg/cg.h>

  int cgGetNumParentTypes( CGtype type );

PARAMETERS

type

The child type.

RETURN VALUES

Returns the number of parent types.

Returns 0 if there are no parents.

DESCRIPTION

cgGetNumParentTypes returns the number of parents from which type inherits.

A parent type is one from which the given type inherits, or an interface type that the given type implements.

Note that the current Cg language specification implies that a type may only have a single parent type -- an interface implemented by the given type.

EXAMPLES

Given the type definitions:

  interface myiface {
    float4 eval(void);
  };

  struct mystruct : myiface {
    float4 value;
    float4 eval(void ) { return value; }
  };

mystruct has a single parent type, myiface.

ERRORS

None.

HISTORY

cgGetNumParentTypes was introduced in Cg 1.2.

SEE ALSO

cgGetParentType