glXWindow.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_GLX_H
00020 #define EQ_OS_WINDOW_GLX_H
00021 
00022 #include <eq/client/osWindow.h>       // base class
00023 #include <eq/client/glXWindowEvent.h> // used in inline method
00024 
00025 namespace eq
00026 {
00028     class EQ_EXPORT GLXWindowIF : public OSWindow
00029     {
00030     public:
00031         GLXWindowIF( Window* parent ) : OSWindow( parent ) {}
00032         virtual ~GLXWindowIF() {}
00033 
00035         virtual GLXContext getGLXContext() const = 0;
00036 
00038         virtual XID getXDrawable() const = 0;
00039 
00040         virtual bool processEvent( const GLXWindowEvent& event )
00041             { return _window->processEvent( event ); }
00042 
00044         virtual Display* getXDisplay() = 0;
00045         virtual Display* getXDisplay() const = 0;
00046     };
00047 
00049     class EQ_EXPORT GLXWindow : public GLXWindowIF
00050     {
00051     public:
00052         GLXWindow( Window* parent );
00053         virtual ~GLXWindow( );
00054 
00055         virtual void configExit( );
00056         virtual void makeCurrent() const;
00057         virtual void swapBuffers();
00058         virtual void joinNVSwapBarrier( const uint32_t group,
00059                                         const uint32_t barrier );
00060 
00072         virtual bool configInit();
00073 
00075         virtual GLXContext getGLXContext() const { return _glXContext; }
00076 
00078         virtual XID getXDrawable() const { return _xDrawable; }
00079 
00081         virtual Display* getXDisplay();
00082         virtual Display* getXDisplay() const;
00084 
00085     protected:
00093         virtual XVisualInfo* chooseXVisualInfo();
00094 
00103         virtual GLXContext createGLXContext( XVisualInfo* visualInfo );
00104 
00114         virtual bool configInitGLXDrawable( XVisualInfo* visualInfo );
00115         
00124         virtual bool configInitGLXWindow( XVisualInfo* visualInfo );
00125 
00134         virtual bool configInitGLXPBuffer( XVisualInfo* visualInfo );
00136 
00147         virtual void setXDrawable( XID drawable );
00148 
00158         virtual void setGLXContext( GLXContext context );
00160 
00162         bool joinNVSwapBarrier();
00163 
00165         void leaveNVSwapBarrier();
00166 
00167     private:
00169         XID        _xDrawable;
00171         GLXContext _glXContext;
00173         uint32_t _glXNVSwapGroup;
00174 
00175         union // placeholder for binary-compatible changes
00176         {
00177             char dummy[64];
00178         };
00179 
00181         XID _createGLXWindow( XVisualInfo* visualInfo , 
00182                               const PixelViewport& pvp );
00183     };
00184 }
00185 
00186 #endif // EQ_OS_WINDOW_GLX_H
00187 
Generated on Mon Aug 10 18:58:39 2009 for Equalizer 0.9 by  doxygen 1.5.8