Cg Toolkit Cg 3.1 Toolkit Documentation
Cg / Runtime / CgD3D10 / cgD3D10CreateBufferFromObject

Name

cgD3D10CreateBufferFromObject - create a Cg buffer from a D3D10 buffer object

Synopsis

#include <Cg/cgD3D10.h>

CGbuffer cgD3D10CreateBufferFromObject( CGcontext context,
                                        ID3D10Buffer * obj,
                                        CGbool manageObject );

Parameters

context
The context to which the new buffer will be added.
obj
A D3D10 buffer object created by the application.
manageObject
A boolean switch which controls whether obj will be deleted by the runtime when the CGbuffer object returned by cgD3D10CreateBufferFromObject is destroyed.

Return Values

Returns a CGbuffer handle on success.

Returns NULL if any error occurs.

Description

cgD3D10CreateBufferFromObject creates a Cg buffer from a preexisting D3D10 buffer object. This D3D10 object will be deleted by the runtime when the Cg buffer is destroyed if manageObject is CG_TRUE. Otherwise the application is responsibile for deleting the D3D10 object obj.

Examples

  CGbuffer myBuffer = cgD3D10CreateBufferFromObject( myCgContext, d3d10BufferObj, CG_TRUE );

Errors

CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.

History

cgD3D10CreateBufferFromObject was introduced in Cg 3.1.

See Also

cgCreateBuffer, cgDestroyBuffer, cgD3D10GetBufferByIndex


Cg Toolkit | Cg Toolkit | Download | Release Archive | Profiles | Reference | Books | Discussions |


Cg Runtime CgD3D10

cgD3D10BindProgram
cgD3D10CreateBufferFromObject
cgD3D10CreateBuffer
cgD3D10GetBufferByIndex
cgD3D10GetBufferObject
cgD3D10GetCompiledProgram
cgD3D10GetDevice
cgD3D10GetIASignatureByPass
cgD3D10GetLastError
cgD3D10GetLatestGeometryProfile
cgD3D10GetLatestPixelProfile
cgD3D10GetLatestVertexProfile
cgD3D10GetManageTextureParameters
cgD3D10GetOptimalOptions
cgD3D10GetProgramErrors
cgD3D10IsProfileSupported
cgD3D10IsProgramLoaded
cgD3D10LoadProgram
cgD3D10RegisterStates
cgD3D10SetDevice
cgD3D10SetManageTextureParameters
cgD3D10SetSamplerStateParameter
cgD3D10SetTextureParameter
cgD3D10SetTextureSamplerStateParameter
cgD3D10TranslateCGerror
cgD3D10TranslateHRESULT
cgD3D10TypeToSize
cgD3D10UnbindProgram
cgD3D10UnloadProgram