Crazy Eddie's GUI System  0.8.4
TextureTarget.h
00001 /***********************************************************************
00002     created:    Wed May 5 2010
00003 *************************************************************************/
00004 /***************************************************************************
00005  *   Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
00006  *
00007  *   Permission is hereby granted, free of charge, to any person obtaining
00008  *   a copy of this software and associated documentation files (the
00009  *   "Software"), to deal in the Software without restriction, including
00010  *   without limitation the rights to use, copy, modify, merge, publish,
00011  *   distribute, sublicense, and/or sell copies of the Software, and to
00012  *   permit persons to whom the Software is furnished to do so, subject to
00013  *   the following conditions:
00014  *
00015  *   The above copyright notice and this permission notice shall be
00016  *   included in all copies or substantial portions of the Software.
00017  *
00018  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00019  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00021  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00022  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00023  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00024  *   OTHER DEALINGS IN THE SOFTWARE.
00025  ***************************************************************************/
00026 #ifndef _CEGUIDirect3D11TextureTarget_h_
00027 #define _CEGUIDirect3D11TextureTarget_h_
00028 
00029 #include "CEGUI/RendererModules/Direct3D11/RenderTarget.h"
00030 #include "../../TextureTarget.h"
00031 
00032 #if defined(_MSC_VER)
00033 #   pragma warning(push)
00034 #   pragma warning(disable : 4250)
00035 #   pragma warning(disable : 4251)
00036 #endif
00037 
00038 // d3d forward refs
00039 struct ID3D11Texture2D;
00040 struct ID3D11RenderTargetView;
00041 struct ID3D11DepthStencilView;
00042 
00043 // Start of CEGUI namespace section
00044 namespace CEGUI
00045 {
00046 class Direct3D11Texture;
00047 
00049 class D3D11_GUIRENDERER_API Direct3D11TextureTarget : public Direct3D11RenderTarget<TextureTarget>
00050 {
00051 public:
00052     Direct3D11TextureTarget(Direct3D11Renderer& owner);
00053     virtual ~Direct3D11TextureTarget();
00054 
00055     // overrides from Direct3D10RenderTarget
00056     void activate();
00057     void deactivate();
00058     // implementation of RenderTarget interface
00059     bool isImageryCache() const;
00060     // implementation of TextureTarget interface
00061     void clear();
00062     Texture& getTexture() const;
00063     void declareRenderSize(const Sizef& sz);
00064     bool isRenderingInverted() const;
00065 
00066 protected:
00068     static const float DEFAULT_SIZE;
00070     static uint s_textureNumber;
00072     static String generateTextureName();
00073 
00075     void initialiseRenderTexture();
00077     void cleanupRenderTexture();
00079     void resizeRenderTexture();
00081     void enableRenderTexture();
00083     void disableRenderTexture();
00084 
00086     ID3D11Texture2D* d_texture;
00088     ID3D11RenderTargetView* d_renderTargetView;
00090     Direct3D11Texture* d_CEGUITexture;
00092     ID3D11RenderTargetView* d_previousRenderTargetView;
00094     ID3D11DepthStencilView* d_previousDepthStencilView;
00095 };
00096 
00097 } // End of  CEGUI namespace section
00098 
00099 #if defined(_MSC_VER)
00100 #   pragma warning(pop)
00101 #endif
00102 
00103 #endif  // end of guard _CEGUIDirect3D11TextureTarget_h_
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends