aglWindow.h

00001 
00002 /* Copyright (c) 2005-2009, Stefan Eilemann <eile@equalizergraphics.com>
00003                           , Makhinya Maxim
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/osWindow.h>       // base class
00023 
00024 namespace eq
00025 {
00026     class AGLEventHandler;
00027     class AGLWindowEvent;
00028 
00030     class EQ_EXPORT AGLWindowIF : public OSWindow
00031     {
00032     public:
00033         AGLWindowIF( Window* parent ) : OSWindow( parent ) {}
00034         virtual ~AGLWindowIF() {}
00035 
00037         virtual AGLContext getAGLContext() const = 0;
00038 
00040         virtual WindowRef getCarbonWindow() const = 0;
00041 
00043         virtual AGLPbuffer getAGLPBuffer() const = 0;
00044 
00046         virtual bool processEvent( const AGLWindowEvent& event );
00047 
00048     private:
00049     };
00050 
00052     class EQ_EXPORT AGLWindow : public AGLWindowIF
00053     {
00054     public:
00055         AGLWindow( Window* parent );
00056         virtual ~AGLWindow( );
00057 
00058         virtual void configExit( );
00059         virtual void makeCurrent() const;
00060         virtual void swapBuffers();
00061         virtual void joinNVSwapBarrier( const uint32_t group,
00062                                         const uint32_t barrier );
00063 
00065         virtual AGLContext getAGLContext() const { return _aglContext; }
00066 
00068         virtual WindowRef getCarbonWindow() const { return _carbonWindow; }
00069 
00071         virtual AGLPbuffer getAGLPBuffer() const { return _aglPBuffer; }
00072 
00084         virtual void setAGLContext( AGLContext context );
00085 
00091         virtual void setCarbonWindow( WindowRef window );
00092         
00098         virtual void setAGLPBuffer( AGLPbuffer pbuffer );
00100 
00113         virtual bool configInit();
00114 
00126         virtual AGLPixelFormat chooseAGLPixelFormat();
00127 
00136         virtual void destroyAGLPixelFormat( AGLPixelFormat pixelFormat );
00137 
00149         virtual AGLContext createAGLContext( AGLPixelFormat pixelFormat );
00150 
00160         virtual bool configInitAGLDrawable();
00161 
00172         virtual bool configInitAGLFullscreen();
00173 
00184         virtual bool configInitAGLWindow();
00185 
00193         virtual bool configInitAGLPBuffer(); 
00194 
00195         virtual void initEventHandler();
00196         virtual void exitEventHandler();
00198 
00199         virtual bool processEvent( const AGLWindowEvent& event );
00200 
00201     private:
00203         AGLContext _aglContext;
00205         WindowRef _carbonWindow;
00207         AGLPbuffer _aglPBuffer;
00209         AGLEventHandler* _eventHandler;
00210 
00211         union // placeholder for binary-compatible changes
00212         {
00213             char dummy[64];
00214         };
00215     };
00216 }
00217 
00218 #endif // EQ_OS_WINDOW_AGL_H
00219 
Generated on Mon Aug 10 18:58:31 2009 for Equalizer 0.9 by  doxygen 1.5.8