org.ogre4j
Class HardwareBuffer

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

public class HardwareBuffer
extends NativeObject
implements IHardwareBuffer


Nested Class Summary
static class HardwareBuffer.LockOptions
           
static class HardwareBuffer.Usage
           
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  HardwareBuffer(InstancePointer p)
          This constructor is public for internal useage only!
protected HardwareBuffer(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  HardwareBuffer(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 getSizeInBytes()
           
 HardwareBuffer.Usage getUsage()
           
 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)
          Lock the buffer for (potentially) reading / writing.
 void readData(int offset, int length, VoidPointer pDest)
          Reads data from the buffer and places it in the memory pointed to by pDest.
 void suppressHardwareUpdate(boolean suppress)
           
 void unlock()
          Releases the lock on this buffer.
 void writeData(int offset, int length, VoidPointer pSource, boolean discardWholeBuffer)
          Writes data to the buffer from an area of system memory; note that you must ensure that your buffer is big enough.
 
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

HardwareBuffer

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


HardwareBuffer

protected HardwareBuffer(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.


HardwareBuffer

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

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()
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

lock

public VoidPointer lock(int offset,
                        int length,
                        HardwareBuffer.LockOptions options)
Lock the buffer for (potentially) reading / writing.

Specified by:
lock in interface IHardwareBuffer

lock

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

Specified by:
lock in interface IHardwareBuffer

unlock

public void unlock()
Releases the lock on this buffer.

Specified by:
unlock in interface IHardwareBuffer

readData

public void readData(int offset,
                     int length,
                     VoidPointer pDest)
Reads data from the buffer and places it in the memory pointed to by pDest.

Specified by:
readData in interface IHardwareBuffer

writeData

public void writeData(int offset,
                      int length,
                      VoidPointer pSource,
                      boolean discardWholeBuffer)
Writes data to the buffer from an area of system memory; note that you must ensure that your buffer is big enough.

Specified by:
writeData 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.