cgGLCreateBuffer(3)

NAME
cgGLCreateBuffer - create an OpenGL buffer object

SYNOPSIS
  #include <Cg/cgGL.h>
  CGbuffer cgGLCreateBuffer( CGcontext context,
                             int size,
                             const void *data,
                             GLenum bufferUsage );

PARAMETERS
The context to which the new buffer will be added. The length in bytes of the buffer to create. The inital data to be copied into the buffer. NULL will fill the buffer with zero. One of the usage flags specified as valid for glBufferData.

RETURN VALUES
Returns a CGbuffer handle on success.

Returns NULL if any error occurs.

DESCRIPTION
cgGLCreateBuffer creates an OpenGL buffer object.

EXAMPLES
  CGbuffer myBuffer = cgGLCreateBuffer( myCgContext, sizeof( float ) * 16,
                                        myData, GL_STATIC_DRAW );

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

HISTORY
cgGLCreateBuffer was introduced in Cg 2.0.

SEE ALSO
cgCreateBuffer, cgGLGetBufferObject