A 2D tile-based sandbox game.
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.

Image.h 350B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <memory>
  3. #include "GlWrappers.h"
  4. namespace Cygnet {
  5. class Image {
  6. public:
  7. Image(std::string path);
  8. GlTexture &texture();
  9. int width() { return w_; }
  10. int height() { return h_; }
  11. private:
  12. std::string path_;
  13. int w_, h_, pitch_;
  14. std::unique_ptr<unsigned char[]> bytes_;
  15. GlTexture tex_;
  16. bool tex_dirty_ = true;
  17. };
  18. }