SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TextureInterface.h
Go to the documentation of this file.
1 
7 #ifndef __SCV_TEXTURE_INTERFACE_H__
8 #define __SCV_TEXTURE_INTERFACE_H__
9 
10 #ifndef DOXYGEN_SKIP_THIS
11 #include "Point.h"
12 #include "MatrixTemplate.h"
13 #endif // DOXYGEN_SKIP_THIS
14 
15 namespace scv {
16 
19 public:
21  _textureId = 0;
22  _textureEnvMode = GL_REPLACE;
23  _textureSize[0] = _textureSize[1] = -1;
24  }
25 
26  virtual ~TextureInterface() {
27  if (_textureId != 0) {
28  glDeleteTextures(1, &_textureId);
29  _textureId = 0;
30  }
31  };
32 
33  virtual void display(const Point &translate) = 0;
34 
35  inline void setTextureEnvMode(GLfloat param) {
36  _textureEnvMode = param;
37  }
38 
39  inline GLuint getTextureId(void) const {
40  return _textureId;
41  }
42 
43  inline GLsizei getWidth(void) const {
44  return _textureSize[0];
45  }
46  inline GLsizei getHeight(void) const {
47  return _textureSize[1];
48  }
49 
50 protected:
51  GLuint _textureId;
52  GLsizei _textureSize[2]; // width, height
53  GLfloat _textureEnvMode;
54 };
55 
56 } // namespace scv
57 
58 #endif // __SCV_TEXTURE_INTERFACE_H__