Equalizer  1.12.0
Parallel Rendering Framework
agl/window.h
1 
2 /* Copyright (c) 2005-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2010, Maxim Makhinya
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQ_AGL_WINDOW_H
20 #define EQ_AGL_WINDOW_H
21 
22 #include <eq/defines.h>
23 #include <eq/os.h>
24 
25 #ifdef AGL
26 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
27 
28 #include <eq/agl/types.h>
29 #include <eq/glWindow.h> // base class
30 
31 namespace eq
32 {
33 namespace agl
34 {
35 namespace detail { class Window; }
36 
38 class WindowIF : public GLWindow
39 {
40 public:
42  WindowIF( NotifierInterface& parent, const WindowSettings& settings )
43  : GLWindow( parent, settings ) {}
44 
46  virtual ~WindowIF() {}
47 
49  virtual AGLContext getAGLContext() const = 0;
50 
52  virtual WindowRef getCarbonWindow() const = 0;
53 
55  virtual AGLPbuffer getAGLPBuffer() const = 0;
56 
61  virtual bool isThreaded() const { return false; }
62 
63 # pragma clang diagnostic push
64 # pragma clang diagnostic ignored "-Woverloaded-virtual"
65 
66  EQ_API virtual bool processEvent( const WindowEvent& event ) = 0;
67 # pragma clang diagnostic pop
68 };
69 
71 class Window : public WindowIF
72 {
73 public:
82  EQ_API Window( NotifierInterface& parent, const WindowSettings& settings,
83  const CGDirectDisplayID displayID, const bool threaded );
84 
86  EQ_API virtual ~Window();
87 
99  EQ_API virtual void setAGLContext( AGLContext context );
100 
107  EQ_API virtual void setCarbonWindow( WindowRef window );
108 
115  EQ_API virtual void setAGLPBuffer( AGLPbuffer pbuffer );
116 
118  EQ_API AGLContext getAGLContext() const override;
119 
121  EQ_API WindowRef getCarbonWindow() const override;
122 
124  EQ_API AGLPbuffer getAGLPBuffer() const override;
125 
130  EQ_API bool isThreaded() const override;
131 
133  CGDirectDisplayID getCGDisplayID() const;
135 
149  EQ_API bool configInit() override;
150 
152  EQ_API void configExit() override;
153 
166  EQ_API virtual AGLPixelFormat chooseAGLPixelFormat();
167 
177  EQ_API virtual void destroyAGLPixelFormat( AGLPixelFormat format );
178 
191  EQ_API virtual AGLContext createAGLContext( AGLPixelFormat format );
192 
203  EQ_API virtual bool configInitAGLDrawable();
204 
216  EQ_API virtual bool configInitAGLFullscreen();
217 
229  EQ_API virtual bool configInitAGLWindow();
230 
239  EQ_API virtual bool configInitAGLPBuffer();
240 
245  EQ_API virtual void initEventHandler();
246 
251  EQ_API virtual void exitEventHandler();
253 
257  EQ_API void makeCurrent( const bool cache = true ) const override;
258 
260  EQ_API void doneCurrent() const override;
261 
263  EQ_API void swapBuffers() override;
264 
266  EQ_API void joinNVSwapBarrier( const uint32_t group,
267  const uint32_t barrier ) override;
268 
270  EQ_API bool processEvent( const WindowEvent& event ) override;
272 
273 private:
274  detail::Window* const _impl;
275 
276  void _initSwapSync( AGLContext context );
277 };
278 }
279 }
280 #endif // AGL
281 #endif // EQ_AGL_WINDOW_H
Includes compile-time defines of Equalizer.
Includes operating system headers for OpenGL and the used window system(s) correctly.
The Equalizer client library.
Definition: eq/agl/types.h:23