OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreRenderWindow.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2 This source file is a part of OGRE
3 (Object-oriented Graphics Rendering Engine)
4 
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14 
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE SOFTWARE
25 -------------------------------------------------------------------------*/
26 #ifndef __RenderWindow_H__
27 #define __RenderWindow_H__
28 
29 #include "OgrePrerequisites.h"
30 
31 #include "OgreRenderTarget.h"
32 
33 namespace Ogre
34 {
63  {
64 
65  public:
68  RenderWindow();
69 
93  virtual void create(const String& name, unsigned int width, unsigned int height,
94  bool fullScreen, const NameValuePairList *miscParams) = 0;
95 
103  virtual void setFullscreen(bool fullScreen, unsigned int width, unsigned int height)
104  { (void)fullScreen; (void)width; (void)height; }
105 
108  virtual void destroy(void) = 0;
109 
112  virtual void resize(unsigned int width, unsigned int height) = 0;
113 
118  virtual void windowMovedOrResized() {}
119 
122  virtual void reposition(int left, int top) = 0;
123 
126  virtual bool isVisible(void) const { return true; }
127 
130  virtual void setVisible(bool visible)
131  { (void)visible; }
132 
135  virtual bool isHidden(void) const { return false; }
136 
145  virtual void setHidden(bool hidden)
146  { (void)hidden; }
147 
150  virtual void setVSyncEnabled(bool vsync)
151  { (void)vsync; }
152 
155  virtual bool isVSyncEnabled() const { return false; }
156 
160  virtual void setVSyncInterval(unsigned int interval)
161  { (void)interval; }
162 
165  virtual unsigned int getVSyncInterval() const { return 1; }
166 
167 
170  virtual bool isActive(void) const { return mActive && isVisible(); }
171 
174  virtual bool isClosed(void) const = 0;
175 
182  virtual bool isPrimary(void) const;
183 
186  virtual bool isFullScreen(void) const;
187 
191  virtual void getMetrics(unsigned int& width, unsigned int& height, unsigned int& colourDepth,
192  int& left, int& top);
193 
196 
199  bool isDeactivatedOnFocusChange() const;
200 
205  void setDeactivateOnFocusChange(bool deactivate);
206 
207  protected:
211  int mLeft;
212  int mTop;
213 
217  void _setPrimary() { mIsPrimary = true; }
218 
219  friend class Root;
220  };
224 } // Namespace
225 #endif
Manages the target rendering window.
A 'canvas' which can receive the results of a rendering operation.
virtual bool isHidden(void) const
Indicates whether the window was set to hidden (not displayed)
virtual bool isVSyncEnabled() const
Indicates whether vertical sync is activated for the window.
The root class of the Ogre system.
Definition: OgreRoot.h:67
#define _OgreExport
Definition: OgrePlatform.h:233
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:553
virtual void windowMovedOrResized()
Notify that the window has been resized.
PixelFormat suggestPixelFormat() const
Override since windows don't usually have alpha.
virtual bool isActive(void) const
Overridden from RenderTarget, flags invisible windows as inactive.
void _setPrimary()
Indicates that this is the primary window.
virtual void setHidden(bool hidden)
Hide (or show) the window.
virtual void setVSyncInterval(unsigned int interval)
Set the vertical sync interval.
3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
virtual void setFullscreen(bool fullScreen, unsigned int width, unsigned int height)
Alter fullscreen mode options.
PixelFormat
The pixel format used for images, textures, and render surfaces.
virtual unsigned int getVSyncInterval() const
Returns the vertical sync interval.
virtual void setVSyncEnabled(bool vsync)
Enable or disable vertical sync for the RenderWindow.
_StringBase String
virtual void setVisible(bool visible)
Set the visibility state.
virtual bool isVisible(void) const
Indicates whether the window is visible (not minimized or obscured)