Crazy Eddie's GUI System  0.8.4
TextureTarget.h
00001 /***********************************************************************
00002     created:    Sat Mar 7 2009
00003     author:     Paul D Turner (parts based on code by Rajko Stojadinovic)
00004 *************************************************************************/
00005 /***************************************************************************
00006  *   Copyright (C) 2004 - 2011 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 _CEGUIDirect3D10TextureTarget_h_
00028 #define _CEGUIDirect3D10TextureTarget_h_
00029 
00030 #include "CEGUI/RendererModules/Direct3D10/RenderTarget.h"
00031 #include "../../TextureTarget.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 ID3D10Texture2D;
00041 struct ID3D10RenderTargetView;
00042 struct ID3D10DepthStencilView;
00043 
00044 // Start of CEGUI namespace section
00045 namespace CEGUI
00046 {
00047 class Direct3D10Texture;
00048 
00050 class D3D10_GUIRENDERER_API Direct3D10TextureTarget : public Direct3D10RenderTarget<TextureTarget>
00051 {
00052 public:
00053     Direct3D10TextureTarget(Direct3D10Renderer& owner);
00054     virtual ~Direct3D10TextureTarget();
00055 
00056     // overrides from Direct3D10RenderTarget
00057     void activate();
00058     void deactivate();
00059     // implementation of RenderTarget interface
00060     bool isImageryCache() const;
00061     // implementation of TextureTarget interface
00062     void clear();
00063     Texture& getTexture() const;
00064     void declareRenderSize(const Sizef& sz);
00065     bool isRenderingInverted() const;
00066 
00067 protected:
00069     static const float DEFAULT_SIZE;
00071     static uint s_textureNumber;
00073     static String generateTextureName();
00074 
00076     void initialiseRenderTexture();
00078     void cleanupRenderTexture();
00080     void resizeRenderTexture();
00082     void enableRenderTexture();
00084     void disableRenderTexture();
00085 
00087     ID3D10Texture2D* d_texture;
00089     ID3D10RenderTargetView* d_renderTargetView;
00091     Direct3D10Texture* d_CEGUITexture;
00093     ID3D10RenderTargetView* d_previousRenderTargetView;
00095     ID3D10DepthStencilView* d_previousDepthStencilView;
00096 };
00097 
00098 } // End of  CEGUI namespace section
00099 
00100 #if defined(_MSC_VER)
00101 #   pragma warning(pop)
00102 #endif
00103 
00104 #endif  // end of guard _CEGUIDirect3D10TextureTarget_h_
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends