allocator + font stuff

This commit is contained in:
Madthijs
2021-04-28 20:06:51 +02:00
parent c5a1303b71
commit 0725828a5f
4 changed files with 33 additions and 21 deletions

View File

@@ -188,9 +188,6 @@ bool GpFileSystem_X::ResolvePath(PortabilityLayer::VirtualDirectory_t virtualDir
case PortabilityLayer::VirtualDirectories::kLogs:
prefsAppend = "Logs";
break;
case PortabilityLayer::VirtualDirectories::kLogs:
prefsAppend = "..";
break;
default:
return false;
};

View File

@@ -2,6 +2,7 @@
#include "SDL_main.h"
#include "GpMain.h"
#include "GpAllocator_C.h"
#include "GpAudioDriverFactory.h"
#include "GpDisplayDriverFactory.h"
#include "GpGlobalConfig.h"
@@ -22,6 +23,8 @@
GpXGlobals g_gpXGlobals;
IGpFontHandler *GpDriver_CreateFontHandler_FreeType2(const GpFontHandlerProperties &properties);
IGpDisplayDriver *GpDriver_CreateDisplayDriver_SDL_GL2(const GpDisplayDriverProperties &properties);
IGpAudioDriver *GpDriver_CreateAudioDriver_SDL(const GpAudioDriverProperties &properties);
IGpInputDriver *GpDriver_CreateInputDriver_SDL2_Gamepad(const GpInputDriverProperties &properties);
@@ -57,12 +60,13 @@ SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
drivers->SetDriver<GpDriverIDs::kFileSystem>(GpFileSystem_X::GetInstance());
drivers->SetDriver<GpDriverIDs::kSystemServices>(GpSystemServices_X::GetInstance());
drivers->SetDriver<GpDriverIDs::kLog>(GpLogDriver_X::GetInstance());
drivers->SetDriver<GpDriverIDs::kAlloc>(GpAllocator_C::GetInstance());
g_gpGlobalConfig.m_displayDriverType = EGpDisplayDriverType_SDL_GL2;
g_gpGlobalConfig.m_audioDriverType = EGpAudioDriverType_SDL2;
g_gpGlobalConfig.m_fontHandlerType = EGpFontHandlerType_None;
g_gpGlobalConfig.m_fontHandlerType = EGpFontHandlerType_FreeType2;
EGpInputDriverType inputDrivers[] =
{
@@ -75,10 +79,12 @@ SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
g_gpGlobalConfig.m_osGlobals = &g_gpXGlobals;
g_gpGlobalConfig.m_logger = logger;
g_gpGlobalConfig.m_systemServices = GpSystemServices_X::GetInstance();
g_gpGlobalConfig.m_allocator = GpAllocator_C::GetInstance();
GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType_SDL_GL2, GpDriver_CreateDisplayDriver_SDL_GL2);
GpAudioDriverFactory::RegisterAudioDriverFactory(EGpAudioDriverType_SDL2, GpDriver_CreateAudioDriver_SDL);
GpInputDriverFactory::RegisterInputDriverFactory(EGpInputDriverType_SDL2_Gamepad, GpDriver_CreateInputDriver_SDL2_Gamepad);
GpFontHandlerFactory::RegisterFontHandlerFactory(EGpFontHandlerType_FreeType2, GpDriver_CreateFontHandler_FreeType2);
if (logger)
logger->Printf(IGpLogDriver::Category_Information, "SDL environment configured, starting up");