#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) | ||||||||
Convience 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) | ||||||||
Convience 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. | |||||||||
virtual void * | lock (size_t offset, size_t length, LockOptions options) | ||||||||
make every lock method from HardwareBuffer available. | |||||||||
void * | lock (LockOptions options) | ||||||||
make every lock method from HardwareBuffer available. | |||||||||
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. | |||||||||
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 43 of file OgreHardwarePixelBuffer.h.
|
Locking options.
Definition at line 111 of file OgreHardwareBuffer.h. |
|
Enums describing buffer usage; not mutually exclusive.
Definition at line 69 of file OgreHardwareBuffer.h. |
|
Should be called by HardwareBufferManager.
|
|
|
|
Notify TextureBuffer of destruction of render target. Called by RenderTexture when destroyed. Reimplemented in Ogre::D3D9HardwarePixelBuffer, and Ogre::GLTextureBuffer. |
|
Updates the real buffer from the shadow buffer, if required.
Definition at line 275 of file OgreHardwareBuffer.h. |
|
Convience 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.
Reimplemented in Ogre::D3D9HardwarePixelBuffer, and Ogre::GLTextureBuffer. |
|
Convience function that blits a pixelbox from memory to the entire buffer. The source image is scaled as needed.
Definition at line 139 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.
Implemented in Ogre::D3D9HardwarePixelBuffer, Ogre::GLHardwarePixelBuffer, and Ogre::GLTextureBuffer. |
|
Convience function that blits this entire buffer to a pixelbox. The image is scaled as needed.
Definition at line 158 of file OgreHardwarePixelBuffer.h. |
|
Copies a region of this pixelbuffer to normal memory.
Implemented in Ogre::D3D9HardwarePixelBuffer, and Ogre::GLHardwarePixelBuffer. |
|
Copy data from another buffer into this one.
Definition at line 265 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 177 of file OgreHardwarePixelBuffer.h. |
|
Gets the native pixel format of this buffer.
Definition at line 179 of file OgreHardwarePixelBuffer.h. References Ogre::PixelFormat. Referenced by Ogre::D3D9RenderTexture::rebind(). |
|
Gets the height of this buffer.
Definition at line 175 of file OgreHardwarePixelBuffer.h. Referenced by Ogre::D3D9RenderTexture::rebind(). |
|
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.
Reimplemented in Ogre::D3D9HardwarePixelBuffer, and Ogre::GLTextureBuffer. |
|
Returns the size of this buffer in bytes.
Definition at line 300 of file OgreHardwareBuffer.h. |
|
Returns the Usage flags with which this buffer was created.
Definition at line 302 of file OgreHardwareBuffer.h. |
|
Gets the width of this buffer.
Definition at line 173 of file OgreHardwarePixelBuffer.h. Referenced by Ogre::D3D9RenderTexture::rebind(). |
|
Returns whether this buffer has a system memory shadow for quicker reading.
Definition at line 306 of file OgreHardwareBuffer.h. |
|
Returns whether or not this buffer is currently locked.
Definition at line 308 of file OgreHardwareBuffer.h. |
|
Returns whether this buffer is held in system memory.
Definition at line 304 of file OgreHardwareBuffer.h. |
|
make every lock method from HardwareBuffer available. See http://www.research.att.com/~bs/bs_faq2.html#overloadderived Definition at line 201 of file OgreHardwareBuffer.h. |
|
make every lock method from HardwareBuffer available. See http://www.research.att.com/~bs/bs_faq2.html#overloadderived Definition at line 171 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.
Implemented in Ogre::D3D9HardwarePixelBuffer, and Ogre::GLHardwarePixelBuffer. |
|
Implements Ogre::HardwareBuffer. |
|
Pass true to suppress hardware upload of shadow buffer changes.
Definition at line 312 of file OgreHardwareBuffer.h. |
|
Releases the lock on this buffer.
Reimplemented in Ogre::DefaultHardwareVertexBuffer, Ogre::DefaultHardwareIndexBuffer, Ogre::GLDefaultHardwareVertexBuffer, and Ogre::GLDefaultHardwareIndexBuffer. Definition at line 217 of file OgreHardwareBuffer.h. Referenced by Ogre::HardwareBuffer::copyData(). |
|
|
Implements Ogre::HardwareBuffer. |
|
Definition at line 69 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 53 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 47 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 51 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 47 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 133 of file OgreHardwareBuffer.h. |
|
Definition at line 135 of file OgreHardwareBuffer.h. |
|
Definition at line 134 of file OgreHardwareBuffer.h. |
|
Definition at line 138 of file OgreHardwareBuffer.h. |
|
Definition at line 49 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 139 of file OgreHardwareBuffer.h. |
|
Definition at line 131 of file OgreHardwareBuffer.h. |
|
Definition at line 49 of file OgreHardwarePixelBuffer.h. |
|
Definition at line 140 of file OgreHardwareBuffer.h. |
|
Definition at line 136 of file OgreHardwareBuffer.h. |
|
Definition at line 132 of file OgreHardwareBuffer.h. |
|
Definition at line 137 of file OgreHardwareBuffer.h. |
|
Definition at line 47 of file OgreHardwarePixelBuffer.h. |
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:39:14 2006