aglWindow.h

00001 
00002 /* Copyright (c) 2005-2009, Stefan Eilemann <eile@equalizergraphics.com>
00003                           , 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_OS_WINDOW_AGL_H
00020 #define EQ_OS_WINDOW_AGL_H
00021 
00022 #include <eq/client/glWindow.h>       // base class
00023 
00024 namespace eq
00025 {
00026     class AGLEventHandler;
00027     class AGLWindowEvent;
00028 
00030     class EQ_EXPORT AGLWindowIF : public GLWindow
00031     {
00032     public:
00034         AGLWindowIF( Window* parent ) : GLWindow( parent ) {}
00035 
00037         virtual ~AGLWindowIF() {}
00038 
00040         virtual AGLContext getAGLContext() const = 0;
00041 
00043         virtual WindowRef getCarbonWindow() const = 0;
00044 
00046         virtual AGLPbuffer getAGLPBuffer() const = 0;
00047 
00049         virtual bool processEvent( const AGLWindowEvent& event );
00050 
00051     private:
00052     };
00053 
00055     class EQ_EXPORT AGLWindow : public AGLWindowIF
00056     {
00057     public:
00059         AGLWindow( Window* parent );
00060 
00062         virtual ~AGLWindow( );
00063 
00064         virtual void configExit( );
00065         virtual void makeCurrent() const;
00066         virtual void swapBuffers();
00067         virtual void joinNVSwapBarrier( const uint32_t group,
00068                                         const uint32_t barrier );
00069 
00071         virtual AGLContext getAGLContext() const { return _aglContext; }
00072 
00074         virtual WindowRef getCarbonWindow() const { return _carbonWindow; }
00075 
00077         virtual AGLPbuffer getAGLPBuffer() const { return _aglPBuffer; }
00078 
00089         virtual void setAGLContext( AGLContext context );
00090 
00096         virtual void setCarbonWindow( WindowRef window );
00097         
00103         virtual void setAGLPBuffer( AGLPbuffer pbuffer );
00105 
00118         virtual bool configInit();
00119 
00131         virtual AGLPixelFormat chooseAGLPixelFormat();
00132 
00141         virtual void destroyAGLPixelFormat( AGLPixelFormat pixelFormat );
00142 
00154         virtual AGLContext createAGLContext( AGLPixelFormat pixelFormat );
00155 
00165         virtual bool configInitAGLDrawable();
00166 
00177         virtual bool configInitAGLFullscreen();
00178 
00189         virtual bool configInitAGLWindow();
00190 
00198         virtual bool configInitAGLPBuffer(); 
00199         
00201         virtual void initEventHandler();
00202 
00204         virtual void exitEventHandler();
00206 
00207         virtual bool processEvent( const AGLWindowEvent& event );
00208 
00209     private:
00211         AGLContext _aglContext;
00213         WindowRef _carbonWindow;
00215         AGLPbuffer _aglPBuffer;
00217         AGLEventHandler* _eventHandler;
00218 
00219         union // placeholder for binary-compatible changes
00220         {
00221             char dummy[64];
00222         };
00223     };
00224 }
00225 
00226 #endif // EQ_OS_WINDOW_AGL_H
00227 
Generated on Sat Feb 6 12:59:41 2010 for Equalizer 0.9.1 by  doxygen 1.6.1