Equalizer 1.1.3-git
client/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/client/aglTypes.h>
00023 #include <eq/client/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; }
00111 
00113         CGDirectDisplayID getCGDisplayID() const { return _cgDisplayID; }
00115 
00129         EQ_API virtual bool configInit();
00130 
00132         EQ_API virtual void configExit( );
00133 
00146         EQ_API virtual AGLPixelFormat chooseAGLPixelFormat();
00147 
00157         EQ_API virtual void destroyAGLPixelFormat( AGLPixelFormat format );
00158 
00171         EQ_API virtual AGLContext createAGLContext( AGLPixelFormat format );
00172 
00183         EQ_API virtual bool configInitAGLDrawable();
00184 
00196         EQ_API virtual bool configInitAGLFullscreen();
00197 
00209         EQ_API virtual bool configInitAGLWindow();
00210 
00219         EQ_API virtual bool configInitAGLPBuffer(); 
00220         
00225         EQ_API virtual void initEventHandler();
00226 
00231         EQ_API virtual void exitEventHandler();
00233 
00237         EQ_API virtual void makeCurrent() const;
00238 
00240         EQ_API virtual void swapBuffers();
00241 
00243         EQ_API virtual void joinNVSwapBarrier( const uint32_t group,
00244                                                const uint32_t barrier );
00245 
00247         EQ_API virtual bool processEvent( const AGLWindowEvent& event );
00249 
00250     private:
00252         AGLContext _aglContext;
00253 
00255         WindowRef _carbonWindow;
00256 
00258         AGLPbuffer _aglPBuffer;
00259 
00261         AGLEventHandler* _eventHandler;
00262 
00264         CGDirectDisplayID _cgDisplayID;
00265 
00266         struct Private;
00267         Private* _private; // placeholder for binary-compatible changes
00268     };
00269 }
00270 
00271 #endif // EQ_AGL_WINDOW_H
00272 
Generated on Sat Aug 27 2011 15:19:25 for Equalizer 1.1.3-git by  doxygen 1.7.4