osWindow.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_H
00020 #define EQ_OS_WINDOW_H
00021 
00022 #include <eq/client/types.h>
00023 #include <eq/client/window.h>         // Window::IAttribute enum
00024 #include <eq/client/windowSystem.h>   // GLEWContext
00025 
00026 namespace eq
00027 {
00028     class FrameBufferObject;
00029 
00037     class EQ_EXPORT OSWindow
00038     {
00039     public:
00040         OSWindow( Window* parent );
00041         virtual ~OSWindow( );
00042         
00054         virtual bool configInit( ) = 0;
00055 
00062         virtual void configExit( ) = 0;
00063 
00071         virtual void makeCurrent() const;
00072 
00074         virtual void bindFrameBuffer() const;
00075 
00077         virtual void swapBuffers() = 0;
00078 
00088         virtual void joinNVSwapBarrier( const uint32_t group,
00089                                         const uint32_t barrier ) = 0;
00091 
00095         bool configInitFBO();
00096 
00098         void configExitFBO();
00099 
00101         const FrameBufferObject* getFBO() const { return _fbo; }
00103 
00106         Window* getWindow() { return _window; }
00107         const Window* getWindow() const { return _window; }
00108 
00109         Pipe* getPipe(); 
00110         const Pipe* getPipe() const;
00111 
00112         Node* getNode(); 
00113         const Node* getNode() const;
00114 
00115         Config* getConfig();
00116         const Config* getConfig() const;
00117 
00118         int32_t getIAttribute( const Window::IAttribute attr ) const;
00119 
00121         WGLEWContext* wglewGetContext();
00123      
00125         void initGLEW(); 
00126         
00128         void exitGLEW() { _glewInitialized = false; }
00129 
00143         GLEWContext* glewGetContext() { return _glewContext; }
00144         const GLEWContext* glewGetContext() const { return _glewContext; }
00145 
00146     protected:
00148         Window* const _window;
00149         
00150     private:
00152         GLEWContext*   _glewContext; 
00153         
00154         bool _glewInitialized ;
00155         
00157         FrameBufferObject* _fbo; 
00158 
00159         union // placeholder for binary-compatible changes
00160         {
00161             char dummy[64];
00162         };
00163     };
00164 }
00165 
00166 
00167 #endif // EQ_OS_WINDOW_H
00168 
Generated on Mon Aug 10 18:58:40 2009 for Equalizer 0.9 by  doxygen 1.5.8