Equalizer  2.1.0
Parallel Rendering Framework
systemWindow.h
1 
2 /* Copyright (c) 2005-2017, Stefan Eilemann <eile@equalizergraphics.com>
3  * Daniel Nachbaur <danielnachbaur@gmail.com>
4  * Maxim Makhinya
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_SYSTEM_WINDOW_H
21 #define EQ_SYSTEM_WINDOW_H
22 
23 #include <eq/types.h>
24 #include <eq/windowSettings.h> // WindowSettings::IAttribute enum
25 
26 namespace eq
27 {
36 {
37 public:
39  EQ_API SystemWindow(NotifierInterface& parent,
40  const WindowSettings& settings);
41 
43  EQ_API virtual ~SystemWindow();
44 
56  EQ_API virtual bool configInit() = 0;
57 
66  EQ_API virtual void configExit() = 0;
67 
74  EQ_API virtual void makeCurrent(const bool cache = true) const = 0;
75 
82  EQ_API virtual void doneCurrent() const = 0;
83 
85  EQ_API virtual void bindFrameBuffer() const = 0;
86 
88  EQ_API virtual void bindDrawFrameBuffer() const = 0;
89 
91  EQ_API virtual void updateFrameBuffer() const = 0;
92 
94  EQ_API virtual void swapBuffers() = 0;
95 
97  EQ_API virtual void flush() = 0;
98 
100  EQ_API virtual void finish() = 0;
101 
112  EQ_API virtual void joinNVSwapBarrier(const uint32_t group,
113  const uint32_t barrier) = 0;
115 
120  {
121  return 0;
122  }
126 
131  EQ_API virtual void queryDrawableConfig(DrawableConfig& dc) = 0;
132 
147  virtual const GLEWContext* glewGetContext() const { return 0; }
154  EQ_API EventOCommand sendError(const uint32_t error);
155 
157  EQ_API bool processEvent(EventType type);
158 
160  EQ_API bool processEvent(EventType type, SizeEvent& event);
161 
163  EQ_API bool processEvent(EventType type, PointerEvent& event);
164 
166  EQ_API bool processEvent(EventType type, KeyEvent& event);
167 
169  EQ_API bool processEvent(AxisEvent& event);
170 
172  EQ_API bool processEvent(ButtonEvent& event);
173 
180  EQ_API void setPixelViewport(const PixelViewport& pvp);
181 
186  EQ_API const PixelViewport& getPixelViewport() const;
187 
194  EQ_API virtual void resize(const PixelViewport& pvp) = 0;
195 
201  EQ_API uint32_t getColorFormat() const;
202 
204  EQ_API void setName(const std::string& name);
205 
207  EQ_API const std::string& getName() const;
208 
210  EQ_API int32_t getIAttribute(const WindowSettings::IAttribute attr) const;
211 
216  EQ_API const SystemWindow* getSharedContextWindow() const;
217 
218 private:
219  NotifierInterface& _parent;
220  WindowSettings _settings;
221 };
222 }
223 
224 #endif // EQ_SYSTEM_WINDOW_H
virtual util::FrameBufferObject * getFrameBufferObject()
Definition: systemWindow.h:124
virtual EQ_API void updateFrameBuffer() const =0
Update the window&#39;s FBO from the multisampled FBO.
EQ_API EventOCommand sendError(const uint32_t error)
Send a window error event to the application node.
EQ_API int32_t getIAttribute(const WindowSettings::IAttribute attr) const
EQ_API const SystemWindow * getSharedContextWindow() const
EQ_API const std::string & getName() const
A C++ class to abstract OpenGL frame buffer objects.
virtual EQ_API ~SystemWindow()
Destroy the SystemWindow.
virtual EQ_API void swapBuffers()=0
Swap the front and back buffer.
A set of settings to setup an eq::SystemWindow.
EQ_API void setName(const std::string &name)
Set the window&#39;s name.
EQ_API void setPixelViewport(const PixelViewport &pvp)
Set the window&#39;s pixel viewport wrt its parent pipe.
virtual EQ_API void joinNVSwapBarrier(const uint32_t group, const uint32_t barrier)=0
Join a NV_swap_group.
virtual EQ_API void bindDrawFrameBuffer() const =0
Bind the window&#39;s draw FBO, used for multisampling.
virtual const util::FrameBufferObject * getFrameBufferObject() const
Definition: systemWindow.h:119
virtual EQ_API void finish()=0
Finish execution of all commands.
EQ_API SystemWindow(NotifierInterface &parent, const WindowSettings &settings)
Create a new SystemWindow for the given eq::Window.
A base class for notifying errors and events.
EQ_API const PixelViewport & getPixelViewport() const
virtual EQ_API bool configInit()=0
Initialize this system window.
virtual EQ_API void configExit()=0
De-initialize this system window.
EQ_API bool processEvent(EventType type)
Process a stateless event.
virtual EQ_API void makeCurrent(const bool cache=true) const =0
Make the system window rendering context and drawable current.
The Equalizer client library.
Definition: eq/agl/types.h:23
virtual EQ_API void queryDrawableConfig(DrawableConfig &dc)=0
Set up the given drawable based on the current context.
The interface definition for system-specific windowing code.
Definition: systemWindow.h:35
virtual const GLEWContext * glewGetContext() const
Get the GLEW context for this window.
Definition: systemWindow.h:147
virtual EQ_API void resize(const PixelViewport &pvp)=0
Resize the underlying frame buffer to the given size.
virtual EQ_API void bindFrameBuffer() const =0
Bind the window&#39;s FBO, if it uses an FBO drawable.
virtual EQ_API void doneCurrent() const =0
This results in no context being current in the current thread.
virtual EQ_API void flush()=0
Flush all command buffers.