Texture.h 694 B

123456789101112131415161718192021222324252627282930
  1. // ----------------------------------------------------------------
  2. // From Game Programming in C++ by Sanjay Madhav
  3. // Copyright (C) 2017 Sanjay Madhav. All rights reserved.
  4. //
  5. // Released under the BSD License
  6. // See LICENSE in root directory for full details.
  7. // ----------------------------------------------------------------
  8. #include <string>
  9. class Texture
  10. {
  11. public:
  12. Texture();
  13. ~Texture();
  14. bool Load(const std::string& fileName);
  15. void Unload();
  16. void SetActive();
  17. int GetWidth() const { return mWidth; }
  18. int GetHeight() const { return mHeight; }
  19. private:
  20. // OpenGL ID of this texture
  21. unsigned int mTextureID;
  22. // Width/height of the texture
  23. int mWidth;
  24. int mHeight;
  25. };