1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Add initial stuff to use SDL_ttf

This commit is contained in:
Mathieu Schroeter 2022-06-24 23:53:18 +02:00
parent e9c99fbad9
commit 0631474c23
No known key found for this signature in database
GPG Key ID: 8B9145A5FA9DA8A8
2 changed files with 10 additions and 0 deletions

View File

@ -157,6 +157,9 @@ if (NOT BUILD_JS)
pkg_search_module (SDL2_IMAGE REQUIRED SDL2_image)
include_directories (${SDL2_IMAGE_INCLUDE_DIRS})
set (planetblupi_DEPS ${planetblupi_DEPS} ${SDL2_IMAGE_STATIC_LIBRARIES})
pkg_search_module (SDL2_TTF REQUIRED SDL2_ttf)
include_directories (${SDL2_TTF_INCLUDE_DIRS})
set (planetblupi_DEPS ${planetblupi_DEPS} ${SDL2_TTF_STATIC_LIBRARIES})
pkg_search_module (SDL2_MIXER REQUIRED SDL2_mixer)
include_directories (${SDL2_MIXER_INCLUDE_DIRS})
set (planetblupi_DEPS ${planetblupi_DEPS} ${SDL2_MIXER_STATIC_LIBRARIES})
@ -233,6 +236,7 @@ else ()
${SDL2_LIBRARIES}
${SDL2_MIXER_LIBRARIES}
${SDL2_IMAGE_LIBRARIES}
${SDL2_TTF_LIBRARIES}
${CURL_LIBRARIES}
${SDLKitchensink_LIBRARIES}
pthread

View File

@ -32,6 +32,7 @@
#include <vector>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <argagg/argagg.hpp>
#ifdef USE_CURL
#include <curl/curl.h>
@ -801,6 +802,11 @@ DoInit (int argc, char * argv[], bool & exit)
return EXIT_FAILURE;
}
if (TTF_Init () < 0) {
SDL_Log ("Couldn't initialize TTF: %s", SDL_GetError ());
return EXIT_FAILURE;
}
if (!(g_settingsOverload & SETTING_LEGACY))
Display::getDisplay ().readDisplaySize ();