Blackcomb  prealpha
Engine-ish
TextureAtlas.h
1 #ifndef BLACKCOMB_TEXTUREATLAS_H
2 #define BLACKCOMB_TEXTUREATLAS_H
3 
4 #include <string>
5 #include "Texture.h"
6 #include "../misc/Coords.h"
7 
8 namespace blackcomb::renderer {
12  class TextureAtlas {
13  public:
14  TextureAtlas(const std::string& textureFilename, int textureWidth, int textureHeight);
16  misc::UVRect getCoordsForTexture(int texture);
17 
18  private:
19  Texture atlas;
20  int textureWidth;
21  int textureHeight;
22  int numColumns;
23  int numRows;
24  float centerOffsetX, centerOffsetY;
25  };
26 }
27 
28 #endif //BLACKCOMB_TEXTUREATLAS_H
Represents a rectangle in UV space.
Definition: Coords.h:22
Texture getTexture()
Get the Texture for the texture atlas.
Definition: TextureAtlas.cpp:15
Definition: Mesh.h:8
Handles looking up textures within a texture atlas.
Definition: TextureAtlas.h:12
Loads and stores a texture.
Definition: Texture.h:12
misc::UVRect getCoordsForTexture(int texture)
Get the coordinates for a texture in the atlas.
Definition: TextureAtlas.cpp:23