Equalizer  1.10.1
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
windowSystem.h
1 
2 /* Copyright (c) 2006-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2011, Daniel Pfeifer <daniel@pfeifer-mail.de>
4  * 2014, Daniel Nachbaur <danielnachbaur@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef EQ_WINDOWSYSTEM_H
21 #define EQ_WINDOWSYSTEM_H
22 
23 #include <eq/api.h>
24 #include <eq/types.h>
25 
26 namespace eq
27 {
28 
41 {
42 public:
44  virtual ~WindowSystemIF() {}
45 
46 protected:
48  EQ_API WindowSystemIF();
49 
51  static uint32_t _setupLists( util::ObjectManager& gl, const void* key,
52  const int num );
53 
55  virtual std::string getName() const = 0;
56 
58  virtual SystemPipe* createPipe( Pipe* pipe ) = 0;
59 
61  virtual MessagePump* createMessagePump() = 0;
62 
64  virtual SystemWindow* createWindow( Window* window,
65  const WindowSettings& settings ) = 0;
66 
81  virtual bool setupFont( util::ObjectManager& gl, const void* key,
82  const std::string& name,
83  const uint32_t size ) const = 0;
84 
86  virtual void configInit( Node* /*node*/ ) {}
87 
89  virtual void configExit( Node* /*node*/ ) {}
90 
95  virtual bool hasMainThreadEvents() const { return false; }
96 
97 private:
98  WindowSystemIF* _next;
99  friend class WindowSystem;
100 };
101 
107 {
108 public:
109  EQ_API explicit WindowSystem( const std::string& name );
110 
111  static bool supports( const std::string& type );
112 
113  static void configInit( Node* node );
114  static void configExit( Node* node );
115 
116  EQ_API std::string getName() const;
117 
118  EQ_API SystemWindow* createWindow( Window* window,
119  const WindowSettings& settings );
120  EQ_API SystemPipe* createPipe( Pipe* pipe );
121  EQ_API MessagePump* createMessagePump();
122  EQ_API bool setupFont( util::ObjectManager& gl, const void* key,
123  const std::string& name, const uint32_t size ) const;
124  EQ_API bool hasMainThreadEvents() const;
125 
126  EQ_API bool operator == ( const WindowSystem& other ) const;
127  EQ_API bool operator != ( const WindowSystem& other ) const;
128 
129 private:
130  WindowSystem();
131  WindowSystemIF* _impl;
132  void _chooseImpl( const std::string& name );
133 };
134 
136 EQ_API std::ostream& operator << ( std::ostream& os, const WindowSystem& );
137 
139 EQ_API co::DataOStream& operator << ( co::DataOStream& os, const WindowSystem& );
140 
142 EQ_API co::DataIStream& operator >> ( co::DataIStream& is, WindowSystem& ws );
143 
144 } // namespace eq
145 
146 #endif // EQ_WINDOWSYSTEM_H
virtual ~WindowSystemIF()
Destroy the window system instance.
Definition: windowSystem.h:44
virtual void configExit(Node *)
Perform per-process de-initialization for a Config.
Definition: windowSystem.h:89
EQ_API WindowSystemIF()
Create a new window system instance.
EQ_API std::ostream & operator<<(std::ostream &os, const ConfigEvent *event)
Print the config event to the given output stream.
A Pipe represents a graphics card (GPU) on a Node.
Definition: pipe.h:50
A Node represents a single computer in the cluster.
Definition: node.h:48
A set of settings to setup an eq::SystemWindow.
virtual SystemPipe * createPipe(Pipe *pipe)=0
virtual bool setupFont(util::ObjectManager &gl, const void *key, const std::string &name, const uint32_t size) const =0
Create a set of display lists for the given font.
virtual MessagePump * createMessagePump()=0
An interface to process system messages or events.
Definition: messagePump.h:27
EQ_API co::DataIStream & operator>>(co::DataIStream &is, WindowSystem &ws)
WindowSystem deserializer.
A Window represents an on-screen or off-screen drawable.
Definition: window.h:64
The interface definition for system-specific GPU handling.
Definition: systemPipe.h:38
virtual SystemWindow * createWindow(Window *window, const WindowSettings &settings)=0
virtual std::string getName() const =0
virtual bool hasMainThreadEvents() const
Definition: windowSystem.h:95
The interface definition for system-specific windowing code.
Definition: systemWindow.h:35
A facility class to manage OpenGL objects across shared contexts.
Definition: objectManager.h:52
The interface for windowing toolkits.
Definition: windowSystem.h:40
virtual void configInit(Node *)
Perform per-process initialization for a Config.
Definition: windowSystem.h:86