GlTexture.hpp
Go to the documentation of this file.
1 
35 #ifndef LVR2_GLTEXTURE_HPP_
36 #define LVR2_GLTEXTURE_HPP_
37 
38 #include <string>
39 using std::string;
40 
41 #ifdef _MSC_VER
42 #include <Windows.h>
43 #endif
44 
45 #ifndef __APPLE__
46 #include <GL/gl.h>
47 #else
48 #include <OpenGL/gl.h>
49 #endif
50 
51 #include "lvr2/texture/Texture.hpp"
52 
53 namespace lvr2
54 {
55 
56 class GlTexture
57 {
58 public:
59 
69  GlTexture(unsigned char* pixels, int width, int height);
70 
74  GlTexture(const GlTexture &other);
75 
79  GlTexture(const Texture &other);
80 
84  GlTexture() : m_pixels(0), m_texIndex(0) {};
85 
89  virtual ~GlTexture();
90 
94  void bind() const { glBindTexture(GL_TEXTURE_2D, m_texIndex);}
95 
100  void upload();
101 
103  int m_width;
104 
106  int m_height;
107 
109  unsigned char* m_pixels;
110 
112  GLuint m_texIndex;
113 };
114 
115 } // namespace lvr2
116 
117 #endif /* TEXTURE_HPP_ */
lvr2::GlTexture::upload
void upload()
Does all the OpenGL stuff to make it avialable for rendering.
Definition: GlTexture.cpp:109
lvr2::GlTexture
Definition: GlTexture.hpp:56
lvr2::GlTexture::m_texIndex
GLuint m_texIndex
The texture index of the texture.
Definition: GlTexture.hpp:112
lvr2::GlTexture::m_height
int m_height
The height of the texture in pixels.
Definition: GlTexture.hpp:106
lvr2::GlTexture::~GlTexture
virtual ~GlTexture()
Dtor.
Definition: GlTexture.cpp:96
lvr2::GlTexture::GlTexture
GlTexture()
Empty ctor.
Definition: GlTexture.hpp:84
Texture.hpp
lvr2::GlTexture::m_pixels
unsigned char * m_pixels
The aligned pixel data. Three bytes per pixel (r,g,b)
Definition: GlTexture.hpp:109
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::Texture
This class represents a texture.
Definition: Texture.hpp:54
lvr2::GlTexture::m_width
int m_width
The width of the texture in pixels.
Definition: GlTexture.hpp:103
lvr2::GlTexture::bind
void bind() const
Bind the texture to the current OpenGL context.
Definition: GlTexture.hpp:94


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23