00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://ogre.sourceforge.net/ 00006 00007 Copyright © 2000-2002 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #ifndef __Viewport_H__ 00026 #define __Viewport_H__ 00027 00028 #include "OgrePrerequisites.h" 00029 00030 #include "OgreColourValue.h" 00031 00032 namespace Ogre { 00046 class _OgreExport Viewport 00047 { 00048 public: 00071 Viewport( 00072 Camera* camera, 00073 RenderTarget* target, 00074 float left, float top, 00075 float width, float height, 00076 int ZOrder); 00077 00080 ~Viewport(); 00081 00089 void _updateDimensions(void); 00090 00093 void update(void); 00094 00097 RenderTarget* getTarget(void) const; 00098 00101 Camera* getCamera(void) const; 00102 00104 void setCamera(Camera* cam); 00105 00109 float getLeft(void) const; 00110 00114 float getTop(void) const; 00115 00120 float getWidth(void) const; 00125 float getHeight(void) const; 00130 int getActualLeft(void) const; 00135 int getActualTop(void) const; 00139 int getActualWidth(void) const; 00144 int getActualHeight(void) const; 00145 00158 void setDimensions(float left, float top, float width, float height); 00159 00163 void setBackgroundColour(ColourValue colour); 00164 00167 const ColourValue& getBackgroundColour(void) const; 00168 00176 void setClearEveryFrame(bool clear); 00177 00180 bool getClearEveryFrame(void) const; 00181 00184 void getActualDimensions( 00185 int &left, int &top, int &width, int &height ) const; 00186 00187 bool _isUpdated(void) const; 00188 void _clearUpdatedFlag(void); 00189 00192 unsigned int _getNumRenderedFaces(void) const; 00193 00204 void setOverlaysEnabled(bool enabled); 00205 00208 bool getOverlaysEnabled(void); 00209 00210 00211 protected: 00212 Camera* mCamera; 00213 RenderTarget* mTarget; 00214 // Relative dimensions, irrespective of target dimensions (0..1) 00215 float mRelLeft, mRelTop, mRelWidth, mRelHeight; 00216 // Actual dimensions, based on target dimensions 00217 int mActLeft, mActTop, mActWidth, mActHeight; 00219 int mZOrder; 00221 ColourValue mBackColour; 00222 bool mClearEveryFrame; 00223 bool mUpdated; 00224 bool mShowOverlays; 00225 }; 00226 00227 } 00228 00229 #endif
Copyright © 2002 by The OGRE Team