diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-09-20 23:01:12 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-09-20 23:01:12 +0100 |
commit | 977b8f16d7ef43101b6ef588f9610f34285fa7e6 (patch) | |
tree | 25446bc027685765a79492d3b68c49bdee53612b /yage/base/imageloader.cpp | |
parent | b869c926429e9316617a643960a97fad64dd42ef (diff) | |
download | YAGE-977b8f16d7ef43101b6ef588f9610f34285fa7e6.tar.gz YAGE-977b8f16d7ef43101b6ef588f9610f34285fa7e6.zip |
Replacing SDL by glfw
Diffstat (limited to 'yage/base/imageloader.cpp')
-rw-r--r-- | yage/base/imageloader.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/yage/base/imageloader.cpp b/yage/base/imageloader.cpp index 983c350e..0d7d5df9 100644 --- a/yage/base/imageloader.cpp +++ b/yage/base/imageloader.cpp @@ -17,8 +17,6 @@ namespace yage Texture ImageLoader::loadPng(const std::string &file_path) { - Texture texture = {}; - std::vector<unsigned char> in; std::vector<unsigned char> out; unsigned long width, height; @@ -35,6 +33,8 @@ Texture ImageLoader::loadPng(const std::string &file_path) std::to_string(error_code)); } + Texture texture{0, (int)width, (int)height}; + glGenTextures(1, &texture.id); glBindTexture(GL_TEXTURE_2D, texture.id); @@ -51,9 +51,6 @@ Texture ImageLoader::loadPng(const std::string &file_path) glBindTexture(GL_TEXTURE_2D, 0); - texture.width = (int)width; - texture.height = (int)height; - return texture; } |