Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Texture32F.h
Go to the documentation of this file.
1 
2 /* Copyright (c) 2014-2015 "Omnidome" by cr8tr
3  * Dome Mapping Projection Software (http://omnido.me).
4  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
5  *
6  * This file is part of Omnidome.
7  *
8  * Omnidome is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Affero General Public License as
10  * published by the Free Software Foundation, either version 3 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Affero General Public License for more details.
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #ifndef OMNI_VISUAL_TEXTURE32F_H_
21 #define OMNI_VISUAL_TEXTURE32F_H_
22 
23 #include <QOpenGLFunctions>
24 #include <omni/RenderBuffer.h>
25 
26 namespace omni {
27  namespace visual {
28 
29  /// RGBA Texture with 32-bit float for each channel
30  class Texture32F {
31  public:
32  Texture32F();
33 
34  /// Construct from render buffer and initialize
35  Texture32F(RenderBuffer const& _buf, GLuint _target = GL_TEXTURE_2D);
36 
37  ~Texture32F();
38 
39  /// Initialize texture data from render buffer
40  void initialize(RenderBuffer const& _buf, GLuint _target = GL_TEXTURE_2D);
41 
42  void destroy();
43 
44  /// Bind texture with glBindTexture(target,texId)
45  void bind();
46 
47  /// Release texture with glBindTexture(target,0)
48  void release();
49 
50  /// Return GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE
51  GLuint target() const;
52 
53  /// Return id of this texture
54  GLuint textureId() const;
55 
56  private:
57  QSize size_;
58  GLuint target_ = GL_TEXTURE_2D;
59  GLuint texId_ = 0;
60  };
61 
62  }
63 }
64 
65 #endif /* OMNI_VISUAL_TEXTURE32F_H_ */
void initialize(RenderBuffer const &_buf, GLuint _target=GL_TEXTURE_2D)
Initialize texture data from render buffer.
Definition: Texture32F.cpp:53
void destroy()
Definition: Texture32F.cpp:36
Texture32F()
Definition: Texture32F.cpp:26
QSize size_
Definition: Texture32F.h:57
RGBA Texture with 32-bit float for each channel.
Definition: Texture32F.h:30
GLuint target_
Definition: Texture32F.h:58
GLuint target() const
Return GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE.
Definition: Texture32F.cpp:45
void release()
Release texture with glBindTexture(target,0)
Definition: Texture32F.cpp:78
~Texture32F()
Definition: Texture32F.cpp:32
void bind()
Bind texture with glBindTexture(target,texId)
Definition: Texture32F.cpp:72
GLuint texId_
Definition: Texture32F.h:59
GLuint textureId() const
Return id of this texture.
Definition: Texture32F.cpp:49