From 977b8f16d7ef43101b6ef588f9610f34285fa7e6 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 20 Sep 2017 23:01:12 +0100 Subject: Replacing SDL by glfw --- yage/base/imageloader.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'yage/base/imageloader.cpp') 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 in; std::vector 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; } -- cgit