Don't load font in TextWidget
This commit is contained in:
@ -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;
|
||||
};
|
||||
@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user