remove source code support for SDL2

This commit is contained in:
Sasha Szpakowski
2024-10-18 20:22:26 -03:00
parent caca6196fc
commit 337d8fa048
38 changed files with 161 additions and 2419 deletions
-32
View File
@@ -23,20 +23,9 @@
#include "window/Window.h"
// SDL
#if __has_include(<SDL3/SDL_clipboard.h>)
#include <SDL3/SDL_clipboard.h>
#include <SDL3/SDL_cpuinfo.h>
#include <SDL3/SDL_version.h>
#include <SDL3/SDL_locale.h>
#else
#include <SDL_clipboard.h>
#include <SDL_cpuinfo.h>
#include <SDL_version.h>
#if SDL_VERSION_ATLEAST(2, 0, 14)
#include <SDL_locale.h>
#endif
#endif
namespace love
{
@@ -52,11 +41,7 @@ System::System()
int System::getProcessorCount() const
{
#if SDL_VERSION_ATLEAST(3, 0, 0)
return SDL_GetNumLogicalCPUCores();
#else
return SDL_GetCPUCount();
#endif
}
bool System::isWindowOpen() const
@@ -106,7 +91,6 @@ std::vector<std::string> System::getPreferredLocales() const
{
std::vector<std::string> result;
#if SDL_VERSION_ATLEAST(3, 0, 0)
int count = 0;
SDL_Locale **locales = SDL_GetPreferredLocales(&count);
for (int i = 0; i < count; i++)
@@ -118,22 +102,6 @@ std::vector<std::string> System::getPreferredLocales() const
result.push_back(locale->language);
}
SDL_free(locales);
#elif SDL_VERSION_ATLEAST(2, 0, 14)
SDL_Locale *locales = SDL_GetPreferredLocales();
if (locales)
{
for (SDL_Locale* locale = locales; locale->language != nullptr; locale++)
{
if (locale->country)
result.push_back(std::string(locale->language) + "_" + std::string(locale->country));
else
result.push_back(locale->language);
}
SDL_free(locales);
}
#endif
return result;
}
-4
View File
@@ -26,11 +26,7 @@
#include "common/EnumMap.h"
// SDL
#if __has_include(<SDL3/SDL_power.h>)
#include <SDL3/SDL_power.h>
#else
#include <SDL_power.h>
#endif
namespace love
{