X-Git-Url: https://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=image.hpp;h=5a75b0daa6add203c96c2f155ca44638c1ba0600;hp=41b45ba3ac01ade461d54741c7e997560fcedcb6;hb=d0c631f46c6db417e013b1bc0edec24cb9c2824a;hpb=a03f2bc751bbd7f91cbc2f52d2f0f6e753d6f776 diff --git a/image.hpp b/image.hpp index 41b45ba..5a75b0d 100644 --- a/image.hpp +++ b/image.hpp @@ -11,18 +11,23 @@ class Image { public: Image(const std::string &path); + Image(const unsigned char *data, size_t length, const char *formatHint); ~Image(); unsigned char *data() const; GLfloat width() const; GLfloat height() const; - GLuint format() const; + GLenum format() const; + GLint internalFormat() const; + GLenum type() const; private: #ifdef __APPLE__ + void initWithImageRef(CGImageRef ref); CFDataRef dataRef; CGBitmapInfo info; CGImageAlphaInfo alphaInfo; CGColorSpaceRef colorSpace; GLfloat _width, _height; + size_t bitsPerComponent; #endif };