cgCreateBuffer(3)

NAME
cgCreateBuffer - create a buffer object managed by the runtime

SYNOPSIS
  #include <Cg/cg.h>
  CGbuffer cgCreateBuffer( CGcontext context,
                           int size,
                           const void *data,
                           CGbufferusage bufferUsage );

PARAMETERS
The context to which the new buffer will be added. The length in bytes of the buffer to create. Pointer to inital buffer data. NULL will fill the buffer with zero. Indicates the intended usage method of the buffer.

Can be one of the following types:

RETURN VALUES
Returns a CGbuffer handle on success.

Returns NULL if an error occurs.

DESCRIPTION
cgCreateBuffer creates a runtime managed Cg buffer object.

There is no way to query the 3D API-specific resource for a managed buffer. cgGLCreateBuffer should be used if the application wishes to later query the 3D API-specific resource for the buffer.

EXAMPLES
  CGbuffer myBuffer = cgCreateBuffer( myCgContext, sizeof( float ) * 16,
                                      initalData, CG_BUFFER_USAGE_STATIC_DRAW );

ERRORS
CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.

HISTORY
cgCreateBuffer was introduced in Cg 2.0.

SEE ALSO
cgGLCreateBuffer, cgDestroyBuffer