00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright (c) 2000-2005 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 #include "OgreCommon.h" 00030 #include "OgreColourValue.h" 00031 00032 namespace Ogre { 00046 class _OgreExport Viewport 00047 { 00048 public: 00071 Viewport( 00072 Camera* camera, 00073 RenderTarget* target, 00074 Real left, Real top, 00075 Real width, Real height, 00076 int ZOrder); 00077 00080 virtual ~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 00107 int getZOrder(void) const; 00111 Real getLeft(void) const; 00112 00116 Real getTop(void) const; 00117 00122 Real getWidth(void) const; 00127 Real getHeight(void) const; 00132 int getActualLeft(void) const; 00137 int getActualTop(void) const; 00141 int getActualWidth(void) const; 00146 int getActualHeight(void) const; 00147 00160 void setDimensions(Real left, Real top, Real width, Real height); 00161 00165 void setBackgroundColour(const ColourValue& colour); 00166 00169 const ColourValue& getBackgroundColour(void) const; 00170 00180 void setClearEveryFrame(bool clear, unsigned int buffers = FBT_COLOUR | FBT_DEPTH); 00181 00184 bool getClearEveryFrame(void) const; 00185 00187 unsigned int getClearBuffers(void) const; 00188 00196 void setMaterialScheme(const String& schemeName) 00197 { mMaterialSchemeName = schemeName; } 00198 00201 const String& getMaterialScheme(void) const 00202 { return mMaterialSchemeName; } 00203 00206 void getActualDimensions( 00207 int &left, int &top, int &width, int &height ) const; 00208 00209 bool _isUpdated(void) const; 00210 void _clearUpdatedFlag(void); 00211 00214 unsigned int _getNumRenderedFaces(void) const; 00215 00226 void setOverlaysEnabled(bool enabled); 00227 00230 bool getOverlaysEnabled(void) const; 00231 00242 void setSkiesEnabled(bool enabled); 00243 00246 bool getSkiesEnabled(void) const; 00247 00256 void setShadowsEnabled(bool enabled); 00257 00260 bool getShadowsEnabled(void) const; 00261 00274 virtual void setRenderQueueInvocationSequenceName(const String& sequenceName); 00276 virtual const String& getRenderQueueInvocationSequenceName(void) const; 00278 RenderQueueInvocationSequence* _getRenderQueueInvocationSequence(void); 00279 00280 protected: 00281 Camera* mCamera; 00282 RenderTarget* mTarget; 00283 // Relative dimensions, irrespective of target dimensions (0..1) 00284 float mRelLeft, mRelTop, mRelWidth, mRelHeight; 00285 // Actual dimensions, based on target dimensions 00286 int mActLeft, mActTop, mActWidth, mActHeight; 00288 int mZOrder; 00290 ColourValue mBackColour; 00291 bool mClearEveryFrame; 00292 unsigned int mClearBuffers; 00293 bool mUpdated; 00294 bool mShowOverlays; 00295 bool mShowSkies; 00296 bool mShowShadows; 00297 // Render queue invocation sequence name 00298 String mRQSequenceName; 00299 RenderQueueInvocationSequence* mRQSequence; 00301 String mMaterialSchemeName; 00302 }; 00303 00304 } 00305 00306 #endif
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:52 2006