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