GlobeEngine
TextureAtlas.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_TextureAtlas_h
9 #define GlobeEngine_TextureAtlas_h
10 
11 #include "OpenGL_Includes.h"
12 #include <iostream>
13 #include <vector>
14 #include <vmmlib/vmmlib.hpp>
15 #include "OpenGL_Includes.h"
16 
17 namespace ge {
18  /*
19  * A texture atlas provides a 2D grid of textures which can
20  * accessed over x,y coordinates
21  */
23  {
24 
25  public:
26  TextureAtlas() { clear(); };
28  void clear();
29  void create(vmml::Vector2ui _sizes);
30 
31  /* texture atlas filling */
32  GLuint loadAsynchFloat(int _width, int _height, float* _data);
33  void addTexture(GLuint _handle);
34  GLuint locateHandleAtCoordinate(vmml::Vector2d _pos);
35 
36  GLuint getTextureHandle(GLuint _index);
37 
38  /* double _min_x, double _min_y, double _max_x, double _max_y */
39  void setBounds(vmml::Vector4d _bounds);
40  void print();
41  private:
42  std::vector<GLuint> handles;
43  vmml::Vector2ui sizes;
44  vmml::Vector4d bounds;
45  };
46 }
47 #endif
GLuint locateHandleAtCoordinate(vmml::Vector2d _pos)
Definition: TextureAtlas.cpp:32
GLuint getTextureHandle(GLuint _index)
Definition: TextureAtlas.cpp:22
Definition: TextureAtlas.h:22
~TextureAtlas()
Definition: TextureAtlas.h:27
TextureAtlas()
Definition: TextureAtlas.h:26
GLuint loadAsynchFloat(int _width, int _height, float *_data)
void print()
Definition: TextureAtlas.cpp:79
void setBounds(vmml::Vector4d _bounds)
Definition: TextureAtlas.cpp:74
Definition: AvalancheTrainingSimulationEngine.h:28
void clear()
Definition: TextureAtlas.cpp:11
void addTexture(GLuint _handle)
Definition: TextureAtlas.cpp:27
void create(vmml::Vector2ui _sizes)
Definition: TextureAtlas.cpp:17