X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2Frender.cpp;h=be59d2357befaa1eae6481008e8852d8ae64617d;hb=54deb92306a3de4fc1ee17fb7081a8b92f16ddda;hp=7e048408b5091239ca10e35e89a8dfe2fcec4035;hpb=55dbd6b35a39888f245e247d2e140f141f918178;p=blank.git diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index 7e04840..be59d23 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -1,6 +1,8 @@ +#include "BlendedSprite.hpp" #include "Font.hpp" #include "Format.hpp" #include "Texture.hpp" +#include "Viewport.hpp" #include #include @@ -99,21 +101,22 @@ bool Font::HasGlyph(Uint16 c) const noexcept { } -glm::tvec2 Font::TextSize(const char *text) const { - glm::tvec2 size; +glm::ivec2 Font::TextSize(const char *text) const { + glm::ivec2 size; if (TTF_SizeUTF8(handle, text, &size.x, &size.y) != 0) { throw std::runtime_error(TTF_GetError()); } return size; } -Texture Font::Render(const char *text, SDL_Color color) const { +Texture Font::Render(const char *text) const { Texture tex; + Render(text, tex); return tex; } -void Font::Render(const char *text, SDL_Color color, Texture &tex) const { - SDL_Surface *srf = TTF_RenderUTF8_Blended(handle, text, color); +void Font::Render(const char *text, Texture &tex) const { + SDL_Surface *srf = TTF_RenderUTF8_Blended(handle, text, { 0xFF, 0xFF, 0xFF, 0xFF }); if (!srf) { throw std::runtime_error(TTF_GetError()); }