DigitalSpaces::DIOGREHardwareBuffer Struct Reference
[Ogre]

#include <OGREInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Public Member Functions

void * Lock (unsigned long offset, unsigned long length, OGRELockOptions options)
 Lock the buffer for (potentially) reading / writing.
void * Lock (OGRELockOptions options)
 Lock the entire buffer for (potentially) reading / writing.
void Unlock (void)
 Releases the lock on this buffer.
void ReadData (unsigned long offset, unsigned long length, void *pDest)
 Reads data from the buffer and places it in the memory pointed to by pDest.
void WriteData (unsigned long offset, unsigned long length, const void *pSource)
 Writes data to the buffer from an area of system memory; note that you must ensure that your buffer is big enough.
void WriteData (unsigned long offset, unsigned long length, const void *pSource, bool discardWholeBuffer)
void CopyData (DIOGREHardwareBuffer *srcBuffer, unsigned long srcOffset, unsigned long dstOffset, unsigned long length)
 Copy data from another buffer into this one.
void CopyData (DIOGREHardwareBuffer *srcBuffer, unsigned long srcOffset, unsigned long dstOffset, unsigned long length, bool discardWholeBuffer)
unsigned long GetSizeInBytes (void)
 Updates the real buffer from the shadow buffer, if required.
OGREHardwareBufferUsage GetUsage (void)
 Returns the Usage flags with which this buffer was created.
bool IsSystemMemory (void)
 Returns whether this buffer is held in system memory.
bool HasShadowBuffer (void)
 Returns whether this buffer has a system memory shadow for quicker reading.
bool IsLocked (void)
 Returns whether or not this buffer is currently locked.
void SuppressHardwareUpdate (bool suppress)
 Pass true to suppress hardware upload of shadow buffer changes.

Member Function Documentation

void* DigitalSpaces::DIOGREHardwareBuffer::Lock ( unsigned long  offset,
unsigned long  length,
OGRELockOptions  options 
)

Lock the buffer for (potentially) reading / writing.

Parameters:
offset The byte offset from the start of the buffer to lock
length The size of the area to lock, in bytes
options Locking options
Returns:
Pointer to the locked memory

void* DigitalSpaces::DIOGREHardwareBuffer::Lock ( OGRELockOptions  options  ) 

Lock the entire buffer for (potentially) reading / writing.

Parameters:
options Locking options
Returns:
Pointer to the locked memory

void DigitalSpaces::DIOGREHardwareBuffer::Unlock ( void   ) 

Releases the lock on this buffer.

Remarks:
Locking and unlocking a buffer can, in some rare circumstances such as switching video modes whilst the buffer is locked, corrupt the contents of a buffer. This is pretty rare, but if it occurs, this method will throw an exception, meaning you must re-upload the data.
Note that using the 'read' and 'write' forms of updating the buffer does not suffer from this problem, so if you want to be 100% sure your data will not be lost, use the 'read' and 'write' forms instead.

void DigitalSpaces::DIOGREHardwareBuffer::ReadData ( unsigned long  offset,
unsigned long  length,
void *  pDest 
)

Reads data from the buffer and places it in the memory pointed to by pDest.

Parameters:
offset The byte offset from the start of the buffer to read
length The size of the area to read, in bytes
pDest The area of memory in which to place the data, must be large enough to accommodate the data!

void DigitalSpaces::DIOGREHardwareBuffer::WriteData ( unsigned long  offset,
unsigned long  length,
const void *  pSource 
)

Writes data to the buffer from an area of system memory; note that you must ensure that your buffer is big enough.

Parameters:
offset The byte offset from the start of the buffer to start writing
length The size of the data to write to, in bytes
pSource The source of the data to be written
discardWholeBuffer If true, this allows the driver to discard the entire buffer when writing, such that DMA stalls can be avoided; use if you can.

void DigitalSpaces::DIOGREHardwareBuffer::WriteData ( unsigned long  offset,
unsigned long  length,
const void *  pSource,
bool  discardWholeBuffer 
)

void DigitalSpaces::DIOGREHardwareBuffer::CopyData ( DIOGREHardwareBuffer srcBuffer,
unsigned long  srcOffset,
unsigned long  dstOffset,
unsigned long  length 
)

Copy data from another buffer into this one.

Remarks:
Note that the source buffer must not be created with the usage HBU_WRITE_ONLY otherwise this will fail.
Parameters:
srcBuffer The buffer from which to read the copied data
srcOffset Offset in the source buffer at which to start reading
dstOffset Offset in the destination buffer to start writing
length Length of the data to copy, in bytes.
discardWholeBuffer If true, will discard the entire contents of this buffer before copying

void DigitalSpaces::DIOGREHardwareBuffer::CopyData ( DIOGREHardwareBuffer srcBuffer,
unsigned long  srcOffset,
unsigned long  dstOffset,
unsigned long  length,
bool  discardWholeBuffer 
)

unsigned long DigitalSpaces::DIOGREHardwareBuffer::GetSizeInBytes ( void   ) 

Updates the real buffer from the shadow buffer, if required.

Returns the size of this buffer in bytes

OGREHardwareBufferUsage DigitalSpaces::DIOGREHardwareBuffer::GetUsage ( void   ) 

Returns the Usage flags with which this buffer was created.

bool DigitalSpaces::DIOGREHardwareBuffer::IsSystemMemory ( void   ) 

Returns whether this buffer is held in system memory.

bool DigitalSpaces::DIOGREHardwareBuffer::HasShadowBuffer ( void   ) 

Returns whether this buffer has a system memory shadow for quicker reading.

bool DigitalSpaces::DIOGREHardwareBuffer::IsLocked ( void   ) 

Returns whether or not this buffer is currently locked.

void DigitalSpaces::DIOGREHardwareBuffer::SuppressHardwareUpdate ( bool  suppress  ) 

Pass true to suppress hardware upload of shadow buffer changes.


The documentation for this struct was generated from the following file:

Generated on Sun Aug 31 17:46:32 2008 for Digital Spaces by  doxygen 1.5.6