diff options
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; } |