Equalizer  1.4.1
include/eq/client/agl/window.h
00001 
00002 /* Copyright (c) 2005-2012, 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/defines.h>
00023 #ifdef AGL
00024 
00025 #include <eq/client/agl/types.h>
00026 #include <eq/client/glWindow.h>       // base class
00027 
00028 namespace eq
00029 {
00030 namespace agl
00031 {
00033     class WindowIF : public GLWindow
00034     {
00035     public:
00037         WindowIF( eq::Window* parent ) : GLWindow( parent ) {}
00038 
00040         virtual ~WindowIF() {}
00041 
00043         EQ_API virtual AGLContext getAGLContext() const = 0;
00044 
00046         EQ_API virtual WindowRef getCarbonWindow() const = 0;
00047 
00049         EQ_API virtual AGLPbuffer getAGLPBuffer() const = 0;
00050 
00052         EQ_API virtual bool processEvent( const WindowEvent& event ) = 0;
00053 
00054     private:
00055         struct Private;
00056         Private* _private; // placeholder for binary-compatible changes
00057     };
00058 
00060     class Window : public WindowIF
00061     {
00062     public:
00071         EQ_API Window( eq::Window* parent, CGDirectDisplayID displayID = 0 );
00072 
00074         EQ_API virtual ~Window();
00075 
00087         EQ_API virtual void setAGLContext( AGLContext context );
00088 
00095         EQ_API virtual void setCarbonWindow( WindowRef window );
00096         
00103         EQ_API virtual void setAGLPBuffer( AGLPbuffer pbuffer );
00104 
00106         virtual AGLContext getAGLContext() const { return _aglContext; }
00107 
00109         virtual WindowRef getCarbonWindow() const { return _carbonWindow; }
00110 
00112         virtual AGLPbuffer getAGLPBuffer() const { return _aglPBuffer; }
00113 
00115         CGDirectDisplayID getCGDisplayID() const { return _cgDisplayID; }
00117 
00131         EQ_API virtual bool configInit();
00132 
00134         EQ_API virtual void configExit( );
00135 
00148         EQ_API virtual AGLPixelFormat chooseAGLPixelFormat();
00149 
00159         EQ_API virtual void destroyAGLPixelFormat( AGLPixelFormat format );
00160 
00173         EQ_API virtual AGLContext createAGLContext( AGLPixelFormat format );
00174 
00185         EQ_API virtual bool configInitAGLDrawable();
00186 
00198         EQ_API virtual bool configInitAGLFullscreen();
00199 
00211         EQ_API virtual bool configInitAGLWindow();
00212 
00221         EQ_API virtual bool configInitAGLPBuffer(); 
00222         
00227         EQ_API virtual void initEventHandler();
00228 
00233         EQ_API virtual void exitEventHandler();
00235 
00239         EQ_API virtual void makeCurrent( const bool cache = true ) const;
00240 
00242         EQ_API virtual void swapBuffers();
00243 
00245         EQ_API virtual void joinNVSwapBarrier( const uint32_t group,
00246                                                const uint32_t barrier );
00247 
00249         EQ_API virtual bool processEvent( const WindowEvent& event );
00251 
00252     private:
00254         AGLContext _aglContext;
00255 
00257         WindowRef _carbonWindow;
00258 
00260         AGLPbuffer _aglPBuffer;
00261 
00263         EventHandler* _eventHandler;
00264 
00266         CGDirectDisplayID _cgDisplayID;
00267 
00268         struct Private;
00269         Private* _private; // placeholder for binary-compatible changes
00270 
00271         void _initSwapSync( AGLContext context );
00272     };
00273 }
00274 }
00275 #endif // AGL
00276 #endif // EQ_AGL_WINDOW_H
Generated on Mon Nov 26 2012 14:41:50 for Equalizer 1.4.1 by  doxygen 1.7.6.1