18 return std::to_string(
int(v.major)) +
'.' + std::to_string(
int(v.minor)) +
'.' 19 + std::to_string(
int(v.patch));
23 inline void show_message_box(uint32_t flags, std::string
const& title, std::string
const& message)
25 SDL_ShowSimpleMessageBox(flags, title.c_str(), message.c_str(),
nullptr);
30 uint32_t flags, std::string
const& title, std::string
const& message,
sdl::Window const& parent)
32 SDL_ShowSimpleMessageBox(flags, title.c_str(), message.c_str(), parent.
ptr());
39 #if SDL_VERSION_ATLEAST(2, 0, 9) 42 return SDL_IsTablet();
47 return SDL_HasAVX512F();
54 return SDL_GetPlatform();
61 return SDL_GetCPUCacheLineSize();
67 return SDL_GetCPUCount();
74 return SDL_GetSystemRAM();
80 return SDL_Has3DNow();
98 return SDL_HasAltiVec();
110 return SDL_HasRDTSC();
150 unknown = SDL_POWERSTATE_UNKNOWN,
154 charged = SDL_POWERSTATE_CHARGED
160 return state(SDL_GetPowerInfo(
nullptr,
nullptr));
168 SDL_GetPowerInfo(&time,
nullptr);
177 SDL_GetPowerInfo(
nullptr, &charge);
188 return SDL_HasClipboardText();
194 return SDL_GetClipboardText();
200 return SDL_SetClipboardText(text.c_str());
int system_ram()
Get the amount of ram in the system `.
int get_battery_remaining_charge()
Get the current battery charge.
std::string text()
Returns the content of the clipboard.
bool has_SSE3()
Return true if cpu supports SSE3.
bool has_SSE42()
Return true if cpu supports SSE42.
bool has_AVX()
Return true if CPU has AVX instruction set support.
bool has_SSE41()
Return true if cpu supports SSE41.
bool has_AVX2()
Return true if CPU has AVX2 instruction set support.
bool has_text()
Returns true if clipboard has text.
std::string platform()
Get used platform as a string.
state get_state()
Get current powerstate. See sdl::power::state enumeration for values.
int cpu_count()
Get the numbers of CPU in the system.
Define to deactivate exception support.
int cpu_cacheline_size()
Get the size of a cacheline.
bool has_SSE2()
Return true if cpu supports SSE2.
int get_text(std::string const &text)
Set the clipboard to a specific value.
SDL_Window * ptr() const
Getter for the raw SDL2 window pointer.
int get_battery_remaining_time()
Get battery remaining time.
bool has_SSE()
Return true if cpu supports 1st gen SSE.
bool has_3DNow()
Returns true if system has AMD 3DNow! support.
bool has_AltiVec()
Return true if cpu has Apple/IBM/Motorola AltiVec SIMD support.
bool has_MMX()
Return true if cpu has Intel MMX support.
bool has_RDTSC()
Return true if current cpu has a TSC register.
std::string version()
Get version as string.
void show_message_box(uint32_t flags, std::string const &title, std::string const &message)
Show a message box, usefull to display error messages.