Crazy Eddie's GUI System  0.8.7
RendererModules/Direct3D11/TextureTarget.h
1 /***********************************************************************
2  created: Wed May 5 2010
3 *************************************************************************/
4 /***************************************************************************
5  * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining
8  * a copy of this software and associated documentation files (the
9  * "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject to
13  * the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24  * OTHER DEALINGS IN THE SOFTWARE.
25  ***************************************************************************/
26 #ifndef _CEGUIDirect3D11TextureTarget_h_
27 #define _CEGUIDirect3D11TextureTarget_h_
28 
29 #include "CEGUI/RendererModules/Direct3D11/RenderTarget.h"
30 #include "../../TextureTarget.h"
31 
32 #if defined(_MSC_VER)
33 # pragma warning(push)
34 # pragma warning(disable : 4250)
35 # pragma warning(disable : 4251)
36 #endif
37 
38 // d3d forward refs
39 struct ID3D11Texture2D;
40 struct ID3D11RenderTargetView;
41 struct ID3D11DepthStencilView;
42 
43 // Start of CEGUI namespace section
44 namespace CEGUI
45 {
46 class Direct3D11Texture;
47 
49 class D3D11_GUIRENDERER_API Direct3D11TextureTarget : public Direct3D11RenderTarget<TextureTarget>
50 {
51 public:
53  virtual ~Direct3D11TextureTarget();
54 
55  // overrides from Direct3D10RenderTarget
56  void activate();
57  void deactivate();
58  // implementation of RenderTarget interface
59  bool isImageryCache() const;
60  // implementation of TextureTarget interface
61  void clear();
62  Texture& getTexture() const;
63  void declareRenderSize(const Sizef& sz);
64  bool isRenderingInverted() const;
65 
66 protected:
68  static const float DEFAULT_SIZE;
70  static uint s_textureNumber;
73 
84 
86  ID3D11Texture2D* d_texture;
88  ID3D11RenderTargetView* d_renderTargetView;
92  ID3D11RenderTargetView* d_previousRenderTargetView;
94  ID3D11DepthStencilView* d_previousDepthStencilView;
95 };
96 
97 } // End of CEGUI namespace section
98 
99 #if defined(_MSC_VER)
100 # pragma warning(pop)
101 #endif
102 
103 #endif // end of guard _CEGUIDirect3D11TextureTarget_h_
CEGUI::Direct3D11TextureTarget::d_CEGUITexture
Direct3D11Texture * d_CEGUITexture
we use this to wrap d_texture so it can be used by the core CEGUI lib.
Definition: RendererModules/Direct3D11/TextureTarget.h:90
CEGUI::Direct3D11TextureTarget::d_texture
ID3D11Texture2D * d_texture
Direct3D10 texture that's rendered to.
Definition: RendererModules/Direct3D11/TextureTarget.h:86
CEGUI::Direct3D11TextureTarget::declareRenderSize
void declareRenderSize(const Sizef &sz)
Used to declare to the TextureTarget the largest size, in pixels, of the next set of incoming renderi...
CEGUI::Direct3D11TextureTarget::d_previousDepthStencilView
ID3D11DepthStencilView * d_previousDepthStencilView
depth stencil view that was bound before this target was activated
Definition: RendererModules/Direct3D11/TextureTarget.h:94
CEGUI::Direct3D11TextureTarget::clear
void clear()
Clear the surface of the underlying texture.
CEGUI::Direct3D11TextureTarget::deactivate
void deactivate()
Deactivate the render target after having completed rendering.
CEGUI::Direct3D11RenderTarget
Implementation of an ntermediate RenderTarget for the Direct3D 10 API.
Definition: RendererModules/Direct3D11/RenderTarget.h:46
CEGUI::Direct3D11TextureTarget::enableRenderTexture
void enableRenderTexture()
switch to the texture surface & depth buffer
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::Direct3D11TextureTarget::isRenderingInverted
bool isRenderingInverted() const
Return whether rendering done on the target texture is inverted in relation to regular textures.
CEGUI::Direct3D11TextureTarget::isImageryCache
bool isImageryCache() const
Return whether the RenderTarget is an implementation that caches actual rendered imagery.
CEGUI::Direct3D11TextureTarget::generateTextureName
static String generateTextureName()
helper to generate unique texture names
CEGUI::Direct3D11TextureTarget::activate
void activate()
Activate the render target and put it in a state ready to be drawn to.
CEGUI::Texture
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:54
CEGUI::Direct3D11Renderer
Renderer implementation using Direct3D 10.
Definition: RendererModules/Direct3D11/Renderer.h:83
CEGUI::Direct3D11TextureTarget::d_renderTargetView
ID3D11RenderTargetView * d_renderTargetView
render target view for d_texture
Definition: RendererModules/Direct3D11/TextureTarget.h:88
CEGUI::Direct3D11TextureTarget::s_textureNumber
static uint s_textureNumber
static data used for creating texture names
Definition: RendererModules/Direct3D11/TextureTarget.h:70
CEGUI::Direct3D11TextureTarget::DEFAULT_SIZE
static const float DEFAULT_SIZE
default size of created texture objects
Definition: RendererModules/Direct3D11/TextureTarget.h:68
CEGUI::Direct3D11TextureTarget::d_previousRenderTargetView
ID3D11RenderTargetView * d_previousRenderTargetView
render target view that was bound before this target was activated
Definition: RendererModules/Direct3D11/TextureTarget.h:92
CEGUI::Size< float >
CEGUI::Direct3D11TextureTarget
Direct3D11TextureTarget - allows rendering to Direct3D 10 textures.
Definition: RendererModules/Direct3D11/TextureTarget.h:50
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::Direct3D11TextureTarget::getTexture
Texture & getTexture() const
Return a pointer to the CEGUI::Texture that the TextureTarget is using.
CEGUI::Direct3D11TextureTarget::disableRenderTexture
void disableRenderTexture()
switch back to previous surface
CEGUI::Direct3D11Texture
Texture implementation for the Direct3D11Renderer.
Definition: RendererModules/Direct3D11/Texture.h:50
CEGUI::Direct3D11TextureTarget::resizeRenderTexture
void resizeRenderTexture()
resize the texture
CEGUI::Direct3D11TextureTarget::cleanupRenderTexture
void cleanupRenderTexture()
clean up the texture used for rendering.
CEGUI::Direct3D11TextureTarget::initialiseRenderTexture
void initialiseRenderTexture()
allocate and set up the texture used for rendering.