Equalizer  1.9.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
qt/window.h
1 
2 /* Copyright (c) 2014, Daniel Nachbaur <danielnachbaur@gmail.com>
3  * 2014, Stefan.Eilemann@epfl.ch
4  * 2015, Juan Hernando <jhernando@fi.upm.es>
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_QT_WINDOW_H
21 #define EQ_QT_WINDOW_H
22 
23 #include <eq/qt/types.h>
24 #include <eq/glWindow.h> // base class
25 
26 #include <QtGlobal>
27 
28 namespace eq
29 {
30 namespace qt
31 {
32 namespace detail { class Window; }
33 
35 class WindowIF : public GLWindow
36 {
37 public:
38  WindowIF( NotifierInterface& parent,
39  const WindowSettings& settings ) : GLWindow( parent, settings ) {}
40  ~WindowIF() override {}
41 
42 # pragma clang diagnostic push
43 # pragma clang diagnostic ignored "-Woverloaded-virtual"
44 
45  virtual bool processEvent( const WindowEvent& event ) = 0;
46 # pragma clang diagnostic pop
47 };
48 
50 class Window : public WindowIF
51 {
52 public:
68  EQ_API Window( NotifierInterface& parent, const WindowSettings& settings,
69  QOpenGLContext* shareContext = 0 );
70 
72  EQ_API ~Window() final;
73 
85  EQ_API bool configInit() override;
86 
88  EQ_API void configExit() override;
89 
91 
98  EQ_API QOpenGLContext* getContext() const;
99 
103  EQ_API void makeCurrent( const bool cache = true ) const override;
104 
106  EQ_API void swapBuffers() override;
107 
109  EQ_API void joinNVSwapBarrier( const uint32_t group,
110  const uint32_t barrier ) override;
111 
113  EQ_API void leaveNVSwapBarrier();
114 
116  EQ_API bool processEvent( const WindowEvent& event ) override;
118 
130  EQ_API QObject* getEventProcessor();
131 
132 private:
133  detail::Window* const _impl;
134 };
135 }
136 }
137 #endif // EQ_QT_WINDOW_H
EQ_API ~Window() final
Destruct this Qt window.
EQ_API void swapBuffers() override
EQ_API bool processEvent(const WindowEvent &event) override
EQ_API void leaveNVSwapBarrier()
Implementation untested for Qt.
EQ_API void makeCurrent(const bool cache=true) const override
EQ_API void configExit() override
virtual bool processEvent(const WindowEvent &event)=0
Process the given event.
EQ_API bool configInit() override
Initialize this window for the Qt window system.
A set of settings to setup an eq::SystemWindow.
The interface defining the minimum functionality for a Qt window.
Definition: qt/window.h:35
Equalizer default implementation of a Qt window.
Definition: qt/window.h:50
EQ_API void joinNVSwapBarrier(const uint32_t group, const uint32_t barrier) override
Implementation untested for Qt.
EQ_API GLWindow(NotifierInterface &parent, const WindowSettings &settings)
Construct a new OpenGL window.
A system window for OpenGL rendering.
Definition: glWindow.h:36
EQ_API QOpenGLContext * getContext() const
The context won't be ready to be used until configInit is called.
EQ_API Window(NotifierInterface &parent, const WindowSettings &settings, QOpenGLContext *shareContext=0)
Create a new window using Qt.
A base class for notifying errors and events.
A window-system event for a qt::WindowIF.
EQ_API QObject * getEventProcessor()
Use this object to make Qt events reach eq::Config when using this window for offscreen rendering wit...