OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OgreD3D10HardwarePixelBuffer.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2011 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __D3D10PIXELBUFFER_H__
29 #define __D3D10PIXELBUFFER_H__
30 
31 #include "OgreD3D10Prerequisites.h"
33 #include "OgreD3D10Driver.h"
34 
35 namespace Ogre {
36 
38  {
39  protected:
41  PixelBox lockImpl(const Image::Box lockBox, LockOptions options);
42 
44  void unlockImpl(void);
45 
48 
51 
52  size_t mFace;
53 
54  D3D10_BOX OgreImageBoxToDx10Box(const Image::Box &inBox) const;
55 
57  void fromD3DLock(PixelBox &rval, const DXGI_MAPPED_RECT &lrect);
58 
62  public:
63  D3D10HardwarePixelBuffer(D3D10Texture * parentTexture, D3D10Device & device, size_t subresourceIndex,
64  size_t width, size_t height, size_t depth, size_t face, PixelFormat format, HardwareBuffer::Usage usage);
65 
67  void blit(const HardwarePixelBufferSharedPtr &src, const Image::Box &srcBox, const Image::Box &dstBox);
68 
70  void blitFromMemory(const PixelBox &src, const Image::Box &dstBox);
71 
73  void blitToMemory(const Image::Box &srcBox, const PixelBox &dst);
74 
76  void _genMipmaps();
77 
78 
80 
82  RenderTexture *getRenderTarget(size_t zoffset);
83 
85  virtual void _clearSliceRTT(size_t zoffset)
86  {
87  mSliceTRT[zoffset] = 0;
88  }
89 
91  size_t getSubresourceIndex() const;
92  };
93 };
94 #endif
D3D10Device & mDevice
D3DDevice pointer.
This class represents a RenderTarget that renders to a Texture.
void blitFromMemory(const PixelBox &src, const Image::Box &dstBox)
Copies a region from normal memory to a region of this pixelbuffer.
void fromD3DLock(PixelBox &rval, const DXGI_MAPPED_RECT &lrect)
Util functions to convert a D3D locked box to a pixel box.
LockOptions
Locking options.
Structure used to define a box in a 3-D integer space.
Definition: OgreCommon.h:633
void unlockImpl(void)
Unlock a box.
PixelFormat
The pixel format used for images, textures, and render surfaces.
Usage
Enums describing buffer usage; not mutually exclusive.
D3D10_BOX OgreImageBoxToDx10Box(const Image::Box &inBox) const
size_t getSubresourceIndex() const
Shared pointer implementation used to share pixel buffers.
Specialisation of HardwareBuffer for a pixel buffer.
void blitToMemory(const Image::Box &srcBox, const PixelBox &dst)
Copies a region of this pixelbuffer to normal memory.
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.
vector< RenderTexture * >::type SliceTRT
Render targets.
void _genMipmaps()
Internal function to update mipmaps on update of level 0.
RenderTexture * getRenderTarget(size_t zoffset)
Get rendertarget for z slice.
virtual void _clearSliceRTT(size_t zoffset)
Notify TextureBuffer of destruction of render target.
D3D10HardwarePixelBuffer(D3D10Texture *parentTexture, D3D10Device &device, size_t subresourceIndex, size_t width, size_t height, size_t depth, size_t face, PixelFormat format, HardwareBuffer::Usage usage)
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
D3D10Texture * getParentTexture() const
PixelBox lockImpl(const Image::Box lockBox, LockOptions options)
Lock a box.