diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 21:26:03 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 21:26:03 +0100 |
commit | 5ef7c56e44a864e580810952450c43c0f9a7b6e0 (patch) | |
tree | 2a0faeaef514558b991832fbae63500f9f6e0228 /src/example | |
parent | f9f06f54dd1a66350afd42f6eec761565a4d3d77 (diff) |
make format
Diffstat (limited to 'src/example')
-rw-r--r-- | src/example/loadfont.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/example/loadfont.cpp b/src/example/loadfont.cpp index 52454a1..efd5a98 100644 --- a/src/example/loadfont.cpp +++ b/src/example/loadfont.cpp @@ -1,27 +1,27 @@ -#include <iostream> -#include <exception> -#include <memory> -#include <crepe/facade/SDLFontContext.h> #include <crepe/api/Text.h> #include <crepe/facade/Font.h> -#include <crepe/manager/Mediator.h> #include <crepe/facade/SDLContext.h> +#include <crepe/facade/SDLFontContext.h> +#include <crepe/manager/Mediator.h> +#include <exception> +#include <iostream> +#include <memory> using namespace crepe; int main() { - - SDLFontContext font_facade; + + 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 = std::make_unique<Font>(*asset,mediator); - }catch (const std::exception& e) { - std::cout << "Standard exception thrown: " << e.what() << std::endl; + 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 = std::make_unique<Font>(*asset, mediator); + } catch (const std::exception & e) { + std::cout << "Standard exception thrown: " << e.what() << std::endl; } - - return 0; + return 0; } |