# OgreViewport.h

Go to the documentation of this file.

    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
    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         ~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
    00178         void setClearEveryFrame(bool clear);
    00179
    00182         bool getClearEveryFrame(void) const;
    00183
    00186         void getActualDimensions(
    00187             int &left, int &top, int &width, int &height ) const;
    00188
    00189         bool _isUpdated(void) const;
    00190         void _clearUpdatedFlag(void);
    00191
    00194         unsigned int _getNumRenderedFaces(void) const;
    00195
    00206         void setOverlaysEnabled(bool enabled);
    00207
    00210         bool getOverlaysEnabled(void) const;
    00211
    00212
    00213     protected:
    00214         Camera* mCamera;
    00215         RenderTarget* mTarget;
    00216         // Relative dimensions, irrespective of target dimensions (0..1)
    00217         float mRelLeft, mRelTop, mRelWidth, mRelHeight;
    00218         // Actual dimensions, based on target dimensions
    00219         int mActLeft, mActTop, mActWidth, mActHeight;
    00221         int mZOrder;
    00223         ColourValue mBackColour;
    00224         bool mClearEveryFrame;
    00225         bool mUpdated;
    00226         bool mShowOverlays;
    00227     };
    00228
    00229 }
    00230
    00231 #endif

Copyright © 2000-2005 by The OGRE Team
Last modified Sun Nov 20 12:36:09 2005