You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tileset.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * =====================================================================================
  3. *
  4. * Filename: tileset.h
  5. *
  6. * Description: Tileset using OpenGL array texture
  7. *
  8. * Version: 1.0
  9. * Created: 04/02/2014 10:37:18 PM
  10. * Revision: none
  11. * Compiler: gcc
  12. *
  13. * Author: YOUR NAME (),
  14. * Organization:
  15. *
  16. * =====================================================================================
  17. */
  18. #pragma once
  19. #include <map>
  20. namespace vtk {
  21. class Tileset {
  22. public:
  23. Tileset();
  24. void bind(); //Bind to active texture
  25. bool addTexture(const std::string& fileName, const std::string& textureName);
  26. void updateTextureAt(const int& index, const std::string& fileName);
  27. int getTextureIndex(const std::string& textureName);
  28. void buildTexture();
  29. void deleteTexture();
  30. protected:
  31. std::map<std::string, std::string> textureFiles; //filename, texturename
  32. std::map<std::string, int> textureIndexes; //texturename, index
  33. int tilesize;
  34. int textureIndex;
  35. int maxTextures;
  36. unsigned texture; //OGL texture
  37. };
  38. }