diff options
author | dec05eba <dec05eba@protonmail.com> | 2017-12-28 02:24:34 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-18 15:21:48 +0100 |
commit | cf1aee508dca530141bda66277ac5075fcec1f70 (patch) | |
tree | 0b058ce11f8e85374d6e23be3d67bd355fe17cff /include | |
parent | ff4daae11db0ab811cac66e262d289a4107bba4a (diff) |
Add texture loading (not usage) using SOIL
Add soil add dependency
Diffstat (limited to 'include')
-rw-r--r-- | include/RenderBackend/OpenGL/Image.hpp | 26 | ||||
-rw-r--r-- | include/RenderBackend/OpenGL/Texture2D.hpp | 19 |
2 files changed, 45 insertions, 0 deletions
diff --git a/include/RenderBackend/OpenGL/Image.hpp b/include/RenderBackend/OpenGL/Image.hpp new file mode 100644 index 0000000..06f0630 --- /dev/null +++ b/include/RenderBackend/OpenGL/Image.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include "../../utils.hpp" +#include "../../types.hpp" +#include "../../Result.hpp" + +namespace amalgine +{ + class Image + { + DISABLE_COPY(Image) + public: + static Result<Image*> loadFromFile(const char *filepath); + ~Image(); + + const unsigned char* getData() const; + i32 getWidth() const; + i32 getHeight() const; + private: + Image(unsigned char *_imageData, i32 width, i32 height); + private: + unsigned char *imageData; + i32 width; + i32 height; + }; +} diff --git a/include/RenderBackend/OpenGL/Texture2D.hpp b/include/RenderBackend/OpenGL/Texture2D.hpp new file mode 100644 index 0000000..9f7c855 --- /dev/null +++ b/include/RenderBackend/OpenGL/Texture2D.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include "../../types.hpp" +#include "../../utils.hpp" + +namespace amalgine +{ + class Image; + + class Texture2D + { + DISABLE_COPY(Texture2D) + public: + Texture2D(Image *image); + ~Texture2D(); + private: + u32 textureId; + }; +} |