Equalizer
1.2.1
|
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_GLX_WINDOW_H 00020 #define EQ_GLX_OS_WINDOW_H 00021 00022 #include <eq/client/glx/types.h> 00023 #include <eq/client/glWindow.h> // base class 00024 00025 namespace eq 00026 { 00027 namespace glx 00028 { 00030 class WindowIF : public GLWindow 00031 { 00032 public: 00033 WindowIF( eq::Window* parent ) : GLWindow( parent ) {} 00034 virtual ~WindowIF() {} 00035 00037 virtual GLXContext getGLXContext() const = 0; 00038 00040 virtual XID getXDrawable() const = 0; 00041 00043 virtual Display* getXDisplay() = 0; 00044 }; 00045 00047 class Window : public WindowIF 00048 { 00049 public: 00058 Window( eq::Window* parent, Display* xDisplay = 0, 00059 GLXEWContext* glxewContext = 0 ); 00060 00062 virtual ~Window(); 00063 00076 virtual bool configInit(); 00077 00079 virtual void configExit(); 00080 00089 virtual GLXFBConfig* chooseGLXFBConfig(); 00090 00100 virtual GLXContext createGLXContext( GLXFBConfig* fbConfig ); 00101 00112 virtual bool configInitGLXDrawable( GLXFBConfig* fbConfig ); 00113 00123 virtual bool configInitGLXWindow( GLXFBConfig* fbConfig ); 00124 00134 virtual bool configInitGLXPBuffer( GLXFBConfig* fbConfig ); 00135 00140 EQ_API virtual void initEventHandler(); 00141 00146 EQ_API virtual void exitEventHandler(); 00148 00152 virtual GLXContext getGLXContext() const { return _glXContext; } 00153 00155 virtual XID getXDrawable() const { return _xDrawable; } 00156 00158 virtual Display* getXDisplay() { return _xDisplay; } 00159 00161 GLXEWContext* glxewGetContext() { return _glxewContext; } 00162 00172 virtual void setXDrawable( XID drawable ); 00173 00184 virtual void setGLXContext( GLXContext context ); 00186 00190 virtual void makeCurrent() const; 00191 00193 virtual void swapBuffers(); 00194 00196 virtual void joinNVSwapBarrier( const uint32_t group, 00197 const uint32_t barrier ); 00198 00200 void leaveNVSwapBarrier(); 00202 00203 private: 00205 Display* _xDisplay; 00207 XID _xDrawable; 00209 GLXContext _glXContext; 00211 uint32_t _glXNVSwapGroup; 00212 00214 EventHandler* _glXEventHandler; 00215 00217 GLXEWContext* _glxewContext; 00218 00219 struct Private; 00220 Private* _private; // placeholder for binary-compatible changes 00221 00223 XID _createGLXWindow( GLXFBConfig* fbConfig, const PixelViewport& pvp ); 00224 00226 void _initSwapSync(); 00227 }; 00228 } 00229 } 00230 #endif // EQ_GLX_OS_WINDOW_H 00231