Equalizer
1.2.1
|
00001 00002 /* Copyright (c) 2005-2011, Stefan Eilemann <eile@equalizergraphics.com> 00003 2010, Maxim Makhinya 00004 * 00005 * This library is free software; you can redistribute it and/or modify it under 00006 * the terms of the GNU Lesser General Public License version 2.1 as published 00007 * by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, but WITHOUT 00010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00012 * details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with this library; if not, write to the Free Software Foundation, Inc., 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00017 */ 00018 00019 #ifndef EQ_AGL_WINDOW_H 00020 #define EQ_AGL_WINDOW_H 00021 00022 #include <eq/client/agl/types.h> 00023 #include <eq/client/glWindow.h> // base class 00024 00025 namespace eq 00026 { 00027 namespace agl 00028 { 00030 class WindowIF : public GLWindow 00031 { 00032 public: 00034 WindowIF( eq::Window* parent ) : GLWindow( parent ) {} 00035 00037 virtual ~WindowIF() {} 00038 00040 EQ_API virtual AGLContext getAGLContext() const = 0; 00041 00043 EQ_API virtual WindowRef getCarbonWindow() const = 0; 00044 00046 EQ_API virtual AGLPbuffer getAGLPBuffer() const = 0; 00047 00049 EQ_API virtual bool processEvent( const WindowEvent& event ) = 0; 00050 00051 private: 00052 struct Private; 00053 Private* _private; // placeholder for binary-compatible changes 00054 }; 00055 00057 class Window : public WindowIF 00058 { 00059 public: 00068 EQ_API Window( eq::Window* parent, CGDirectDisplayID displayID = 0 ); 00069 00071 EQ_API virtual ~Window(); 00072 00084 EQ_API virtual void setAGLContext( AGLContext context ); 00085 00092 EQ_API virtual void setCarbonWindow( WindowRef window ); 00093 00100 EQ_API virtual void setAGLPBuffer( AGLPbuffer pbuffer ); 00101 00103 virtual AGLContext getAGLContext() const { return _aglContext; } 00104 00106 virtual WindowRef getCarbonWindow() const { return _carbonWindow; } 00107 00109 virtual AGLPbuffer getAGLPBuffer() const { return _aglPBuffer; } 00110 00112 CGDirectDisplayID getCGDisplayID() const { return _cgDisplayID; } 00114 00128 EQ_API virtual bool configInit(); 00129 00131 EQ_API virtual void configExit( ); 00132 00145 EQ_API virtual AGLPixelFormat chooseAGLPixelFormat(); 00146 00156 EQ_API virtual void destroyAGLPixelFormat( AGLPixelFormat format ); 00157 00170 EQ_API virtual AGLContext createAGLContext( AGLPixelFormat format ); 00171 00182 EQ_API virtual bool configInitAGLDrawable(); 00183 00195 EQ_API virtual bool configInitAGLFullscreen(); 00196 00208 EQ_API virtual bool configInitAGLWindow(); 00209 00218 EQ_API virtual bool configInitAGLPBuffer(); 00219 00224 EQ_API virtual void initEventHandler(); 00225 00230 EQ_API virtual void exitEventHandler(); 00232 00236 EQ_API virtual void makeCurrent() const; 00237 00239 EQ_API virtual void swapBuffers(); 00240 00242 EQ_API virtual void joinNVSwapBarrier( const uint32_t group, 00243 const uint32_t barrier ); 00244 00246 EQ_API virtual bool processEvent( const WindowEvent& event ); 00248 00249 private: 00251 AGLContext _aglContext; 00252 00254 WindowRef _carbonWindow; 00255 00257 AGLPbuffer _aglPBuffer; 00258 00260 EventHandler* _eventHandler; 00261 00263 CGDirectDisplayID _cgDisplayID; 00264 00265 struct Private; 00266 Private* _private; // placeholder for binary-compatible changes 00267 }; 00268 } 00269 } 00270 #endif // EQ_AGL_WINDOW_H 00271