diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 21:09:55 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 21:09:55 +0100 |
commit | 3ed4e51e23b5093a44a166b2f11ff66164e5cff1 (patch) | |
tree | 75a8eaadc2e21759936d2c716594cb9c4d23714c /src/example/loadfont.cpp | |
parent | 431d7cceb25db86f31a8c89440f3cdd2c7bf061f (diff) |
font working
Diffstat (limited to 'src/example/loadfont.cpp')
-rw-r--r-- | src/example/loadfont.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/example/loadfont.cpp b/src/example/loadfont.cpp index fe5466f..52454a1 100644 --- a/src/example/loadfont.cpp +++ b/src/example/loadfont.cpp @@ -5,17 +5,19 @@ #include <crepe/api/Text.h> #include <crepe/facade/Font.h> #include <crepe/manager/Mediator.h> +#include <crepe/facade/SDLContext.h> using namespace crepe; - int main() { + SDLFontContext font_facade; Mediator mediator; + SDLContext sdl_context{mediator}; try{ // Correct way to create a unique pointer for Text std::unique_ptr<Text> label = std::make_unique<Text>(1, vec2(100, 100), vec2(0, 0), "test test","OpenSymbol"); std::unique_ptr<Asset> asset = font_facade.get_font_asset(label->font_family); std::cout << "path: " << asset->get_path() << std::endl; - std::unique_ptr<Font> font = make_unique<Font>(asset,mediator) + std::unique_ptr<Font> font = std::make_unique<Font>(*asset,mediator); }catch (const std::exception& e) { std::cout << "Standard exception thrown: " << e.what() << std::endl; } |