org.ogre4j
Class DefaultHardwareVertexBuffer

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.DefaultHardwareVertexBuffer
All Implemented Interfaces:
IAllocatedObject<IRenderSysAllocPolicy>, IDefaultHardwareVertexBuffer, IHardwareBuffer, IHardwareVertexBuffer, IRenderSysAllocatedObject, INativeObject

public class DefaultHardwareVertexBuffer
extends NativeObject
implements IDefaultHardwareVertexBuffer


Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  DefaultHardwareVertexBuffer(InstancePointer p)
          This constructor is public for internal useage only!
protected DefaultHardwareVertexBuffer(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  DefaultHardwareVertexBuffer(int vertexSize, int numVertices, HardwareBuffer.Usage usage)
           
  DefaultHardwareVertexBuffer(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void _updateFromShadow()
           
 void copyData(IHardwareBuffer srcBuffer, int srcOffset, int dstOffset, int length, boolean discardWholeBuffer)
          Copy data from another buffer into this one.
 void delete()
          Deletes the corresponding C++ object.
 void finalize()
           
 int getNumVertices()
           
 int getSizeInBytes()
           
 HardwareBuffer.Usage getUsage()
           
 int getVertexSize()
           
 boolean hasShadowBuffer()
           
 boolean isLocked()
           
 boolean isSystemMemory()
           
 VoidPointer lock(HardwareBuffer.LockOptions options)
          Lock the entire buffer for (potentially) reading / writing.
 VoidPointer lock(int offset, int length, HardwareBuffer.LockOptions options)
          Override to turn off all shadowing.
 void readData(int offset, int length, VoidPointer pDest)
          See .
 void suppressHardwareUpdate(boolean suppress)
           
 void unlock()
          Override to turn off all shadowing.
 void writeData(int offset, int length, VoidPointer pSource, boolean discardWholeBuffer)
          See .
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

DefaultHardwareVertexBuffer

public DefaultHardwareVertexBuffer(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


DefaultHardwareVertexBuffer

protected DefaultHardwareVertexBuffer(InstancePointer p,
                                      boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


DefaultHardwareVertexBuffer

public DefaultHardwareVertexBuffer(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

DefaultHardwareVertexBuffer

public DefaultHardwareVertexBuffer(int vertexSize,
                                   int numVertices,
                                   HardwareBuffer.Usage usage)
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

readData

public void readData(int offset,
                     int length,
                     VoidPointer pDest)
See .

Specified by:
readData in interface IHardwareBuffer

writeData

public void writeData(int offset,
                      int length,
                      VoidPointer pSource,
                      boolean discardWholeBuffer)
See .

Specified by:
writeData in interface IHardwareBuffer

lock

public VoidPointer lock(int offset,
                        int length,
                        HardwareBuffer.LockOptions options)
Override to turn off all shadowing.

Specified by:
lock in interface IHardwareBuffer

unlock

public void unlock()
Override to turn off all shadowing.

Specified by:
unlock in interface IHardwareBuffer

getVertexSize

public int getVertexSize()
Specified by:
getVertexSize in interface IHardwareVertexBuffer

getNumVertices

public int getNumVertices()
Specified by:
getNumVertices in interface IHardwareVertexBuffer

lock

public VoidPointer lock(HardwareBuffer.LockOptions options)
Lock the entire buffer for (potentially) reading / writing.

Specified by:
lock in interface IHardwareBuffer

copyData

public void copyData(IHardwareBuffer srcBuffer,
                     int srcOffset,
                     int dstOffset,
                     int length,
                     boolean discardWholeBuffer)
Copy data from another buffer into this one.

Specified by:
copyData in interface IHardwareBuffer

_updateFromShadow

public void _updateFromShadow()
Specified by:
_updateFromShadow in interface IHardwareBuffer

getSizeInBytes

public int getSizeInBytes()
Specified by:
getSizeInBytes in interface IHardwareBuffer

getUsage

public HardwareBuffer.Usage getUsage()
Specified by:
getUsage in interface IHardwareBuffer

isSystemMemory

public boolean isSystemMemory()
Specified by:
isSystemMemory in interface IHardwareBuffer

hasShadowBuffer

public boolean hasShadowBuffer()
Specified by:
hasShadowBuffer in interface IHardwareBuffer

isLocked

public boolean isLocked()
Specified by:
isLocked in interface IHardwareBuffer

suppressHardwareUpdate

public void suppressHardwareUpdate(boolean suppress)
Specified by:
suppressHardwareUpdate in interface IHardwareBuffer


Copyright © 2007 netAllied GmbH. All Rights Reserved.