Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Framebuffer.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2016 "Omnidome" by cr8tr
2  * Dome Mapping Projection Software (http://omnido.me).
3  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4  *
5  * This file is part of Omnidome.
6  *
7  * Omnidome is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Affero General Public License for more details.
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OMNI_INPUT_FRAMEBUFFER_H_
21 #define OMNI_INPUT_FRAMEBUFFER_H_
22 
23 #include <QOpenGLFramebufferObject>
24 #include <omni/input/Interface.h>
26 
27 namespace omni {
28  namespace input {
29  /// Input object that is renderer to a framebuffer
30  class Framebuffer : public input::Interface {
31  public:
32  Framebuffer(input::Interface const* = nullptr);
33  virtual ~Framebuffer() {};
34 
35  virtual QSize size() const;
36  virtual void setSize(QSize const&);
37 
38  GLuint textureId() const;
39 
40  virtual void destroy();
41 
42  virtual void toPropertyMap(PropertyMap&) const;
43  virtual void fromPropertyMap(PropertyMap const&);
44 
45  protected:
46  QOpenGLFramebufferObject* framebuffer();
47  QOpenGLFramebufferObject const* framebuffer() const;
48 
49  void setupFramebuffer(QSize const& _size);
50  void setupFramebuffer();
51 
52  private:
53  QSize size_;
54  ContextBoundPtr<QOpenGLFramebufferObject> framebuffer_;
55  };
56  }
57 }
58 
59 #endif /* OMNI_INPUT_FRAMEBUFFER_H_ */
virtual ~Framebuffer()
Definition: Framebuffer.h:33
Framebuffer(input::Interface const *=nullptr)
Definition: Framebuffer.cpp:27
GLuint textureId() const
An input must return an OpenGL texture ID.
Definition: Framebuffer.cpp:36
virtual QSize size() const
An input must return width and height information.
Definition: Framebuffer.cpp:41
QSize size_
Definition: Framebuffer.h:53
virtual void destroy()
Definition: Framebuffer.cpp:32
Input object that is renderer to a framebuffer.
Definition: Framebuffer.h:30
ContextBoundPtr< QOpenGLFramebufferObject > framebuffer_
Definition: Framebuffer.h:54
QOpenGLFramebufferObject * framebuffer()
Definition: Framebuffer.cpp:49
Generic input interface.
Definition: Interface.h:53
void setupFramebuffer()
Definition: Framebuffer.cpp:88
virtual void setSize(QSize const &)
Definition: Framebuffer.cpp:45
virtual void fromPropertyMap(PropertyMap const &)
Deserialize from property map.
Definition: Framebuffer.cpp:97
virtual void toPropertyMap(PropertyMap &) const
Serialize to property map.
Definition: Framebuffer.cpp:92