crystalspace.jbind.impl.video.vbufmgr
Class csVertexBufferManager

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.video.vbufmgr.csVertexBufferManager
All Implemented Interfaces:
iBase, iPointer, iVertexBufferManager

public class csVertexBufferManager
extends csBase
implements iVertexBufferManager

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csVertexBufferManager(iPointer nPointer)
           
 
Method Summary
 void addClient(iVertexBufferManagerClient client)
          A client using the services of the manager can register with it to receive information about the state of the manager.
 void changePriority(iVertexBuffer buf, int new_priority)
          Change the priority of a vertex buffer.
 iVertexBuffer createBuffer(int priority)
          Create an empty vertex buffer.
 iPolygonBuffer createPolygonBuffer()
          Create an empty polygon buffer.
 java.lang.String getName()
          Return the name of the interface
 int getVersion()
          Return the version of the interface
protected  boolean isNativePointerValidSafe(long pointer)
           
 boolean lockBuffer(iVertexBuffer buf, csVector3[] verts, csVector2[] texels, csColor[] colors, int buf_number, csBox3 bbox)
          Lock this vertex buffer for use.
 void unlockBuffer(iVertexBuffer buf)
          Unlock a vertex buffer.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csVertexBufferManager

public csVertexBufferManager(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase
See Also:
iBase.getVersion()

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase
See Also:
iBase.getName()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long pointer)
Specified by:
isNativePointerValidSafe in class csNativeObject
See Also:
csNativeObject.isNativePointerValidSafe(long)

addClient

public void addClient(iVertexBufferManagerClient client)
Description copied from interface: iVertexBufferManager
A client using the services of the manager can register with it to receive information about the state of the manager.

Specified by:
addClient in interface iVertexBufferManager
Parameters:
client -
See Also:
iVertexBufferManager.addClient(crystalspace.jbind.interfaces.ivideo.vbufmgr.iVertexBufferManagerClient)

changePriority

public void changePriority(iVertexBuffer buf,
                           int new_priority)
Description copied from interface: iVertexBufferManager
Change the priority of a vertex buffer. This can be used when some low-priority object becomes more important for example.

Specified by:
changePriority in interface iVertexBufferManager
Parameters:
buf -
new_priority -
See Also:
iVertexBufferManager.changePriority(crystalspace.jbind.interfaces.ivideo.vbufmgr.iVertexBuffer, int)

createBuffer

public iVertexBuffer createBuffer(int priority)
Description copied from interface: iVertexBufferManager
Create an empty vertex buffer. The ref count of this vertex buffer will be one. To remove it use DecRef();. The priority number can be anything. Higher numbers mean the vertex buffer is more important. A high priority vertex buffer should be used for objects that are visible often. Low priority vertex buffers should be used for objects that are rarely visible.

Specified by:
createBuffer in interface iVertexBufferManager
Parameters:
priority -
Returns:
See Also:
iVertexBufferManager.createBuffer(int)

createPolygonBuffer

public iPolygonBuffer createPolygonBuffer()
Description copied from interface: iVertexBufferManager
Create an empty polygon buffer. The ref count of this polygon buffer will be one. To remove it use DecRef();.

Specified by:
createPolygonBuffer in interface iVertexBufferManager
Returns:
See Also:
iVertexBufferManager.createPolygonBuffer()

lockBuffer

public boolean lockBuffer(iVertexBuffer buf,
                          csVector3[] verts,
                          csVector2[] texels,
                          csColor[] colors,
                          int buf_number,
                          csBox3 bbox)
Description copied from interface: iVertexBufferManager
Lock this vertex buffer for use. Only when the vertex buffer is locked are you allowed to make calls to iGraphics3D functions that actually use the vertex buffer. While the buffer is locked the arrays that are given here may not be modified or altered in any way! The buf_number indicates if the buffer has modified or not. You MUST call UnlockBuffer(); when you are ready with the buffer. Deleting a vertex buffer with DecRef(); automatically implies an UnlockBuffer();. This function will return false if the buffer could not be locked for some reason. This may happen if too many buffers are locked at the same time or if memory is low.

Specified by:
lockBuffer in interface iVertexBufferManager
Parameters:
buf -
verts -
texels -
colors -
buf_number -
bbox -
Returns:
See Also:
iVertexBufferManager.lockBuffer(crystalspace.jbind.interfaces.ivideo.vbufmgr.iVertexBuffer, crystalspace.jbind.impl.csgeom.vector3.csVector3[], crystalspace.jbind.impl.csgeom.vector2.csVector2[], crystalspace.jbind.impl.csutil.cscolor.csColor[], int, crystalspace.jbind.impl.csgeom.box.csBox3)

unlockBuffer

public void unlockBuffer(iVertexBuffer buf)
Description copied from interface: iVertexBufferManager
Unlock a vertex buffer.

Specified by:
unlockBuffer in interface iVertexBufferManager
Parameters:
buf -
See Also:
iVertexBufferManager.unlockBuffer(crystalspace.jbind.interfaces.ivideo.vbufmgr.iVertexBuffer)