cgCreateContext
Keywords: cgCreateContext, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## 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