glXWindow.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EQ_OS_WINDOW_GLX_H
00020 #define EQ_OS_WINDOW_GLX_H
00021
00022 #include <eq/client/osWindow.h>
00023 #include <eq/client/glXWindowEvent.h>
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
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