Crazy Eddie's GUI System  0.8.7
RendererModules/Direct3D10/TextureTarget.h
1 /***********************************************************************
2  created: Sat Mar 7 2009
3  author: Paul D Turner (parts based on code by Rajko Stojadinovic)
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIDirect3D10TextureTarget_h_
28 #define _CEGUIDirect3D10TextureTarget_h_
29 
30 #include "CEGUI/RendererModules/Direct3D10/RenderTarget.h"
31 #include "../../TextureTarget.h"
32 
33 #if defined(_MSC_VER)
34 # pragma warning(push)
35 # pragma warning(disable : 4250)
36 # pragma warning(disable : 4251)
37 #endif
38 
39 // d3d forward refs
40 struct ID3D10Texture2D;
41 struct ID3D10RenderTargetView;
42 struct ID3D10DepthStencilView;
43 
44 // Start of CEGUI namespace section
45 namespace CEGUI
46 {
47 class Direct3D10Texture;
48 
50 class D3D10_GUIRENDERER_API Direct3D10TextureTarget : public Direct3D10RenderTarget<TextureTarget>
51 {
52 public:
54  virtual ~Direct3D10TextureTarget();
55 
56  // overrides from Direct3D10RenderTarget
57  void activate();
58  void deactivate();
59  // implementation of RenderTarget interface
60  bool isImageryCache() const;
61  // implementation of TextureTarget interface
62  void clear();
63  Texture& getTexture() const;
64  void declareRenderSize(const Sizef& sz);
65  bool isRenderingInverted() const;
66 
67 protected:
69  static const float DEFAULT_SIZE;
71  static uint s_textureNumber;
73  static String generateTextureName();
74 
76  void initialiseRenderTexture();
78  void cleanupRenderTexture();
80  void resizeRenderTexture();
82  void enableRenderTexture();
84  void disableRenderTexture();
85 
87  ID3D10Texture2D* d_texture;
89  ID3D10RenderTargetView* d_renderTargetView;
93  ID3D10RenderTargetView* d_previousRenderTargetView;
95  ID3D10DepthStencilView* d_previousDepthStencilView;
96 };
97 
98 } // End of CEGUI namespace section
99 
100 #if defined(_MSC_VER)
101 # pragma warning(pop)
102 #endif
103 
104 #endif // end of guard _CEGUIDirect3D10TextureTarget_h_
Implementation of an ntermediate RenderTarget for the Direct3D 10 API.
Definition: RendererModules/Direct3D10/RenderTarget.h:52
Direct3D10Texture * d_CEGUITexture
we use this to wrap d_texture so it can be used by the core CEGUI lib.
Definition: RendererModules/Direct3D10/TextureTarget.h:91
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
ID3D10RenderTargetView * d_previousRenderTargetView
render target view that was bound before this target was activated
Definition: RendererModules/Direct3D10/TextureTarget.h:93
Direct3D10TextureTarget - allows rendering to Direct3D 10 textures.
Definition: RendererModules/Direct3D10/TextureTarget.h:50
Texture implementation for the Direct3D10Renderer.
Definition: RendererModules/Direct3D10/Texture.h:49
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:52
ID3D10DepthStencilView * d_previousDepthStencilView
depth stencil view that was bound before this target was activated
Definition: RendererModules/Direct3D10/TextureTarget.h:95
static const float DEFAULT_SIZE
default size of created texture objects
Definition: RendererModules/Direct3D10/TextureTarget.h:69
ID3D10Texture2D * d_texture
Direct3D10 texture that's rendered to.
Definition: RendererModules/Direct3D10/TextureTarget.h:87
Renderer implementation using Direct3D 10.
Definition: RendererModules/Direct3D10/Renderer.h:68
ID3D10RenderTargetView * d_renderTargetView
render target view for d_texture
Definition: RendererModules/Direct3D10/TextureTarget.h:89
static uint s_textureNumber
static data used for creating texture names
Definition: RendererModules/Direct3D10/TextureTarget.h:71
String class used within the GUI system.
Definition: String.h:62