Equalizer  1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
windowSystem.h
1 
2 /* Copyright (c) 2006-2013, 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/client/api.h>
24 #include <eq/client/types.h>
25 
26 namespace eq
27 {
28 
41 {
42 protected:
44  EQ_API WindowSystemIF();
45 
47  virtual ~WindowSystemIF() {}
48 
50  static uint32_t _setupLists( util::ObjectManager& gl, const void* key,
51  const int num );
52 
54  virtual std::string getName() const = 0;
55 
57  virtual SystemPipe* createPipe(Pipe* pipe) const = 0;
58 
60  virtual MessagePump* createMessagePump() const = 0;
61 
63  virtual SystemWindow* createWindow( Window* window,
64  const WindowSettings& settings ) const = 0;
65 
80  virtual bool setupFont( util::ObjectManager& gl, const void* key,
81  const std::string& name, const uint32_t size ) const = 0;
82 
84  virtual void configInit( Node* /*node*/ ) {}
85 
87  virtual void configExit( Node* /*node*/ ) {}
88 
89 private:
90  WindowSystemIF* _next;
91  friend class WindowSystem;
92 };
93 
99 {
100 public:
101  EQ_API WindowSystem();
102  EQ_API WindowSystem( const std::string& name );
103 
104  static bool supports( std::string const& type );
105 
106  static void configInit( Node* node );
107  static void configExit( Node* node );
108 
109  EQ_API std::string getName() const;
110 
111  EQ_API SystemWindow* createWindow( Window* window,
112  const WindowSettings& settings ) const;
113  EQ_API SystemPipe* createPipe( Pipe* pipe ) const;
114  EQ_API MessagePump* createMessagePump() const;
115  EQ_API bool setupFont( util::ObjectManager& gl, const void* key,
116  const std::string& name, const uint32_t size ) const;
117 
118  EQ_API bool operator == ( const WindowSystem& other ) const;
119  EQ_API bool operator != ( const WindowSystem& other ) const;
120 
121 private:
122  const WindowSystemIF* _impl;
123  void _chooseImpl( const std::string& name );
124 };
125 
127 EQ_API std::ostream& operator << ( std::ostream& os, const WindowSystem& );
128 
130 EQ_API co::DataOStream& operator << ( co::DataOStream& os, const WindowSystem& );
131 
133 EQ_API co::DataIStream& operator >> ( co::DataIStream& is, WindowSystem& ws );
134 
135 } // namespace eq
136 
137 #endif // EQ_WINDOWSYSTEM_H
virtual ~WindowSystemIF()
Destroy the window system instance.
Definition: windowSystem.h:47
virtual void configExit(Node *)
Perform per-process de-initialization for a Config.
Definition: windowSystem.h:87
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: client/pipe.h:50
A Node represents a single computer in the cluster.
Definition: client/node.h:48
A set of settings to setup an eq::SystemWindow.
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.
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: client/window.h:64
The interface definition for system-specific GPU handling.
Definition: systemPipe.h:37
virtual std::string getName() const =0
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:51
The interface for windowing toolkits.
Definition: windowSystem.h:40
virtual SystemWindow * createWindow(Window *window, const WindowSettings &settings) const =0
virtual MessagePump * createMessagePump() const =0
virtual void configInit(Node *)
Perform per-process initialization for a Config.
Definition: windowSystem.h:84
virtual SystemPipe * createPipe(Pipe *pipe) const =0