C3DMesh::LockIndexBuffer

Top  Previous  Next

Syntax:

 

LockIndexBuffer(), pointer

 

Purpose:

Locks the index buffer for direct reading/writing.

 

Parameters:

None.

 

Returned value(s):

A pointer to the index buffer.

 

Application:

POINTER pIB
pIB = *<C3DMesh>pRet.LockIndexBuffer()
#<WORD>pIB[0] = 3
#<WORD>pIB[1] = 4
#<WORD>pIB[2] = 2
*<C3DMesh>pRet.UnlockIndexBuffer()

 

Class Hierarchy

C3DObject

-------C3DMesh

 

Additional Info:

The pointer returned points to an array of WORD.  Use the GetIndexCount method to get the count of words in the array.  The pointer will be NULL if the mesh hasn't been allocated yet by loading from a file or creating with the CreateMesh or CreateMeshEx methods.

 

When working with index buffers, you are allowed to make multiple lock calls. However, you must ensure that the number of lock calls match the number of unlock calls.

 

Be sure the buffer is unlocked before trying to render the mesh.

 

See Also:

UnlockIndexBuffer