Crazy Eddies GUI System  0.7.2
CEGUIDirect3D11TextureTarget.h
1 /***********************************************************************
2  filename: CEGUIDirect3D11TextureTarget.h
3  created: Wed May 5 2010
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2010 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 _CEGUIDirect3D11TextureTarget_h_
28 #define _CEGUIDirect3D11TextureTarget_h_
29 
30 #include "CEGUIDirect3D11RenderTarget.h"
31 #include "../../CEGUITextureTarget.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 ID3D11Texture2D;
41 struct ID3D11RenderTargetView;
42 struct ID3D11DepthStencilView;
43 
44 // Start of CEGUI namespace section
45 namespace CEGUI
46 {
47 class Direct3D11Texture;
48 
50 class D3D11_GUIRENDERER_API Direct3D11TextureTarget : public Direct3D11RenderTarget,
51  public TextureTarget
52 {
53 public:
55  virtual ~Direct3D11TextureTarget();
56 
57  // overrides from Direct3D10RenderTarget
58  void activate();
59  void deactivate();
60  // implementation of RenderTarget interface
61  bool isImageryCache() const;
62  // implementation of TextureTarget interface
63  void clear();
64  Texture& getTexture() const;
65  void declareRenderSize(const Size& sz);
66  bool isRenderingInverted() const;
67 
68 protected:
70  static const float DEFAULT_SIZE;
71 
73  void initialiseRenderTexture();
75  void cleanupRenderTexture();
77  void resizeRenderTexture();
79  void enableRenderTexture();
81  void disableRenderTexture();
82 
84  ID3D11Texture2D* d_texture;
86  ID3D11RenderTargetView* d_renderTargetView;
90  ID3D11RenderTargetView* d_previousRenderTargetView;
92  ID3D11DepthStencilView* d_previousDepthStencilView;
93 };
94 
95 } // End of CEGUI namespace section
96 
97 #if defined(_MSC_VER)
98 # pragma warning(pop)
99 #endif
100 
101 #endif // end of guard _CEGUIDirect3D11TextureTarget_h_