> ## Name

> cgCreateContext - create a context

> ## Synopsis

>     #include <Cg/cg.h>

>     CGcontext cgCreateContext( void );

> ## Parameters

> None.

> ## Return Values

> Returns a valid CGcontext on success.

> Returns NULL if context creation fails.

> ## Description

> cgCreateContext creates a Cg context object and returns its handle. A Cg context is a container for Cg programs. All Cg programs must be added to a Cg context.

> ## Examples

>       CGcontext context = cgCreateContext();

> ## Errors

> CG_MEMORY_ALLOC_ERROR is generated if a context couldn't be created.

> ## History

> cgCreateContext was introduced in Cg 1.1.

> ## See Also

> cgDestroyContext, cgSetContextBehavior, cgGetContextBehavior, cgCreateProgram, cgCreateEffect, cgCreateState