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

View File

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