Equalizer 1.0
|
00001 00002 /* Copyright (c) 2005-2011, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 2009, 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_OS_WINDOW_GLX_H 00020 #define EQ_OS_WINDOW_GLX_H 00021 00022 #include <eq/glWindow.h> // base class 00023 00024 namespace eq 00025 { 00027 class GLXWindowIF : public GLWindow 00028 { 00029 public: 00030 GLXWindowIF( Window* parent ) : GLWindow( parent ) {} 00031 virtual ~GLXWindowIF() {} 00032 00034 virtual GLXContext getGLXContext() const = 0; 00035 00037 virtual XID getXDrawable() const = 0; 00038 00040 virtual Display* getXDisplay() = 0; 00041 }; 00042 00044 class GLXWindow : public GLXWindowIF 00045 { 00046 public: 00055 GLXWindow( Window* parent, Display* xDisplay = 0, 00056 GLXEWContext* glxewContext = 0 ); 00057 00059 virtual ~GLXWindow(); 00060 00073 virtual bool configInit(); 00074 00076 virtual void configExit(); 00077 00086 virtual GLXFBConfig* chooseGLXFBConfig(); 00087 00097 virtual GLXContext createGLXContext( GLXFBConfig* fbConfig ); 00098 00109 virtual bool configInitGLXDrawable( GLXFBConfig* fbConfig ); 00110 00120 virtual bool configInitGLXWindow( GLXFBConfig* fbConfig ); 00121 00131 virtual bool configInitGLXPBuffer( GLXFBConfig* fbConfig ); 00132 00137 EQ_API virtual void initEventHandler(); 00138 00143 EQ_API virtual void exitEventHandler(); 00145 00149 virtual GLXContext getGLXContext() const { return _glXContext; } 00150 00152 virtual XID getXDrawable() const { return _xDrawable; } 00153 00155 virtual Display* getXDisplay() { return _xDisplay; } 00156 00158 GLXEWContext* glxewGetContext() { return _glxewContext; } 00159 00169 virtual void setXDrawable( XID drawable ); 00170 00181 virtual void setGLXContext( GLXContext context ); 00183 00187 virtual void makeCurrent() const; 00188 00190 virtual void swapBuffers(); 00191 00193 virtual void joinNVSwapBarrier( const uint32_t group, 00194 const uint32_t barrier ); 00195 00197 void leaveNVSwapBarrier(); 00199 00200 private: 00202 Display* _xDisplay; 00204 XID _xDrawable; 00206 GLXContext _glXContext; 00208 uint32_t _glXNVSwapGroup; 00209 00211 GLXEventHandler* _glXEventHandler; 00212 00214 GLXEWContext* _glxewContext; 00215 00216 struct Private; 00217 Private* _private; // placeholder for binary-compatible changes 00218 00220 XID _createGLXWindow( GLXFBConfig* fbConfig, const PixelViewport& pvp ); 00221 }; 00222 } 00223 00224 #endif // EQ_OS_WINDOW_GLX_H 00225