00001 /*********************************************************************** 00002 filename: CEGUIRenderingWindow.h 00003 created: Mon Jan 12 2009 00004 author: Paul D Turner 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 _CEGUIRenderingWindow_h_ 00029 #define _CEGUIRenderingWindow_h_ 00030 00031 #include "CEGUIRenderingSurface.h" 00032 #include "CEGUIVector.h" 00033 #include "CEGUISize.h" 00034 00035 // Start of CEGUI namespace section 00036 namespace CEGUI 00037 { 00044 class CEGUIEXPORT RenderingWindow : public RenderingSurface 00045 { 00046 public: 00064 RenderingWindow(TextureTarget& target, RenderingSurface& owner); 00065 00067 ~RenderingWindow(); 00068 00088 void setClippingRegion(const Rect& region); 00089 00104 void setPosition(const Vector2& position); 00105 00114 void setSize(const Size& size); 00115 00125 void setRotation(const Vector3& rotation); 00126 00136 void setPivot(const Vector3& pivot); 00137 00151 const Vector2& getPosition() const; 00152 00160 const Size& getSize() const; 00161 00170 const Vector3& getRotation()const; 00171 00180 const Vector3& getPivot() const; 00181 00192 const TextureTarget& getTextureTarget() const; 00193 TextureTarget& getTextureTarget(); 00194 00207 void update(const float elapsed); 00208 00219 void setRenderEffect(RenderEffect* effect); 00220 00231 RenderEffect* getRenderEffect(); 00232 00243 void realiseGeometry(); 00244 00255 const RenderingSurface& getOwner() const; 00256 RenderingSurface& getOwner(); 00257 00263 void unprojectPoint(const Vector2& p_in, Vector2& p_out); 00264 00265 // overrides from base 00266 void draw(); 00267 void invalidate(); 00268 bool isRenderingWindow() const; 00269 00270 protected: 00272 virtual void realiseGeometry_impl(); 00273 00275 void setOwner(RenderingSurface& owner); 00276 // friend is so that RenderingSurface can call setOwner to xfer ownership. 00277 friend void RenderingSurface::transferRenderingWindow(RenderingWindow&); 00278 00280 Renderer& d_renderer; 00282 TextureTarget& d_textarget; 00284 RenderingSurface* d_owner; 00286 GeometryBuffer* d_geometry; 00288 bool d_geometryValid; 00290 Vector2 d_position; 00292 Size d_size; 00294 Vector3 d_rotation; 00296 Vector3 d_pivot; 00297 }; 00298 00299 } // End of CEGUI namespace section 00300 00301 #endif // end of guard _CEGUIRenderingWindow_h_