#include <OgreHardwarePixelBuffer.h>
Inheritance diagram for Ogre::HardwarePixelBuffer:
Public Types | |||||||||||||
enum | Usage { HBU_STATIC = 1, HBU_DYNAMIC = 2, HBU_WRITE_ONLY = 4, HBU_DISCARDABLE = 8, HBU_STATIC_WRITE_ONLY = 5, HBU_DYNAMIC_WRITE_ONLY = 6, HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE = 14 } | ||||||||||||
Enums describing buffer usage; not mutually exclusive. More... | |||||||||||||
enum | LockOptions { HBL_NORMAL, HBL_DISCARD, HBL_READ_ONLY, HBL_NO_OVERWRITE } | ||||||||||||
Locking options. More... | |||||||||||||
Public Member Functions | |||||||||||||
HardwarePixelBuffer (size_t mWidth, size_t mHeight, size_t mDepth, PixelFormat mFormat, HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer) | |||||||||||||
Should be called by HardwareBufferManager. | |||||||||||||
~HardwarePixelBuffer () | |||||||||||||
virtual const PixelBox & | lock (const Image::Box &lockBox, LockOptions options) | ||||||||||||
Lock the buffer for (potentially) reading / writing. | |||||||||||||
virtual void * | lock (size_t offset, size_t length, LockOptions options) | ||||||||||||
| |||||||||||||
const PixelBox & | getCurrentLock () | ||||||||||||
Get the current locked region. | |||||||||||||
virtual void | readData (size_t offset, size_t length, void *pDest) | ||||||||||||
| |||||||||||||
virtual void | writeData (size_t offset, size_t length, const void *pSource, bool discardWholeBuffer=false) | ||||||||||||
| |||||||||||||
virtual void | blit (const HardwarePixelBufferSharedPtr &src, const Image::Box &srcBox, const Image::Box &dstBox) | ||||||||||||
Copies a box from another PixelBuffer to a region of the this PixelBuffer. | |||||||||||||
void | blit (const HardwarePixelBufferSharedPtr &src) | ||||||||||||
Convenience function that blits the entire source pixel buffer to this buffer. | |||||||||||||
virtual void | blitFromMemory (const PixelBox &src, const Image::Box &dstBox)=0 | ||||||||||||
Copies a region from normal memory to a region of this pixelbuffer. | |||||||||||||
void | blitFromMemory (const PixelBox &src) | ||||||||||||
Convenience function that blits a pixelbox from memory to the entire buffer. | |||||||||||||
virtual void | blitToMemory (const Image::Box &srcBox, const PixelBox &dst)=0 | ||||||||||||
Copies a region of this pixelbuffer to normal memory. | |||||||||||||
void | blitToMemory (const PixelBox &dst) | ||||||||||||
Convience function that blits this entire buffer to a pixelbox. | |||||||||||||
virtual RenderTexture * | getRenderTarget (size_t slice=0) | ||||||||||||
Get a render target for this PixelBuffer, or a slice of it. | |||||||||||||
size_t | getWidth () const | ||||||||||||
Gets the width of this buffer. | |||||||||||||
size_t | getHeight () const | ||||||||||||
Gets the height of this buffer. | |||||||||||||
size_t | getDepth () const | ||||||||||||
Gets the depth of this buffer. | |||||||||||||
PixelFormat | getFormat () const | ||||||||||||
Gets the native pixel format of this buffer. | |||||||||||||
void * | lock (LockOptions options) | ||||||||||||
Lock the entire buffer for (potentially) reading / writing. | |||||||||||||
virtual void | unlock (void) | ||||||||||||
Releases the lock on this buffer. | |||||||||||||
virtual void | copyData (HardwareBuffer &srcBuffer, size_t srcOffset, size_t dstOffset, size_t length, bool discardWholeBuffer=false) | ||||||||||||
Copy data from another buffer into this one. | |||||||||||||
virtual void | _updateFromShadow (void) | ||||||||||||
Updates the real buffer from the shadow buffer, if required. | |||||||||||||
size_t | getSizeInBytes (void) const | ||||||||||||
Returns the size of this buffer in bytes. | |||||||||||||
Usage | getUsage (void) const | ||||||||||||
Returns the Usage flags with which this buffer was created. | |||||||||||||
bool | isSystemMemory (void) const | ||||||||||||
Returns whether this buffer is held in system memory. | |||||||||||||
bool | hasShadowBuffer (void) const | ||||||||||||
Returns whether this buffer has a system memory shadow for quicker reading. | |||||||||||||
bool | isLocked (void) const | ||||||||||||
Returns whether or not this buffer is currently locked. | |||||||||||||
void | suppressHardwareUpdate (bool suppress) | ||||||||||||
Pass true to suppress hardware upload of shadow buffer changes. | |||||||||||||
void * | operator new (size_t sz, const char *file, int line, const char *func) | ||||||||||||
operator new, with debug line info | |||||||||||||
void * | operator new (size_t sz) | ||||||||||||
void * | operator new (size_t sz, void *ptr) | ||||||||||||
placement operator new | |||||||||||||
void * | operator new[] (size_t sz, const char *file, int line, const char *func) | ||||||||||||
array operator new, with debug line info | |||||||||||||
void * | operator new[] (size_t sz) | ||||||||||||
void | operator delete (void *ptr) | ||||||||||||
void | operator delete (void *ptr, void *) | ||||||||||||
void | operator delete (void *ptr, const char *, int, const char *) | ||||||||||||
void | operator delete[] (void *ptr) | ||||||||||||
void | operator delete[] (void *ptr, const char *, int, const char *) | ||||||||||||
Protected Member Functions | |||||||||||||
virtual PixelBox | lockImpl (const Image::Box lockBox, LockOptions options)=0 | ||||||||||||
Internal implementation of lock(), must be overridden in subclasses. | |||||||||||||
virtual void * | lockImpl (size_t offset, size_t length, LockOptions options) | ||||||||||||
Internal implementation of lock(), do not OVERRIDE or CALL this for HardwarePixelBuffer implementations, but override the previous method. | |||||||||||||
virtual void | _clearSliceRTT (size_t zoffset) | ||||||||||||
Notify TextureBuffer of destruction of render target. | |||||||||||||
virtual void | unlockImpl (void)=0 | ||||||||||||
Internal implementation of unlock(). | |||||||||||||
Protected Attributes | |||||||||||||
size_t | mWidth | ||||||||||||
size_t | mHeight | ||||||||||||
size_t | mDepth | ||||||||||||
size_t | mRowPitch | ||||||||||||
size_t | mSlicePitch | ||||||||||||
PixelFormat | mFormat | ||||||||||||
PixelBox | mCurrentLock | ||||||||||||
size_t | mSizeInBytes | ||||||||||||
Usage | mUsage | ||||||||||||
bool | mIsLocked | ||||||||||||
size_t | mLockStart | ||||||||||||
size_t | mLockSize | ||||||||||||
bool | mSystemMemory | ||||||||||||
bool | mUseShadowBuffer | ||||||||||||
HardwareBuffer * | mpShadowBuffer | ||||||||||||
bool | mShadowUpdated | ||||||||||||
bool | mSuppressHardwareUpdate | ||||||||||||
Friends | |||||||||||||
class | RenderTexture |
The HardwarePixelbuffer abstracts an 1D, 2D or 3D quantity of pixels stored by the rendering API. The buffer can be located on the card or in main memory depending on its usage. One mipmap level of a texture is an example of a HardwarePixelBuffer.
Definition at line 47 of file OgreHardwarePixelBuffer.h.
|
Locking options.
Definition at line 115 of file OgreHardwareBuffer.h. |
|
Enums describing buffer usage; not mutually exclusive.
Definition at line 73 of file OgreHardwareBuffer.h. |
|
Should be called by HardwareBufferManager.
|
|
|
|
Notify TextureBuffer of destruction of render target. Called by RenderTexture when destroyed. |
|
Updates the real buffer from the shadow buffer, if required.
Definition at line 279 of file OgreHardwareBuffer.h. |
|
Convenience function that blits the entire source pixel buffer to this buffer. If source and destination dimensions don't match, scaling is done.
|
|
Copies a box from another PixelBuffer to a region of the this PixelBuffer.
|
|
Convenience function that blits a pixelbox from memory to the entire buffer. The source image is scaled as needed.
Definition at line 143 of file OgreHardwarePixelBuffer.h. |
|
Copies a region from normal memory to a region of this pixelbuffer. The source image can be in any pixel format supported by OGRE, and in any size.
|
|
Convience function that blits this entire buffer to a pixelbox. The image is scaled as needed.
Definition at line 162 of file OgreHardwarePixelBuffer.h. |
|
Copies a region of this pixelbuffer to normal memory.
|
|
Copy data from another buffer into this one.
Definition at line 269 of file OgreHardwareBuffer.h. References Ogre::HardwareBuffer::lock(), and Ogre::HardwareBuffer::unlock(). |
|
Get the current locked region. This is the same value as returned by lock(const Image::Box, LockOptions)
|
|
Gets the depth of this buffer.
Definition at line 181 of file OgreHardwarePixelBuffer.h. |
|
Gets the native pixel format of this buffer.
Definition at line 183 of file OgreHardwarePixelBuffer.h. |
|
Gets the height of this buffer.
Definition at line 179 of file OgreHardwarePixelBuffer.h. |
|
Get a render target for this PixelBuffer, or a slice of it. The texture this was acquired from must have TU_RENDERTARGET set, otherwise it is possible to render to it and this method will throw an ERR_RENDERSYSTEM exception.
|
|
Returns the size of this buffer in bytes.
Definition at line 304 of file OgreHardwareBuffer.h. |
|
Returns the Usage flags with which this buffer was created.
Definition at line 306 of file OgreHardwareBuffer.h. |
|
Gets the width of this buffer.
Definition at line 177 of file OgreHardwarePixelBuffer.h. |
|
Returns whether this buffer has a system memory shadow for quicker reading.
Definition at line 310 of file OgreHardwareBuffer.h. |
|
Returns whether or not this buffer is currently locked.
Definition at line 312 of file OgreHardwareBuffer.h. |
|
Returns whether this buffer is held in system memory.
Definition at line 308 of file OgreHardwareBuffer.h. |
|
Lock the entire buffer for (potentially) reading / writing.
Definition at line 205 of file OgreHardwareBuffer.h. |
|
Reimplemented from Ogre::HardwareBuffer. |
|
Lock the buffer for (potentially) reading / writing.
|
|
Internal implementation of lock(), do not OVERRIDE or CALL this for HardwarePixelBuffer implementations, but override the previous method.
Implements Ogre::HardwareBuffer. |
|
Internal implementation of lock(), must be overridden in subclasses.
|
|
Definition at line 101 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 95 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 89 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 112 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 106 of file OgreMemoryAllocatedObject.h. |
|
placement operator new
Definition at line 73 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 67 of file OgreMemoryAllocatedObject.h. |
|
operator new, with debug line info
Definition at line 62 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 84 of file OgreMemoryAllocatedObject.h. |
|
array operator new, with debug line info
Definition at line 79 of file OgreMemoryAllocatedObject.h. |
|
Implements Ogre::HardwareBuffer. |
|
Pass true to suppress hardware upload of shadow buffer changes.
Definition at line 316 of file OgreHardwareBuffer.h. |
|
Releases the lock on this buffer.
Reimplemented in Ogre::DefaultHardwareVertexBuffer, and Ogre::DefaultHardwareIndexBuffer. Definition at line 221 of file OgreHardwareBuffer.h. Referenced by Ogre::HardwareBuffer::copyData(). |
|
Internal implementation of unlock().
Implemented in Ogre::DefaultHardwareVertexBuffer, and Ogre::DefaultHardwareIndexBuffer. |
|
Implements Ogre::HardwareBuffer. |
|
Definition at line 73 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 57 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 51 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 55 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 51 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 137 of file OgreHardwareBuffer.h. |
|
Definition at line 139 of file OgreHardwareBuffer.h. |
|
Definition at line 138 of file OgreHardwareBuffer.h. |
|
Definition at line 142 of file OgreHardwareBuffer.h. |
|
Definition at line 53 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 143 of file OgreHardwareBuffer.h. |
|
Definition at line 135 of file OgreHardwareBuffer.h. |
|
Definition at line 53 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 144 of file OgreHardwareBuffer.h. |
|
Definition at line 140 of file OgreHardwareBuffer.h. |
|
Definition at line 136 of file OgreHardwareBuffer.h. |
|
Definition at line 141 of file OgreHardwareBuffer.h. |
|
Definition at line 51 of file OgreHardwarePixelBuffer.h. |
Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sat Apr 11 13:48:18 2009