OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreViewport.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __Viewport_H__
29 #define __Viewport_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreCommon.h"
33 #include "OgreFrustum.h"
34 #include "OgreHeaderPrefix.h"
35 
36 namespace Ogre {
57  {
58  public:
60  size_t mGlobalIndex;
61 
77  Viewport(
78  RenderTarget* target,
79  Real left, Real top,
80  Real width, Real height );
81 
84  virtual ~Viewport();
85 
93  void _updateDimensions(void);
94 
97  void _updateCullPhase01(Camera* camera, const Camera *lodCamera, uint8 firstRq, uint8 lastRq );
98  void _updateRenderPhase02( Camera* camera, const Camera *lodCamera,
99  uint8 firstRq, uint8 lastRq );
100 
113  void clear(unsigned int buffers = FBT_COLOUR | FBT_DEPTH,
114  const ColourValue& colour = ColourValue::Black,
115  Real depth = 1.0f, unsigned short stencil = 0);
116 
119  RenderTarget* getTarget(void) const;
120 
124  Real getLeft(void) const;
125 
129  Real getTop(void) const;
130 
135  Real getWidth(void) const;
140  Real getHeight(void) const;
145  int getActualLeft(void) const;
150  int getActualTop(void) const;
154  int getActualWidth(void) const;
159  int getActualHeight(void) const;
160 
174  void setDimensions(Real left, Real top, Real width, Real height);
175 
178  void setOrientationMode(OrientationMode orientationMode, bool setDefault = true);
179 
182  OrientationMode getOrientationMode() const;
183 
186  static void setDefaultOrientationMode(OrientationMode orientationMode);
187 
190  static OrientationMode getDefaultOrientationMode();
191 
199  void setMaterialScheme(const String& schemeName)
200  { mMaterialSchemeName = schemeName; }
201 
204  const String& getMaterialScheme(void) const
205  { return mMaterialSchemeName; }
206 
209  void getActualDimensions(
210  int &left, int &top, int &width, int &height ) const;
211 
212  bool _isUpdated(void) const;
213  void _clearUpdatedFlag(void);
214 
225  void setOverlaysEnabled(bool enabled);
226 
229  bool getOverlaysEnabled(void) const;
230 
241  void setSkiesEnabled(bool enabled);
242 
245  bool getSkiesEnabled(void) const;
246 
258  void _setVisibilityMask(uint32 mask) { mVisibilityMask = mask; }
259 
263  uint getVisibilityMask(void) const { return mVisibilityMask; }
264 
277  virtual void setRenderQueueInvocationSequenceName(const String& sequenceName);
279  virtual const String& getRenderQueueInvocationSequenceName(void) const;
281  RenderQueueInvocationSequence* _getRenderQueueInvocationSequence(void);
282 
284  void pointOrientedToScreen(const Vector2 &v, int orientationMode, Vector2 &outv);
285  void pointOrientedToScreen(Real orientedX, Real orientedY, int orientationMode,
286  Real &screenX, Real &screenY);
287 
288  protected:
289 
292  float mRelLeft, mRelTop, mRelWidth, mRelHeight;
294  int mActLeft, mActTop, mActWidth, mActHeight;
296  int mZOrder;
298  bool mUpdated;
302  // Render queue invocation sequence name
310  };
314 }
315 
316 #include "OgreHeaderSuffix.h"
317 
318 #endif
unsigned char uint8
Definition: OgrePlatform.h:422
A 'canvas' which can receive the results of a rendering operation.
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
bool mUpdated
Background options.
Definition: OgreViewport.h:298
String mRQSequenceName
Definition: OgreViewport.h:303
float Real
Software floating point type.
unsigned int uint32
Definition: OgrePlatform.h:420
#define _OgreExport
Definition: OgrePlatform.h:255
size_t mGlobalIndex
Index in the vector holding this MO reference (could be our parent node, or a global array tracking a...
Definition: OgreViewport.h:60
void setMaterialScheme(const String &schemeName)
Set the material scheme which the viewport should use.
Definition: OgreViewport.h:199
Class representing colour.
RenderTarget * mTarget
Definition: OgreViewport.h:290
Class to hold a linear sequence of RenderQueueInvocation objects.
void _setVisibilityMask(uint32 mask)
Sets a per-viewport visibility mask.
Definition: OgreViewport.h:258
OrientationMode
Specifies orientation mode.
Definition: OgreFrustum.h:48
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Standard 2-dimensional vector.
Definition: OgreVector2.h:51
uint getVisibilityMask(void) const
Gets a per-viewport visibility mask.
Definition: OgreViewport.h:263
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:56
String mMaterialSchemeName
Material scheme.
Definition: OgreViewport.h:306
const String & getMaterialScheme(void) const
Get the material scheme which the viewport should use.
Definition: OgreViewport.h:204
static const ColourValue Black
_StringBase String
Definition: OgreCommon.h:53
static OrientationMode mDefaultOrientationMode
Definition: OgreViewport.h:309
RenderQueueInvocationSequence * mRQSequence
Definition: OgreViewport.h:304
OrientationMode mOrientationMode
Viewport orientation mode.
Definition: OgreViewport.h:308
int mZOrder
Z-order.
Definition: OgreViewport.h:296
unsigned int uint
uint32 mVisibilityMask
Definition: OgreViewport.h:301