Crazy Eddie's GUI System
0.8.4
|
00001 /*********************************************************************** 00002 created: Mon Jan 12 2009 00003 author: Paul D Turner 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 _CEGUIRenderingWindow_h_ 00028 #define _CEGUIRenderingWindow_h_ 00029 00030 #include "CEGUI/RenderingSurface.h" 00031 #include "CEGUI/Vector.h" 00032 #include "CEGUI/Quaternion.h" 00033 #include "CEGUI/Size.h" 00034 #include "CEGUI/Rect.h" 00035 00036 #if defined(_MSC_VER) 00037 # pragma warning(push) 00038 # pragma warning(disable : 4251) 00039 #endif 00040 00041 // Start of CEGUI namespace section 00042 namespace CEGUI 00043 { 00050 class CEGUIEXPORT RenderingWindow : public RenderingSurface 00051 { 00052 public: 00070 RenderingWindow(TextureTarget& target, RenderingSurface& owner); 00071 00073 ~RenderingWindow(); 00074 00094 void setClippingRegion(const Rectf& region); 00095 00110 void setPosition(const Vector2f& position); 00111 00120 void setSize(const Sizef& size); 00121 00130 void setRotation(const Quaternion& rotation); 00131 00141 void setPivot(const Vector3f& pivot); 00142 00156 const Vector2f& getPosition() const; 00157 00165 const Sizef& getSize() const; 00166 00174 const Quaternion& getRotation()const; 00175 00184 const Vector3f& getPivot() const; 00185 00196 const TextureTarget& getTextureTarget() const; 00197 TextureTarget& getTextureTarget(); 00198 00211 void update(const float elapsed); 00212 00223 void setRenderEffect(RenderEffect* effect); 00224 00235 RenderEffect* getRenderEffect(); 00236 00247 void realiseGeometry(); 00248 00259 void invalidateGeometry(); 00260 00271 const RenderingSurface& getOwner() const; 00272 RenderingSurface& getOwner(); 00273 00279 void unprojectPoint(const Vector2f& p_in, Vector2f& p_out); 00280 00281 // overrides from base 00282 void draw(); 00283 void invalidate(); 00284 bool isRenderingWindow() const; 00285 00286 protected: 00288 virtual void realiseGeometry_impl(); 00289 00291 void setOwner(RenderingSurface& owner); 00292 // friend is so that RenderingSurface can call setOwner to xfer ownership. 00293 friend void RenderingSurface::transferRenderingWindow(RenderingWindow&); 00294 00296 Renderer& d_renderer; 00298 TextureTarget& d_textarget; 00300 RenderingSurface* d_owner; 00302 GeometryBuffer* d_geometry; 00304 bool d_geometryValid; 00306 Vector2f d_position; 00308 Sizef d_size; 00310 Quaternion d_rotation; 00312 Vector3f d_pivot; 00313 }; 00314 00315 } // End of CEGUI namespace section 00316 00317 #if defined(_MSC_VER) 00318 # pragma warning(pop) 00319 #endif 00320 00321 #endif // end of guard _CEGUIRenderingWindow_h_