Equalizer  1.8.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
include/eq/client/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/client/os.h>
24 
25 #ifdef AGL
26 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
27 
28 #include <eq/client/agl/types.h>
29 #include <eq/client/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 virtual bool configInit();
150 
152  EQ_API virtual void configExit( );
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 virtual void makeCurrent( const bool cache = true ) const;
258 
260  EQ_API virtual void swapBuffers();
261 
263  EQ_API virtual void joinNVSwapBarrier( const uint32_t group,
264  const uint32_t barrier );
265 
267  EQ_API virtual bool processEvent( const WindowEvent& event );
269 
270 private:
271  detail::Window* const _impl;
272 
273  void _initSwapSync( AGLContext context );
274 };
275 }
276 }
277 #endif // AGL
278 #endif // EQ_AGL_WINDOW_H
Includes operating system headers for OpenGL and the used window system(s) correctly.