Cg Core Runtime API cgCreateBuffer(3)
NAME
cgCreateBuffer - create a buffer object managed by the
runtime
SYNOPSIS
#include
CGbuffer cgCreateBuffer( CGcontext context,
int size,
const void *data,
CGbufferusage bufferUsage );
PARAMETERS
context The context to which the new buffer will be added.
size The length in bytes of the buffer to create.
data Pointer to inital buffer data. NUL will fill the
buffer with zero.
bufferUsage
Indicates the intended usage method of the buffer.
Can be one of the following types:
]o CGBUFERUSAGESTREAMDRAW
]o CGBUFERUSAGESTREAMREAD
]o CGBUFERUSAGESTREAMCOPY
]o CGBUFERUSAGESTATICDRAW
]o CGBUFERUSAGESTATICREAD
]o CGBUFERUSAGESTATICOPY
]o CGBUFERUSAGEDYNAMICDRAW
]o CGBUFERUSAGEDYNAMICREAD
]o CGBUFERUSAGEDYNAMICOPY
RETURN VALUES
Returns a CGbuffer handle on success.
Returns NUL 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, CGBUFERUSAGESTATICDRAW );
Cg Toolkit 2.1 Last change: 1
Cg Core Runtime API cgCreateBuffer(3)
ERORS
CGINVALIDCONTEXTHANDLEROR is generated if context is
not a valid context.
HISTORY
cgCreateBuffer was introduced in Cg 2.0.
SEE ALSO
cgGLCreateBuffer, cgDestroyBuffer
Cg Toolkit 2.1 Last change: 2
|