mirror of
https://github.com/Maschell/SDL2_Playground.git
synced 2024-11-27 07:04:16 +01:00
Move TTF init to SDLSystem
This commit is contained in:
parent
1401714462
commit
27c96611b5
@ -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));
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user