Orxonox  0.0.5 Codename: Arcturus
WindowEventListener.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Reto Grieder
24  * Co-authors:
25  * ...
26  *
27  */
28 
34 #ifndef _WindowEventListener_H__
35 #define _WindowEventListener_H__
36 
37 #include "CorePrereqs.h"
38 #include "object/Listable.h"
39 
40 namespace orxonox
41 {
43  class _CoreExport WindowEventListener : virtual public Listable
44  {
46 
47  protected:
49  virtual ~WindowEventListener() = default;
50 
52  unsigned int getWindowWidth() const { return windowWidth_s; }
54  unsigned int getWindowHeight() const { return windowHeight_s; }
55 
56  private:
58  virtual void windowMoved() { }
59 
61  virtual void windowResized(unsigned int newWidth, unsigned int newHeight) { }
62 
64  virtual void windowFocusChanged(bool bFocus) { }
65 
66  static void moveWindow();
67  static void resizeWindow(unsigned int newWidth, unsigned int newHeight);
68  static void changeWindowFocus(bool bFocus);
69 
71  static unsigned int windowWidth_s;
72  static unsigned int windowHeight_s;
73  };
74 }
75 
76 #endif /* _WindowEventListener_H__ */
Listable stores the entries of all object lists pointing to this instance.
Definition: Listable.h:50
Shared library macros, enums, constants and forward declarations for the core library ...
Interface for receiving window events like resize, moved and focusChanged.
Definition: WindowEventListener.h:43
virtual void windowFocusChanged(bool bFocus)
Window has lost/gained focus.
Definition: WindowEventListener.h:64
virtual void windowResized(unsigned int newWidth, unsigned int newHeight)
Window has resized.
Definition: WindowEventListener.h:61
static unsigned int windowWidth_s
Static variable that holds the latest distributed information.
Definition: WindowEventListener.h:71
unsigned int getWindowHeight() const
Returns the current render window height.
Definition: WindowEventListener.h:54
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _CoreExport
Definition: CorePrereqs.h:61
Declaration of Listable, the base of all classes whose instances can be stored in object lists...
static unsigned int windowHeight_s
Definition: WindowEventListener.h:72
unsigned int getWindowWidth() const
Returns the current render window width.
Definition: WindowEventListener.h:52
Definition: GraphicsManager.cc:86
virtual void windowMoved()
Window has been moved.
Definition: WindowEventListener.h:58