Don't load font in TextWidget

This commit is contained in:
2022-05-19 21:02:00 +02:00
parent 41a75f7422
commit 8aa7267b21
4 changed files with 14 additions and 11 deletions

View File

@ -1,10 +1,12 @@
#pragma once
#include "View.h"
#include "widgets.h"
#include <SDL2/SDL.h>
constexpr const char* FT_LOGO_PATH = "resources/Fasttube_Logo-white.bmp";
constexpr const char* AVENIR_FONT_PATH = "resources/Avenir-Book.ttf";
class AMI {
public:
@ -15,6 +17,8 @@ public:
private:
SDL_Renderer* renderer;
TTF_Font* avenir;
ImageWidget ft_logo;
TextWidget choose;
};

View File

@ -41,8 +41,7 @@ public:
class TextWidget : public TextureWidget {
public:
TextWidget(SDL_Renderer* renderer, SDL_Rect dest_rect,
const std::string& font_path,
TextWidget(SDL_Renderer* renderer, SDL_Rect dest_rect, TTF_Font* font,
const std::string& initial_text = "");
~TextWidget();