Refactor a little; SDL-specific header stuff should stay in SDL_lib.hxx.

This commit is contained in:
Stephen Anthony 2024-02-02 11:23:36 -03:30
parent 444dfdc4a9
commit 4557099e5d
2 changed files with 7 additions and 10 deletions

View File

@ -184,11 +184,7 @@ class MediaFactory
static bool supportsURL()
{
#if defined(SDL_SUPPORT)
#if SDL_VERSION_ATLEAST(2, 0, 14)
return true;
#else
return false;
#endif
return SDLSupportsURL();
#else
return false;
#endif
@ -197,14 +193,10 @@ class MediaFactory
static bool openURL(const string& url)
{
#if defined(SDL_SUPPORT)
#if SDL_VERSION_ATLEAST(2, 0, 14)
return SDLOpenURL(url);
#else
return false;
#endif
#else
return false;
#endif
}
private:

View File

@ -60,6 +60,11 @@ static inline string SDLVersion()
return buf.str();
}
static inline bool SDLSupportsURL()
{
return static_cast<bool>(SDL_VERSION_ATLEAST(2,0,14));
}
static inline bool SDLOpenURL(const string& url)
{
#if SDL_VERSION_ATLEAST(2,0,14)