aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/RenderBackend/OpenGL/Image.hpp26
-rw-r--r--include/RenderBackend/OpenGL/Texture2D.hpp19
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;
+ };
+}