Crazy Eddie's GUI System  0.8.4
RenderTarget.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 _CEGUIDirect3D10RenderTarget_h_
00027 #define _CEGUIDirect3D10RenderTarget_h_
00028 
00029 #include "../../RenderTarget.h"
00030 #include "CEGUI/RendererModules/Direct3D11/Renderer.h"
00031 #include "../../Rect.h"
00032 #include <d3dx10.h>
00033 
00034 
00035 #if defined(_MSC_VER)
00036 #   pragma warning(push)
00037 #   pragma warning(disable : 4251)
00038 #endif
00039 
00040 // Start of CEGUI namespace section
00041 namespace CEGUI
00042 {
00044 template <typename T = RenderTarget>
00045 class D3D11_GUIRENDERER_API Direct3D11RenderTarget : public T
00046 {
00047 public:
00049     Direct3D11RenderTarget(Direct3D11Renderer& owner);
00050 
00051     // implement parts of RenderTarget interface
00052     void draw(const GeometryBuffer& buffer);
00053     void draw(const RenderQueue& queue);
00054     void setArea(const Rectf& area);
00055     const Rectf& getArea() const;
00056     void activate();
00057     void deactivate();
00058     void unprojectPoint(const GeometryBuffer& buff,
00059                         const Vector2f& p_in,
00060                         Vector2f& p_out) const;
00061 
00062 protected:
00064     void updateMatrix() const;
00066     void setupViewport(D3D11_VIEWPORT& vp) const;
00067 
00069     Direct3D11Renderer& d_owner;
00071     IDevice11& d_device;
00073     Rectf d_area;
00075     mutable D3DXMATRIX d_matrix;
00077     mutable bool d_matrixValid;
00079     mutable float d_viewDistance;
00080 };
00081 
00082 } // End of  CEGUI namespace section
00083 
00084 #if defined(_MSC_VER)
00085 #   pragma warning(pop)
00086 #endif
00087 
00088 #endif  // end of guard _CEGUIDirect3D10RenderTarget_h_
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends