diff options
Diffstat (limited to 'src/example/loadfont.cpp')
-rw-r--r-- | src/example/loadfont.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/example/loadfont.cpp b/src/example/loadfont.cpp index f863053..ce287b4 100644 --- a/src/example/loadfont.cpp +++ b/src/example/loadfont.cpp @@ -1,5 +1,5 @@ -#include <crepe/api/Text.h> #include <SDL2/SDL_ttf.h> +#include <crepe/api/Text.h> #include <crepe/facade/Font.h> #include <crepe/facade/SDLContext.h> #include <crepe/manager/Mediator.h> @@ -25,14 +25,14 @@ int main() { = std::make_unique<Text>(1, vec2(100, 100), vec2(0, 0), "test test", "fsaafdafsdafsdafsdasfdds", Text::Data{}); std::cout << "Path: " << label2->font.get_path() << std::endl; - ResourceManager & resource_mgr = mediator.resource_manager; - const Font & res = resource_manager.get<Font>(label->font); - TTF_Font * test_font = res.get_font(); - if(test_font == NULL){ - std::cout << "error with font" << std::endl; - }else{ - std::cout << "correct font retrieved" << std::endl; - } + ResourceManager & resource_mgr = mediator.resource_manager; + const Font & res = resource_manager.get<Font>(label->font); + TTF_Font * test_font = res.get_font(); + if (test_font == NULL) { + std::cout << "error with font" << std::endl; + } else { + std::cout << "correct font retrieved" << std::endl; + } } catch (const std::exception & e) { std::cout << "Standard exception thrown: " << e.what() << std::endl; } |