rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
Namespaces | Classes | Enumerations | Functions
rolmodl::sys Namespace Reference

System information functions and enums. More...

Namespaces

 clipboard
 Clipboard functions.
 
 cpu
 CPU information functions.
 
 display
 
 driver
 Video driver functions.
 
 pwr
 Power state functions and enums.
 
 screensaver
 Screensaver functions.
 

Classes

struct  Display
 Display information snapshot. More...
 
struct  DisplayMode
 Display mode parameter plain old struct. More...
 

Enumerations

enum  Id {
  AIX, android, BSDI, dreamcast,
  emscripten, freeBSD, haiku, HPUX,
  irix, linux, MiNT, macOSClassic,
  macOSX, NaCl, netBSD, openBSD,
  OS2, OSF, QNXNeutrino, RISCOS,
  solaris, windows, winRT, tvOS,
  iOS, PSP, unknown
}
 OS type enum. More...
 

Functions

const char * name () noexcept
 Human-readable OS name. Use rolmodl::sys::id() for OS identification purposes instead of this method. More...
 
Id id () noexcept
 Get id of the OS on which the code is running. May differ from whatever operating system the code was compiled on.
 
unsigned int ram () noexcept
 Get the amount of system RAM in MB. More...
 
unsigned int logicalCores () noexcept
 Get the number of available logical CPU cores. More...
 

Detailed Description

System information functions and enums.

Enumeration Type Documentation

◆ Id

enum rolmodl::sys::Id
strong

OS type enum.

Values taken from SDL.c.

See also
https://github.com/spurious/SDL-mirror/blob/master/src/SDL.c

Definition at line 28 of file Base.hpp.

Function Documentation

◆ name()

const char * rolmodl::sys::name ( )
noexcept

Human-readable OS name. Use rolmodl::sys::id() for OS identification purposes instead of this method.

See also
https://wiki.libsdl.org/SDL_GetPlatform

Definition at line 9 of file Base.cpp.

Referenced by id().

◆ ram()

unsigned int rolmodl::sys::ram ( )
noexcept

Get the amount of system RAM in MB.

See also
https://wiki.libsdl.org/SDL_GetSystemRAM

Definition at line 73 of file Base.cpp.

◆ logicalCores()

unsigned int rolmodl::sys::logicalCores ( )
noexcept

Get the number of available logical CPU cores.

See also
https://wiki.libsdl.org/SDL_GetCPUCount

Definition at line 76 of file Base.cpp.