From cf1aee508dca530141bda66277ac5075fcec1f70 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 28 Dec 2017 02:24:34 +0100 Subject: Add texture loading (not usage) using SOIL Add soil add dependency --- include/RenderBackend/OpenGL/Image.hpp | 26 ++++++++++++++++++++++++++ include/RenderBackend/OpenGL/Texture2D.hpp | 19 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 include/RenderBackend/OpenGL/Image.hpp create mode 100644 include/RenderBackend/OpenGL/Texture2D.hpp (limited to 'include') 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 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; + }; +} -- cgit v1.2.3