Equalizer  1.10.1
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
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 
50  EQ_API void doneCurrent() const override;
51 
56  EQ_API bool isCurrent() const;
57 
61  EQ_API void bindFrameBuffer() const override;
62 
64  EQ_API void bindDrawFrameBuffer() const override;
65 
67  EQ_API void updateFrameBuffer() const override;
68 
70  EQ_API void flush() override;
71 
73  EQ_API void finish() override;
74 
76  EQ_API virtual bool configInitFBO();
77 
79  EQ_API virtual void configExitFBO();
80 
82  EQ_API const util::FrameBufferObject* getFrameBufferObject() const override;
83 
87 
89  EQ_API virtual void initGLEW();
90 
92  EQ_API virtual void exitGLEW();
93 
107  EQ_API const GLEWContext* glewGetContext() const override;
108 
113  EQ_API void queryDrawableConfig( DrawableConfig& ) override;
114 
115 private:
116  GLWindow( const GLWindow& ) = delete;
117  GLWindow& operator=( const GLWindow& ) = delete;
118  bool _createFBO( util::FrameBufferObject*& fbo, const int samplesSize );
119  void _destroyFBO( util::FrameBufferObject*& fbo );
120 
121  detail::GLWindow* const _impl;
122 
123  GLEWContext* glewGetContext();
124 };
125 }
126 
127 
128 #endif // EQ_GL_WINDOW_H
129 
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.
EQ_API void doneCurrent() const override
Unbind the FBO and remove context from current cache.
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.