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_ */
int m_width
The width of the texture in pixels.
Definition: GlTexture.hpp:103
void bind() const
Bind the texture to the current OpenGL context.
Definition: GlTexture.hpp:94
This class represents a texture.
Definition: Texture.hpp:54
void upload()
Does all the OpenGL stuff to make it avialable for rendering.
Definition: GlTexture.cpp:109
int m_height
The height of the texture in pixels.
Definition: GlTexture.hpp:106
unsigned char * m_pixels
The aligned pixel data. Three bytes per pixel (r,g,b)
Definition: GlTexture.hpp:109
virtual ~GlTexture()
Dtor.
Definition: GlTexture.cpp:96
GLuint m_texIndex
The texture index of the texture.
Definition: GlTexture.hpp:112
GlTexture()
Empty ctor.
Definition: GlTexture.hpp:84


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 Mon Feb 28 2022 22:46:06