From 9583f32bc760576d250e78a79a812ec95ebd0f8e Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle <drumsetmonkey@gmail.com> Date: Sat, 14 Sep 2019 02:50:32 -0400 Subject: Textures can now load from lua tables as well as strings --- src/texture.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/texture.hpp') diff --git a/src/texture.hpp b/src/texture.hpp index 8cfd68c..3daebbd 100644 --- a/src/texture.hpp +++ b/src/texture.hpp @@ -22,6 +22,8 @@ #include <soil/SOIL.h> +#include <sol/sol.hpp> + #include <GL/glew.h> #include <SDL2/SDL_opengl.h> #include <glm/glm.hpp> @@ -31,16 +33,19 @@ class Texture { private: + void loadFromString(std::string); public: GLuint tex = 0; - int width; - int height; glm::vec2 offset = glm::vec2(0); - glm::vec2 offsetSize = glm::vec2(1); + glm::vec2 size = glm::vec2(1); + + int width; + int height; Texture() {}; Texture(std::string); + Texture(sol::object); }; #endif//TEXTURE_HPP_ -- cgit v1.2.3