Equalizer  1.9.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
glWindow.h
1 
2 /* Copyright (c) 2005-2015, Stefan Eilemann <eile@equalizergraphics.com>
3  * Daniel Nachbaur <danielnachbaur@gmail.com>
4  * Makhinya Maxim
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef EQ_GL_WINDOW_H
21 #define EQ_GL_WINDOW_H
22 
23 #include <eq/systemWindow.h> // base class
24 
25 namespace eq
26 {
27 namespace detail { class GLWindow; }
28 
36 class GLWindow : public SystemWindow, public boost::noncopyable
37 {
38 public:
40  EQ_API GLWindow( NotifierInterface& parent,
41  const WindowSettings& settings );
42 
44  EQ_API virtual ~GLWindow();
45 
47  EQ_API void makeCurrent( const bool cache = true ) const override;
48 
53  EQ_API bool isCurrent() const;
54 
58  EQ_API void bindFrameBuffer() const override;
59 
61  EQ_API void bindDrawFrameBuffer() const override;
62 
64  EQ_API void updateFrameBuffer() const override;
65 
67  EQ_API void flush() override;
68 
70  EQ_API void finish() override;
71 
73  EQ_API virtual bool configInitFBO();
74 
76  EQ_API virtual void configExitFBO();
77 
79  EQ_API const util::FrameBufferObject* getFrameBufferObject() const override;
80 
84 
86  EQ_API virtual void initGLEW();
87 
89  EQ_API virtual void exitGLEW();
90 
104  EQ_API const GLEWContext* glewGetContext() const override;
105 
110  EQ_API void queryDrawableConfig( DrawableConfig& ) override;
111 
112 private:
113  bool _createFBO( util::FrameBufferObject*& fbo, const int samplesSize );
114  void _destroyFBO( util::FrameBufferObject*& fbo );
115 
116  detail::GLWindow* const _impl;
117 
118  GLEWContext* glewGetContext();
119 };
120 }
121 
122 
123 #endif // EQ_GL_WINDOW_H
124 
virtual EQ_API void exitGLEW()
De-initialize the GLEW context.
virtual EQ_API void configExitFBO()
Destroy the FBO.
A C++ class to abstract OpenGL frame buffer objects.
EQ_API void makeCurrent(const bool cache=true) const override
Bind the FBO and update the current cache.
EQ_API void bindFrameBuffer() const override
Bind the window's FBO, if it uses an FBO drawable.
virtual EQ_API ~GLWindow()
Destruct a new OpenGL window.
A set of settings to setup an eq::SystemWindow.
EQ_API bool isCurrent() const
EQ_API void updateFrameBuffer() const override
Update the window's FBO from the multisampled FBO.
EQ_API void flush() override
Flush all command buffers.
EQ_API GLWindow(NotifierInterface &parent, const WindowSettings &settings)
Construct a new OpenGL window.
EQ_API void bindDrawFrameBuffer() const override
Bind the window's draw FBO, used for multisampling.
EQ_API void finish() override
Finish execution of all commands.
A system window for OpenGL rendering.
Definition: glWindow.h:36
EQ_API const util::FrameBufferObject * getFrameBufferObject() const override
A base class for notifying errors and events.
The interface definition for system-specific windowing code.
Definition: systemWindow.h:35
EQ_API const GLEWContext * glewGetContext() const override
Get the GLEW context for this window.
EQ_API void queryDrawableConfig(DrawableConfig &) override
Set up the drawable config by querying the current context.
virtual EQ_API void initGLEW()
Initialize the GLEW context for this window.
virtual EQ_API bool configInitFBO()
Build and initialize the FBO.