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:
69 
82  virtual void create(const String& name, unsigned int width, unsigned int height,
83  bool fullScreen, const NameValuePairList *miscParams) = 0;
84 
92  virtual void setFullscreen(bool fullScreen, unsigned int width, unsigned int height)
93  { (void)fullScreen; (void)width; (void)height; }
94 
97  virtual void destroy(void) = 0;
98 
101  virtual void resize(unsigned int width, unsigned int height) = 0;
102 
107  virtual void windowMovedOrResized() {}
108 
111  virtual void reposition(int left, int top) = 0;
112 
115  virtual bool isVisible(void) const { return true; }
116 
119  virtual void setVisible(bool visible)
120  { (void)visible; }
121 
124  virtual bool isHidden(void) const { return false; }
125 
134  virtual void setHidden(bool hidden)
135  { (void)hidden; }
136 
139  virtual void setVSyncEnabled(bool vsync)
140  { (void)vsync; }
141 
144  virtual bool isVSyncEnabled() const { return false; }
145 
149  virtual void setVSyncInterval(unsigned int interval)
150  { (void)interval; }
151 
154  virtual unsigned int getVSyncInterval() const { return 1; }
155 
156 
159  virtual bool isActive(void) const { return mActive && isVisible(); }
160 
163  virtual bool isClosed(void) const = 0;
164 
171  virtual bool isPrimary(void) const;
172 
175  virtual bool isFullScreen(void) const;
176 
180  virtual void getMetrics(unsigned int& width, unsigned int& height, unsigned int& colourDepth,
181  int& left, int& top);
182 
185 
189 
194  void setDeactivateOnFocusChange(bool deactivate);
195 
196  protected:
200  int mLeft;
201  int mTop;
202 
206  void _setPrimary() { mIsPrimary = true; }
207 
208  friend class Root;
209  };
213 } // Namespace
214 #endif
Ogre::RenderWindow::setVSyncEnabled
virtual void setVSyncEnabled(bool vsync)
Enable or disable vertical sync for the RenderWindow.
Definition: OgreRenderWindow.h:139
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::RenderWindow::isHidden
virtual bool isHidden(void) const
Indicates whether the window was set to hidden (not displayed)
Definition: OgreRenderWindow.h:124
Ogre::RenderWindow::getVSyncInterval
virtual unsigned int getVSyncInterval() const
Returns the vertical sync interval.
Definition: OgreRenderWindow.h:154
Ogre::RenderWindow
Manages the target rendering window.
Definition: OgreRenderWindow.h:63
OgreRenderTarget.h
Ogre::Root
The root class of the Ogre system.
Definition: OgreRoot.h:72
Ogre::PF_BYTE_RGB
@ PF_BYTE_RGB
3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
Definition: OgrePixelFormat.h:99
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::RenderWindow::isActive
virtual bool isActive(void) const
Overridden from RenderTarget, flags invisible windows as inactive.
Definition: OgreRenderWindow.h:159
Ogre::NameValuePairList
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:550
Ogre::RenderWindow::isFullScreen
virtual bool isFullScreen(void) const
Returns true if window is running in fullscreen mode.
Ogre::RenderWindow::mAutoDeactivatedOnFocusChange
bool mAutoDeactivatedOnFocusChange
Definition: OgreRenderWindow.h:199
Ogre::RenderWindow::create
virtual void create(const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams)=0
Creates & displays the new window.
Ogre::RenderTarget
A 'canvas' which can receive the results of a rendering operation.
Definition: OgreRenderTarget.h:66
Ogre::PixelFormat
PixelFormat
The pixel format used for images, textures, and render surfaces.
Definition: OgrePixelFormat.h:44
OgrePrerequisites.h
Ogre::RenderWindow::windowMovedOrResized
virtual void windowMovedOrResized()
Notify that the window has been resized.
Definition: OgreRenderWindow.h:107
Ogre::RenderWindow::reposition
virtual void reposition(int left, int top)=0
Reposition the window.
Ogre::RenderWindow::isDeactivatedOnFocusChange
bool isDeactivatedOnFocusChange() const
Returns true if the window will automatically de-activate itself when it loses focus.
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::RenderWindow::setHidden
virtual void setHidden(bool hidden)
Hide (or show) the window.
Definition: OgreRenderWindow.h:134
Ogre::RenderWindow::setFullscreen
virtual void setFullscreen(bool fullScreen, unsigned int width, unsigned int height)
Alter fullscreen mode options.
Definition: OgreRenderWindow.h:92
Ogre::RenderWindow::setVisible
virtual void setVisible(bool visible)
Set the visibility state.
Definition: OgreRenderWindow.h:119
Ogre::RenderWindow::mIsPrimary
bool mIsPrimary
Definition: OgreRenderWindow.h:198
Ogre::RenderWindow::isClosed
virtual bool isClosed(void) const =0
Indicates whether the window has been closed by the user.
Ogre::RenderWindow::suggestPixelFormat
PixelFormat suggestPixelFormat() const
Override since windows don't usually have alpha.
Definition: OgreRenderWindow.h:184
Ogre::RenderWindow::setVSyncInterval
virtual void setVSyncInterval(unsigned int interval)
Set the vertical sync interval.
Definition: OgreRenderWindow.h:149
Ogre::RenderWindow::isVisible
virtual bool isVisible(void) const
Indicates whether the window is visible (not minimized or obscured)
Definition: OgreRenderWindow.h:115
Ogre::RenderWindow::getMetrics
virtual void getMetrics(unsigned int &width, unsigned int &height, unsigned int &colourDepth, int &left, int &top)
Overloaded version of getMetrics from RenderTarget, including extra details specific to windowing sys...
Ogre::RenderWindow::resize
virtual void resize(unsigned int width, unsigned int height)=0
Alter the size of the window.
Ogre::RenderWindow::mIsFullScreen
bool mIsFullScreen
Definition: OgreRenderWindow.h:197
Ogre::RenderWindow::destroy
virtual void destroy(void)=0
Destroys the window.
Ogre::RenderWindow::_setPrimary
void _setPrimary()
Indicates that this is the primary window.
Definition: OgreRenderWindow.h:206
Ogre::RenderWindow::setDeactivateOnFocusChange
void setDeactivateOnFocusChange(bool deactivate)
Indicates whether the window will automatically deactivate itself when it loses focus.
Ogre::RenderWindow::RenderWindow
RenderWindow()
Default constructor.
Ogre::RenderWindow::mTop
int mTop
Definition: OgreRenderWindow.h:201
Ogre::RenderWindow::isPrimary
virtual bool isPrimary(void) const
Indicates whether the window is the primary window.
Ogre::RenderWindow::mLeft
int mLeft
Definition: OgreRenderWindow.h:200
Ogre::RenderWindow::isVSyncEnabled
virtual bool isVSyncEnabled() const
Indicates whether vertical sync is activated for the window.
Definition: OgreRenderWindow.h:144

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.