Equalizer 1.0

aglWindow.h

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/aglTypes.h>
00023 #include <eq/glWindow.h>       // base class
00024 
00025 namespace eq
00026 {
00027     class AGLEventHandler;
00028     class AGLWindowEvent;
00029 
00031     class AGLWindowIF : public GLWindow
00032     {
00033     public:
00035         AGLWindowIF( Window* parent ) : GLWindow( parent ) {}
00036 
00038         virtual ~AGLWindowIF() {}
00039 
00041         EQ_API virtual AGLContext getAGLContext() const = 0;
00042 
00044         EQ_API virtual WindowRef getCarbonWindow() const = 0;
00045 
00047         EQ_API virtual AGLPbuffer getAGLPBuffer() const = 0;
00048 
00050         EQ_API virtual bool processEvent( const AGLWindowEvent& event ) = 0;
00051 
00052     private:
00053         struct Private;
00054         Private* _private; // placeholder for binary-compatible changes
00055     };
00056 
00058     class AGLWindow : public AGLWindowIF
00059     {
00060     public:
00069         EQ_API AGLWindow( Window* parent, CGDirectDisplayID displayID = 0 );
00070 
00072         EQ_API virtual ~AGLWindow();
00073 
00085         EQ_API virtual void setAGLContext( AGLContext context );
00086 
00093         EQ_API virtual void setCarbonWindow( WindowRef window );
00094         
00101         EQ_API virtual void setAGLPBuffer( AGLPbuffer pbuffer );
00102 
00104         virtual AGLContext getAGLContext() const { return _aglContext; }
00105 
00107         virtual WindowRef getCarbonWindow() const { return _carbonWindow; }
00108 
00110         virtual AGLPbuffer getAGLPBuffer() const { return _aglPBuffer; }
00112 
00126         EQ_API virtual bool configInit();
00127 
00129         EQ_API virtual void configExit( );
00130 
00143         EQ_API virtual AGLPixelFormat chooseAGLPixelFormat();
00144 
00154         EQ_API virtual void destroyAGLPixelFormat( AGLPixelFormat format );
00155 
00168         EQ_API virtual AGLContext createAGLContext( AGLPixelFormat format );
00169 
00180         EQ_API virtual bool configInitAGLDrawable();
00181 
00193         EQ_API virtual bool configInitAGLFullscreen();
00194 
00206         EQ_API virtual bool configInitAGLWindow();
00207 
00216         EQ_API virtual bool configInitAGLPBuffer(); 
00217         
00222         EQ_API virtual void initEventHandler();
00223 
00228         EQ_API virtual void exitEventHandler();
00230 
00234         EQ_API virtual void makeCurrent() const;
00235 
00237         EQ_API virtual void swapBuffers();
00238 
00240         EQ_API virtual void joinNVSwapBarrier( const uint32_t group,
00241                                                const uint32_t barrier );
00242 
00244         EQ_API virtual bool processEvent( const AGLWindowEvent& event );
00246 
00247     private:
00249         AGLContext _aglContext;
00250 
00252         WindowRef _carbonWindow;
00253 
00255         AGLPbuffer _aglPBuffer;
00256 
00258         AGLEventHandler* _eventHandler;
00259 
00261         CGDirectDisplayID _cgDisplayID;
00262 
00263         struct Private;
00264         Private* _private; // placeholder for binary-compatible changes
00265     };
00266 }
00267 
00268 #endif // EQ_AGL_WINDOW_H
00269 
Generated on Sun May 8 2011 19:11:04 for Equalizer 1.0 by  doxygen 1.7.3