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