diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-12 14:24:18 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-12 14:24:18 -0400 |
commit | 889543e9862e5c6f4adb5c07112bdfd23fe55833 (patch) | |
tree | a15e717db3119bcd6d392b5297ca8d050afb15aa | |
parent | f9aff3e20795be5ee76769fb3ecc461e9917a116 (diff) |
switch to pairs
-rw-r--r-- | src/text.cpp | 17 | ||||
-rw-r--r-- | src/text.hpp | 1 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/text.cpp b/src/text.cpp index 2258774..7b2eb02 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -2,10 +2,12 @@ #include <SDL2/SDL_opengl.h> +#include <tuple> + struct FT_Info { - vec2 wh; - vec2 bl; - vec2 ad; + std::pair<float, float> wh; + std::pair<float, float> bl; + std::pair<float, float> ad; GLuint tex; FT_Info(void) @@ -69,12 +71,9 @@ void TextSystem::loadFont(const std::string& name, for (auto j = buf.size(); j--;) buf[j] |= g->bitmap.buffer[j] << 24; - d.wh.x = g->bitmap.width; - d.wh.y = g->bitmap.rows; - d.bl.x = g->bitmap_left; - d.bl.y = g->bitmap_top; - d.ad.x = g->advance.x >> 6; - d.ad.y = g->advance.y >> 6; + d.wh = { g->bitmap.width, g->bitmap.rows }; + d.bl = { g->bitmap_left, g->bitmap_top }; + d.ad = { g->advance.x >> 6, g->advance.y >> 6 }; glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, g->bitmap.width, g->bitmap.rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, buf.data()); } diff --git a/src/text.hpp b/src/text.hpp index a0fd737..08248b3 100644 --- a/src/text.hpp +++ b/src/text.hpp @@ -30,7 +30,6 @@ #include <vector> struct FT_Info; -struct vec2 { float x; float y; }; /** * @class PhysicsSystem |