Move TTF init to SDLSystem

This commit is contained in:
Maschell 2020-09-07 20:36:33 +02:00
parent 1401714462
commit 27c96611b5
2 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,6 @@ MainWindow::MainWindow(int32_t w, int32_t h, Renderer* renderer) : GuiFrame(w, h
auto bgMusic_path = "bgMusic.ogg";
auto music_click = "button_click.mp3";
TTF_Init();
TTF_Font *font;
SDL_RWops *rw = SDL_RWFromMem((void *) Resources::GetFile(font_path), Resources::GetFileSize(font_path));

View File

@ -18,6 +18,7 @@
#include "../utils/logger.h"
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_ttf.h>
SDLSystem::SDLSystem() {
SDL_Init(SDL_INIT_EVERYTHING);
@ -56,6 +57,8 @@ SDLSystem::SDLSystem() {
auto dev = Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 640);
SDL_PauseAudioDevice(dev, 0);
TTF_Init();
}
SDLSystem::~SDLSystem() {