aboutsummaryrefslogtreecommitdiff
path: root/src/RenderBackend/OpenGL/Image.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-02-15 01:36:41 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-18 15:22:10 +0100
commite4d073947d09634e95325ddaf8f1615f85e85901 (patch)
tree1bfa96dd7692f0d1c0029b3ba9a82e4ba719eb71 /src/RenderBackend/OpenGL/Image.cpp
parentb366f3d0c573468ecd0b59da43dfcbc847334b19 (diff)
Load texture in obj model loader.. broken
Diffstat (limited to 'src/RenderBackend/OpenGL/Image.cpp')
-rw-r--r--src/RenderBackend/OpenGL/Image.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/RenderBackend/OpenGL/Image.cpp b/src/RenderBackend/OpenGL/Image.cpp
deleted file mode 100644
index 128a580..0000000
--- a/src/RenderBackend/OpenGL/Image.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "../../../include/RenderBackend/OpenGL/Image.hpp"
-#include <SOIL/SOIL.h>
-
-using namespace std;
-
-namespace amalgine
-{
- Image::Image(unsigned char *_imageData, i32 _width, i32 _height) : imageData(_imageData), width(_width), height(_height)
- {
-
- }
-
- Result<Image*> Image::loadFromFile(const char *filepath)
- {
- int width;
- int height;
- unsigned char *imageData = SOIL_load_image(filepath, &width, &height, 0, SOIL_LOAD_RGB);
- if(!imageData)
- {
- string errMsg = "Failed to load image from file: ";
- errMsg += filepath;
- errMsg += "; SOIL error message: ";
- errMsg += SOIL_last_result();
- return Result<Image*>::Err(errMsg);
- }
- return Result<Image*>::Ok(new Image(imageData, width, height));
- }
-
- const unsigned char* Image::getData() const
- {
- return imageData;
- }
-
- i32 Image::getWidth() const
- {
- return width;
- }
-
- i32 Image::getHeight() const
- {
- return height;
- }
-
- Image::~Image()
- {
- SOIL_free_image_data(imageData);
- }
-}