|
ReXGlue SDK
|
Namespaces | |
| namespace | apu |
| namespace | codegen |
| namespace | gpu |
| namespace | kernel |
| namespace | log |
| namespace | memory |
| namespace | platform |
| namespace | ppc |
Concepts | |
| concept | FlagsEnum |
Typedefs | |
| using | HundredNano = std::ratio<1, 10000000> |
| using | HundredNanoseconds = std::chrono::duration<i64, HundredNano> |
| using | WinSystemClock = detail::NtSystemClock<detail::Domain::kHost> |
| using | XSystemClock = detail::NtSystemClock<detail::Domain::kGuest> |
| using | CreateInterfaceFn = IInterface* (*)(const char* name, u32 version) |
| using | EnumerateInterfacesFn = u32 (*)(InterfaceType* out, u32 capacity) |
| template<typename T> | |
| using | Result = std::expected<T, Error> |
| using | u8 = uint8_t |
| using | u16 = uint16_t |
| using | u32 = uint32_t |
| using | u64 = uint64_t |
| using | i8 = int8_t |
| using | i16 = int16_t |
| using | i32 = int32_t |
| using | i64 = int64_t |
| using | f32 = float |
| using | f64 = double |
| template<typename T> | |
| using | BE = EndianValue<T, std::endian::big> |
| template<typename T> | |
| using | LE = EndianValue<T, std::endian::little> |
| using | GuestAddrT = u32 |
| using | host_addr_t = uintptr_t |
| using | be_u8 = u8 |
| using | be_u16 = BE<u16> |
| using | be_u32 = BE<u32> |
| using | be_u64 = BE<u64> |
| using | be_i8 = i8 |
| using | be_i16 = BE<i16> |
| using | be_i32 = BE<i32> |
| using | be_i64 = BE<i64> |
| using | be_f32 = BE<f32> |
| using | be_f64 = BE<f64> |
| template<typename Signature> | |
| using | MoveOnlyFunction = typename detail::MoveOnlyFunctionFor<Signature>::type |
Enumerations | |
| enum class | GraphicsFamily : u8 { kNone , kXenos } |
| enum class | DriverType : u8 { kGraphics , kAudio , kInput , kUI } |
| enum class | VirtualKey : u16 { kNone , kLButton = 0x01 , kRButton = 0x02 , kCancel = 0x03 , kMButton = 0x04 , kXButton1 = 0x05 , kXButton2 = 0x06 , kBack = 0x08 , kTab = 0x09 , kClear = 0x0C , kReturn = 0x0D , kWheelUp = 0x0E , kWheelDown = 0x0F , kShift = 0x10 , kControl = 0x11 , kMenu = 0x12 , kPause = 0x13 , kCapital = 0x14 , kKana = 0x15 , kHangeul = 0x15 , kHangul = 0x15 , kIMEOn = 0x16 , kJunja = 0x17 , kFinal = 0x18 , kHanja = 0x19 , kKanji = 0x19 , kIMEOff = 0x1A , kEscape = 0x1B , kConvert = 0x1C , kNonConvert = 0x1D , kAccept = 0x1E , kModeChange = 0x1F , kSpace = 0x20 , kPrior = 0x21 , kNext = 0x22 , kEnd = 0x23 , kHome = 0x24 , kLeft = 0x25 , kUp = 0x26 , kRight = 0x27 , kDown = 0x28 , kSelect = 0x29 , kPrint = 0x2A , kExecute = 0x2B , kSnapshot = 0x2C , kInsert = 0x2D , kDelete = 0x2E , kHelp = 0x2F , Digit keys 0 to 9, equal to their ASCII codes 0x30 to 0x39. , k0 = 0x30 , k1 = 0x31 , k2 = 0x32 , k3 = 0x33 , k4 = 0x34 , k5 = 0x35 , k6 = 0x36 , k7 = 0x37 , k8 = 0x38 , k9 = 0x39 , Letter keys A to Z, equal to their uppercase ASCII codes 0x41 to 0x5A. , kA = 0x41 , kB = 0x42 , kC = 0x43 , kD = 0x44 , kE = 0x45 , kF = 0x46 , kG = 0x47 , kH = 0x48 , kI = 0x49 , kJ = 0x4A , kK = 0x4B , kL = 0x4C , kM = 0x4D , kN = 0x4E , kO = 0x4F , kP = 0x50 , kQ = 0x51 , kR = 0x52 , kS = 0x53 , kT = 0x54 , kU = 0x55 , kV = 0x56 , kW = 0x57 , kX = 0x58 , kY = 0x59 , kZ = 0x5A , kLWin = 0x5B , kRWin = 0x5C , kApps = 0x5D , kSleep = 0x5F , kNumpad0 = 0x60 , kNumpad1 = 0x61 , kNumpad2 = 0x62 , kNumpad3 = 0x63 , kNumpad4 = 0x64 , kNumpad5 = 0x65 , kNumpad6 = 0x66 , kNumpad7 = 0x67 , kNumpad8 = 0x68 , kNumpad9 = 0x69 , kMultiply = 0x6A , kAdd = 0x6B , kSeparator = 0x6C , kSubtract = 0x6D , kDecimal = 0x6E , kDivide = 0x6F , kF1 = 0x70 , kF2 = 0x71 , kF3 = 0x72 , kF4 = 0x73 , kF5 = 0x74 , kF6 = 0x75 , kF7 = 0x76 , kF8 = 0x77 , kF9 = 0x78 , kF10 = 0x79 , kF11 = 0x7A , kF12 = 0x7B , kF13 = 0x7C , kF14 = 0x7D , kF15 = 0x7E , kF16 = 0x7F , kF17 = 0x80 , kF18 = 0x81 , kF19 = 0x82 , kF20 = 0x83 , kF21 = 0x84 , kF22 = 0x85 , kF23 = 0x86 , kF24 = 0x87 , kNavigationView = 0x88 , kNavigationMenu = 0x89 , kNavigationUp = 0x8A , kNavigationDown = 0x8B , kNavigationLeft = 0x8C , kNavigationRight = 0x8D , kNavigationAccept = 0x8E , kNavigationCancel = 0x8F , kNumLock = 0x90 , kScroll = 0x91 , kOemNecEqual = 0x92 , kOemFjJisho = 0x92 , kOemFjMasshou = 0x93 , kOemFjTouroku = 0x94 , kOemFjLOya = 0x95 , kOemFjROya = 0x96 , kLShift = 0xA0 , kRShift = 0xA1 , kLControl = 0xA2 , kRControl = 0xA3 , kLMenu = 0xA4 , kRMenu = 0xA5 , kBrowserBack = 0xA6 , kBrowserForward = 0xA7 , kBrowserRefresh = 0xA8 , kBrowserStop = 0xA9 , kBrowserSearch = 0xAA , kBrowserFavorites = 0xAB , kBrowserHome = 0xAC , kVolumeMute = 0xAD , kVolumeDown = 0xAE , kVolumeUp = 0xAF , kMediaNextTrack = 0xB0 , kMediaPrevTrack = 0xB1 , kMediaStop = 0xB2 , kMediaPlayPause = 0xB3 , kLaunchMail = 0xB4 , kLaunchMediaSelect = 0xB5 , kLaunchApp1 = 0xB6 , kLaunchApp2 = 0xB7 , kOem1 = 0xBA , kOemPlus = 0xBB , kOemComma = 0xBC , kOemMinus = 0xBD , kOemPeriod = 0xBE , kOem2 = 0xBF , kOem3 = 0xC0 , kXboxOneGamepadA = 0xC3 , kXboxOneGamepadB = 0xC4 , kXboxOneGamepadX = 0xC5 , kXboxOneGamepadY = 0xC6 , kXboxOneGamepadRightShoulder = 0xC7 , kXboxOneGamepadLeftShoulder = 0xC8 , kXboxOneGamepadLeftTrigger = 0xC9 , kXboxOneGamepadRightTrigger = 0xCA , kXboxOneGamepadDpadUp = 0xCB , kXboxOneGamepadDpadDown = 0xCC , kXboxOneGamepadDpadLeft = 0xCD , kXboxOneGamepadDpadRight = 0xCE , kXboxOneGamepadMenu = 0xCF , kXboxOneGamepadView = 0xD0 , kXboxOneGamepadLeftThumbstickButton = 0xD1 , kXboxOneGamepadRightThumbstickButton = 0xD2 , kXboxOneGamepadLeftThumbstickUp = 0xD3 , kXboxOneGamepadLeftThumbstickDown = 0xD4 , kXboxOneGamepadLeftThumbstickRight = 0xD5 , kXboxOneGamepadLeftThumbstickLeft = 0xD6 , kXboxOneGamepadRightThumbstickUp = 0xD7 , kXboxOneGamepadRightThumbstickDown = 0xD8 , kXboxOneGamepadRightThumbstickRight = 0xD9 , kXboxOneGamepadRightThumbstickLeft = 0xDA , kOem4 = 0xDB , kOem5 = 0xDC , kOem6 = 0xDD , kOem7 = 0xDE , kOem8 = 0xDF , kOemAx = 0xE1 , kOem102 = 0xE2 , kIcoHelp = 0xE3 , kIco00 = 0xE4 , kProcessKey = 0xE5 , kIcoClear = 0xE6 , kPacket = 0xE7 , kOemReset = 0xE9 , kOemJump = 0xEA , kOemPa1 = 0xEB , kOemPa2 = 0xEC , kOemPa3 = 0xED , kOemWsCtrl = 0xEE , kOemCuSel = 0xEF , kOemAttn = 0xF0 , kOemFinish = 0xF1 , kOemCopy = 0xF2 , kOemAuto = 0xF3 , kOemEnlW = 0xF4 , kOemBackTab = 0xF5 , kAttn = 0xF6 , kCrSel = 0xF7 , kExSel = 0xF8 , kErEof = 0xF9 , kPlay = 0xFA , kZoom = 0xFB , kNoName = 0xFC , kPa1 = 0xFD , kOemClear = 0xFE , kXInputPadA = 0x5800 , kXInputPadB = 0x5801 , kXInputPadX = 0x5802 , kXInputPadY = 0x5803 , kXInputPadRShoulder = 0x5804 , kXInputPadLShoulder = 0x5805 , kXInputPadLTrigger = 0x5806 , kXInputPadRTrigger = 0x5807 , kXInputPadDPadUp = 0x5810 , kXInputPadDPadDown = 0x5811 , kXInputPadDPadLeft = 0x5812 , kXInputPadDPadRight = 0x5813 , kXInputPadStart = 0x5814 , kXInputPadBack = 0x5815 , kXInputPadLThumbPress = 0x5816 , kXInputPadRThumbPress = 0x5817 , kXInputPadLThumbUp = 0x5820 , kXInputPadLThumbDown = 0x5821 , kXInputPadLThumbRight = 0x5822 , kXInputPadLThumbLeft = 0x5823 , kXInputPadLThumbUpLeft = 0x5824 , kXInputPadLThumbUpRight = 0x5825 , kXInputPadLThumbDownRight = 0x5826 , kXInputPadLThumbDownLeft = 0x5827 , kXInputPadRThumbUp = 0x5830 , kXInputPadRThumbDown = 0x5831 , kXInputPadRThumbRight = 0x5832 , kXInputPadRThumbLeft = 0x5833 , kXInputPadRThumbUpLeft = 0x5834 , kXInputPadRThumbUpRight = 0x5835 , kXInputPadRThumbDownRight = 0x5836 , kXInputPadRThumbDownLeft = 0x5837 } |
| enum class | PointerMode : u8 { kFree , kHidden , kLocked } |
| enum class | MouseButton : u8 { kLeft , kRight , kMiddle , kX1 , kX2 , kNone } |
| enum class | KeyModifiers : u8 { kNone = 0 , kShift = 1 , kCtrl = 2 , kAlt = 4 } |
| enum class | InputSourceType : u8 { kKey , kMouseWheel , kPadButton , kPadAxes } |
| enum class | PadInput : u8 { kDpadUp , kDpadDown , kDpadLeft , kDpadRight , kStart , kBack , kLeftStickPress , kRightStickPress , kA , kB , kX , kY , kLeftTrigger , kRightTrigger , kLeftShoulder , kRightShoulder , kLeftStickUp , kLeftStickDown , kLeftStickRight , kLeftStickLeft , kRightStickUp , kRightStickDown , kRightStickRight , kRightStickLeft } |
| enum class | PadAxes : u8 { kNone , kLeft , kRight } |
| enum class | MessageType : u8 { kInfo , kWarning , kError } |
| enum class | ErrorCategory : u8 { kNoError , kIO , kMemory , kFormat , kCrypto , kCompression , kRuntime , kPlatform , kConfig , kValidation , kNotFound , kNotImplemented , kModule } |
| enum class | SettingType : u8 { kBool , kI32 , kI64 , kU32 , kU64 , kF64 , kString , kPath } |
| enum class | SettingLayer : u8 { kDefault , kTitle , kFile , kEnvironment , kCommandLine , kRuntime , kLock } |
| enum class | SettingLife : u8 { kLive , kRestart , kStartupOnly , kUntilLaunch } |
Functions | |
| template<typename T> | |
| constexpr bool | is_pow2 (T value) |
| template<typename T> | |
| T | next_pow2 (T value) |
| constexpr u32 | MakeBitmask (u32 a, u32 b) |
| constexpr u32 | select_bits (u32 value, u32 a, u32 b) |
| template<class T> | |
| constexpr u32 | BitCount (T v) |
| u8 | lzcnt (u8 v) |
| u8 | lzcnt (u16 v) |
| u8 | lzcnt (u32 v) |
| u8 | lzcnt (u64 v) |
| u8 | tzcnt (u8 v) |
| u8 | tzcnt (u16 v) |
| u8 | tzcnt (u32 v) |
| u8 | tzcnt (u64 v) |
| u8 | lzcnt (i8 v) |
| u8 | lzcnt (i16 v) |
| u8 | lzcnt (i32 v) |
| u8 | lzcnt (i64 v) |
| u8 | tzcnt (i8 v) |
| u8 | tzcnt (i16 v) |
| u8 | tzcnt (i32 v) |
| u8 | tzcnt (i64 v) |
| bool | bit_scan_forward (u32 v, u32 *out_first_set_index) |
| bool | bit_scan_forward (u64 v, u32 *out_first_set_index) |
| bool | bit_scan_forward (i32 v, u32 *out_first_set_index) |
| bool | bit_scan_forward (i64 v, u32 *out_first_set_index) |
| template<typename T> | |
| T | log2_floor (T v) |
| template<typename T> | |
| T | log2_ceil (T v) |
| template<typename T> | |
| T | RotateLeft (T v, u8 sh) |
| template<typename Block> | |
| std::pair< size_t, size_t > | GetNextRangeUnset (const Block *bits, size_t first, size_t length) |
| template<typename Block> | |
| void | SetRange (Block *bits, size_t first, size_t length) |
| template<FlagsEnum E> | |
| constexpr E | operator| (E lhs, E rhs) |
| template<FlagsEnum E> | |
| constexpr E | operator& (E lhs, E rhs) |
| template<FlagsEnum E> | |
| constexpr E | operator^ (E lhs, E rhs) |
| template<FlagsEnum E> | |
| constexpr E | operator~ (E value) |
| template<FlagsEnum E> | |
| constexpr E & | operator|= (E &lhs, E rhs) |
| template<FlagsEnum E> | |
| constexpr E & | operator&= (E &lhs, E rhs) |
| template<FlagsEnum E> | |
| constexpr E & | operator^= (E &lhs, E rhs) |
| template<FlagsEnum E> | |
| constexpr bool | HasFlags (E value, E flags) |
| template<typename Dst, typename Src> | |
| void | Reinterpret (Dst &REX_RESTRICT_VAR dst, const Src &REX_RESTRICT_VAR src) |
| template<typename Dst, typename Src> | |
| Dst | Reinterpret (const Src &REX_RESTRICT_VAR src) |
| bool | AreBitsEqual (std::span< const f32 > a, std::span< const f32 > b) |
| u64 | DecodeFATTimestamp (u32 date, u32 time) |
| std::string_view | GetGraphicsFamilyName (GraphicsFamily family) |
| std::vector< std::string > | GetDriverModules (DriverType type, std::string_view names, GraphicsFamily family=GraphicsFamily::kNone, IInterfaceFactory *connected=nullptr) |
| Result< std::vector< std::unique_ptr< IDriver > > > | SelectDrivers (IInterfaceFactory &factory, DriverType type, std::string_view names, IDriverContext &context) |
| u64 | HashXXH3 (std::span< const u8 > data) |
| std::string | HashBytes (std::string_view data) |
| std::string | HashFile (const std::filesystem::path &path) |
| size_t | hash_combine (size_t hash) |
| template<typename T, typename... Ts> | |
| size_t | hash_combine (size_t hash, const T &v, const Ts &... vs) |
| Result< void > | Init (const Config &config) |
| void | Stop () |
| void | Shutdown () |
| VirtualKey | ParseVirtualKey (std::string_view name) |
| std::string | VirtualKeyToString (VirtualKey key) |
| constexpr bool | IsSameInput (const InputSource &left, const InputSource &right) |
| std::string_view | GetPadButtonName (PadInput button) |
| Result< InputSource > | ParseInputSource (std::string_view text) |
| std::string | InputSourceToString (const InputSource &source) |
| Result< KeyChord > | ParseKeyChord (std::string_view text) |
| Result< std::vector< KeyChord > > | ParseKeyChordList (std::string_view text) |
| std::string | KeyChordToString (KeyChord chord) |
| Logger & | GetLogger () |
| template<typename T, size_t N> | |
| constexpr size_t | CountOf (T(&)[N]) noexcept |
| template<typename T> | |
| constexpr T | RoundUpPow2 (T value, T alignment) |
| template<typename T, typename V> | |
| constexpr T | RoundUp (T value, V multiple) |
| template<typename T, typename V> | |
| constexpr T | RoundUpNonZero (T value, V multiple) |
| template<typename T> | |
| T | clamp_float (T value, T min_value, T max_value) |
| template<typename T> | |
| T | saturate (T value) |
| template<typename T> | |
| constexpr void | reduce_fraction (T &numerator, T &denominator) |
| template<typename T> | |
| constexpr void | reduce_fraction (std::pair< T, T > &fraction) |
| constexpr u64 | mul_div (u64 value, u64 numerator, u64 denominator) |
| template<typename T> | |
| T | SatAdd (T a, T b) |
| template<typename T> | |
| T | SatSub (T a, T b) |
| template<typename... Interfaces, typename Module> | |
| IInterface * | FindModuleInterface (Module &module, std::string_view name, u32 version) |
| PathSettings & | GetPathSettings () |
| void | ShowMessageBox (MessageType type, std::string_view message) |
| void | InitializeSEHThread () |
| void | InitializeSEH () |
| template<typename T> | |
| Result< T > | Ok (T &&value) |
| Result< void > | Ok () |
| template<typename T = void> | |
| auto | Err (Error error) |
| template<typename T = void> | |
| auto | Err (ErrorCategory category, std::string message, int code=0) |
| SettingsRegistry & | GetSettingsRegistry () |
| template<class T> | |
| constexpr T | byte_swap (T value) noexcept |
| constexpr size_t | operator""_KiB (unsigned long long int x) |
| constexpr size_t | operator""_MiB (unsigned long long int x) |
| constexpr size_t | operator""_GiB (unsigned long long int x) |
| constexpr size_t | operator""_TiB (unsigned long long int x) |
| constexpr size_t | operator""_PiB (unsigned long long int x) |
Variables | |
| template<typename E> | |
| constexpr bool | is_flags_enum = false |
| template<> | |
| constexpr bool | is_flags_enum< KeyModifiers > = true |
| constexpr u8 | kPadButtonCount = 24 |
| constexpr const char * | kCreateInterfaceSymbol = "ReXCreateInterface" |
| constexpr const char * | kEnumerateInterfacesSymbol = "ReXEnumerateInterfaces" |
| constexpr const char * | kBuildIdentitySymbol = "ReXBuildIdentity" |
| constexpr SettingLife | kRestart = SettingLife::kRestart |
| constexpr SettingLife | kStartupOnly = SettingLife::kStartupOnly |
| constexpr SettingLife | kUntilLaunch = SettingLife::kUntilLaunch |
| constexpr struct rex::NoSave | kNoSave |
| constexpr struct rex::DebugOnly | kDebugOnly |
| constexpr struct rex::KeyChordTrait | kKeyChord |
| template<typename T> | |
| constexpr bool | is_be_type_v = IsBEType<T>::value |
Xenia : Xbox 360 Emulator Research Project *
Copyright 2013 Ben Vanik. All rights reserved. * Released under the BSD license - see LICENSE in the root for more details. *
| using rex::be_i8 = i8 |
Single byte, which needs no byte swap.
| using rex::be_u8 = u8 |
Single byte, which needs no byte swap.
| using rex::CreateInterfaceFn = IInterface* (*)(const char* name, u32 version) |
The type of ReXCreateInterface. Returns null when the module serves no such interface.
| using rex::EnumerateInterfacesFn = u32 (*)(InterfaceType* out, u32 capacity) |
The type of ReXEnumerateInterfaces. Returns the total count and writes at most capacity.
| using rex::HundredNano = std::ratio<1, 10000000> |
Ratio of 1 FILETIME tick, 100ns, to 1 second.
| using rex::HundredNanoseconds = std::chrono::duration<i64, HundredNano> |
Duration in 100ns FILETIME ticks.
| using rex::MoveOnlyFunction = typename detail::MoveOnlyFunctionFor<Signature>::type |
Owning holder for a callable that may be move only.
| Signature | The call signature, R(Args...) or R(Args...) const. |
| using rex::Result = std::expected<T, Error> |
Value or Error returned by an operation that can fail.
| T | The success value type, or void. |
| using rex::WinSystemClock = detail::NtSystemClock<detail::Domain::kHost> |
Unscaled host FILETIME clock. It converts to and from std::chrono::sys_time.
| using rex::XSystemClock = detail::NtSystemClock<detail::Domain::kGuest> |
Scaled guest FILETIME clock. Convert it with clock_cast to WinSystemClock.
|
strong |
| Enumerator | |
|---|---|
| kGraphics | rex::gpu::IGraphicsDriver, run by GraphicsSystem. |
| kAudio | rex::apu::IAudioDriver, run by AudioSystem. |
| kInput | rex::hid::IInputDriver, run by InputSystem. Several may be active. |
| kUI | rex::ui::IUIDriver, run by UISystem. |
|
strong |
Broad classification of an error. Codes go in Error::code.
| Enumerator | |
|---|---|
| kMemory | Memory allocation or mapping. |
| kFormat | File format parsing (XEX, PE, ELF). |
| kCrypto | Cryptography (decryption, signature). |
| kRuntime | rex::kernel::TitleRuntime execution. |
| kValidation | Validation, for example unresolved functions. |
| kModule | Module loading, connection or initialization. |
|
strong |
The graphics family a title needs. It names the modules rexgpu-<family>-<name>.
|
strong |
The types of input a binding can name. Mouse buttons are keys with their VirtualKey.
| Enumerator | |
|---|---|
| kKey | A keyboard key or mouse button, code is a VirtualKey. |
| kMouseWheel | A mouse wheel direction, sign gives the direction. |
| kPadButton | A pad button or a stick direction as a button, code is a PadInput. |
| kPadAxes | A whole pad stick, code is a PadAxes. |
|
strong |
Severity of a message box, which picks its icon.
|
strong |
|
strong |
Pad buttons in the order input sources and capture masks number them.
|
strong |
|
strong |
Where a setting's value came from, lowest first. A higher layer wins. kLock refuses writes.
|
strong |
|
strong |
|
strong |
Windows and XInput virtual keys. Platform keys translate to it for keystrokes and UI events.
|
inline |
Compares two runs of floats by bit pattern, so a NaN equals itself.
|
inline |
Finds the lowest set bit, like the x86 BSF instruction.
| v | The value to scan, read as unsigned. |
| out_first_set_index | Receives the index of the lowest set bit. |
|
inline |
Finds the lowest set bit, like the x86 BSF instruction.
| v | The value to scan, read as unsigned. |
| out_first_set_index | Receives the index of the lowest set bit. |
|
inline |
Finds the lowest set bit, like the x86 BSF instruction.
| out_first_set_index | Receives the index of the lowest set bit. |
|
inline |
Finds the lowest set bit, like the x86 BSF instruction.
| out_first_set_index | Receives the index of the lowest set bit. |
|
constexpr |
Returns the number of set bits in a value.
| T | Unsigned integer type. |
|
constexprnoexcept |
Reverses the byte order of a trivially copyable value of 1, 2, 4 or 8 bytes.
| T rex::clamp_float | ( | T | value, |
| T | min_value, | ||
| T | max_value ) |
Clamps a floating point value. NaN becomes min_value, or max_value when min_value is NaN too. A result at a zero bound takes the sign of that bound.
| T | Floating point type. The lower clamp narrows through f32. |
|
inline |
Converts a FAT date and time to Windows FILETIME ticks.
| date | FAT date, 7 bits of years since 1980, 4 bits of month, 5 bits of day. |
| time | FAT time, 5 bits of hours, 6 bits of minutes, 5 bits of 2 second units. |
|
inline |
Builds a failed result.
| T | The success value type of the result, void by default. |
|
inline |
Builds a failed result from the parts of an Error.
| T | The success value type of the result, void by default. |
| code | Code from the platform or a library. |
| IInterface * rex::FindModuleInterface | ( | Module & | module, |
| std::string_view | name, | ||
| u32 | version ) |
Finds an interface among those a module class derives from, for QueryInterface.
| Interfaces | The interfaces the module serves besides IModule. |
| version | The version, matched exactly. |
|
nodiscard |
Names the modules that serve the drivers of a type, in list order.
| names | Driver names separated by commas. Empty names, "none" and repeats are skipped. |
| family | The family of a graphics driver, kNone for the other types. |
| connected | Connected modules. Their registered names are skipped. Null skips none. |
|
nodiscard |
Returns the module name text of a graphics family, empty for kNone.
| Logger & rex::GetLogger | ( | ) |
Returns the process logger, starting it on the first call.
| std::pair< size_t, size_t > rex::GetNextRangeUnset | ( | const Block * | bits, |
| size_t | first, | ||
| size_t | length ) |
Finds the first run of clear bits in a range.
| Block | Unsigned word type of the bit array. |
| bits | The bit array. |
| first | Index of the first bit to search. |
| length | Number of bits to search starting at first. |
| std::string_view rex::GetPadButtonName | ( | PadInput | button | ) |
Returns the name of a pad button in binding text, or empty for a value outside PadInput.
| PathSettings & rex::GetPathSettings | ( | ) |
Returns the path settings. The first call registers them.
|
nodiscardconstexpr |
Reports whether a set holds every flag of another set.
|
inline |
Ends the hash_combine recursion.
| size_t rex::hash_combine | ( | size_t | hash, |
| const T & | v, | ||
| const Ts &... | vs ) |
Mixes the std::hash of each value into a hash value.
| std::string rex::HashBytes | ( | std::string_view | data | ) |
128 bit XXH3 digest for fingerprints and cache keys, not for security use.
| data | The bytes to hash. |
| std::string rex::HashFile | ( | const std::filesystem::path & | path | ) |
128 bit XXH3 digest over the contents of a file.
| u64 rex::HashXXH3 | ( | std::span< const u8 > | data | ) |
64 bit XXH3 hash for hash tables and keys, not for security use.
| data | The bytes to hash. |
Loads and connects the listed modules in order, loads the plugins, then inits every module. A module that requires an interface only a later module serves fails at Connect. A failure shuts down and disconnects the modules in reverse. After Stop, Init runs the pending Shutdown first.
| std::string rex::InputSourceToString | ( | const InputSource & | source | ) |
Writes a source as binding text, modifiers in the order Shift, Ctrl, Alt and then the name.
|
constexpr |
Reports whether a value is a power of 2 or 0.
|
constexpr |
Compares what two sources read, ignoring the stick row slot.
| std::string rex::KeyChordToString | ( | KeyChord | chord | ) |
Writes a chord as text, modifiers in the order Shift, Ctrl, Alt and then the key name.
|
inline |
Returns the base 2 logarithm of a value rounded up.
| v | A value greater than 0. |
|
inline |
Returns the base 2 logarithm of a value rounded down.
| v | A value greater than 0. |
|
inline |
Returns the number of leading zero bits in a signed 16 bit value, or 16 when v is 0.
| v | The value to scan, read as unsigned. |
|
inline |
Returns the number of leading zero bits in a signed 32 bit value, or 32 when v is 0.
| v | The value to scan, read as unsigned. |
|
inline |
Returns the number of leading zero bits in a signed 64 bit value, or 64 when v is 0.
| v | The value to scan, read as unsigned. |
|
inline |
Returns the number of leading zero bits in a signed 8 bit value, or 8 when v is 0.
| v | The value to scan, read as unsigned. |
|
inline |
Returns the number of leading zero bits in a 16 bit value, or 16 when v is 0.
|
inline |
Returns the number of leading zero bits in a 32 bit value, or 32 when v is 0.
|
inline |
Returns the number of leading zero bits in a 64 bit value, or 64 when v is 0.
|
inline |
Returns the number of leading zero bits in an 8 bit value, or 8 when v is 0.
|
constexpr |
Returns a mask with a contiguous range of bits set.
| a | Index of the lowest set bit. |
| b | Index of the highest set bit. |
|
constexpr |
Multiplies a value by a fraction using a 128 bit product.
| denominator | The fraction denominator, not 0. |
| T rex::next_pow2 | ( | T | value | ) |
Returns the smallest power of 2 greater than or equal to a value.
| T | Unsigned integer type up to 32 bits. |
|
inlinenodiscard |
Builds a successful result with no value.
|
inlinenodiscard |
Builds a successful result holding a value.
| value | The value, forwarded into the result. |
|
constexpr |
Returns a size in bytes from a count of gibibytes.
|
constexpr |
Returns a size in bytes from a count of kibibytes.
|
constexpr |
Returns a size in bytes from a count of mebibytes.
|
constexpr |
Returns a size in bytes from a count of pebibytes.
|
constexpr |
Returns a size in bytes from a count of tebibytes.
|
constexpr |
Keeps only the flags of a set that another set holds, in place.
|
constexpr |
Toggles flags of a set in place.
|
constexpr |
Adds flags to a set in place.
|
nodiscard |
Parses one input such as "Shift+W", "LMB", "WheelUp", "PadA" or "LStick". Key text follows ParseKeyChord and pad names take no modifiers. Names are case sensitive.
Parses a chord such as "F3", "Shift+Up" or "Ctrl+Alt+K". The prefixes Shift, Ctrl, Control and Alt come in any order, then exactly one key name that ParseVirtualKey accepts. Names are case sensitive. An empty string is the unbound chord.
Parses a comma separated list of chords such as "Q,I" or "Shift+W, A". Spaces and tabs around an item are discarded and empty items are skipped.
| VirtualKey rex::ParseVirtualKey | ( | std::string_view | name | ) |
Parses a key name.
| name | A key name such as "F3", "Backtick", "A" or "Escape". |
|
constexpr |
Divides a fraction by the greatest common divisor of its terms.
| fraction | The numerator and denominator, reduced in place. |
|
constexpr |
Divides a fraction by the greatest common divisor of its terms.
| numerator | The numerator, reduced in place. |
| denominator | The denominator, reduced in place. |
| Dst rex::Reinterpret | ( | const Src &REX_RESTRICT_VAR | src | ) |
Returns the bits of a trivially copyable object as another type of the same size.
| void rex::Reinterpret | ( | Dst &REX_RESTRICT_VAR | dst, |
| const Src &REX_RESTRICT_VAR | src ) |
Copies the bits of one trivially copyable object into another of the same size.
|
inline |
Rotates a value left.
| T | Unsigned integer type. |
| sh | Rotation amount in bits, between 1 and the bit width of T minus 1. |
|
constexpr |
Rounds up to any multiple. 0 stays 0, as with RoundUpPow2.
| multiple | The multiple to round to, any positive value. |
|
constexpr |
Rounds up to any multiple. 0 becomes one multiple, so a size of 0 takes space.
| multiple | The multiple to round to, any positive value. |
|
constexpr |
Rounds up to a power of 2 alignment. 0 stays 0.
| alignment | Power of 2 alignment. |
|
inline |
Saturating addition, from https://locklessinc.com/articles/sat_arithmetic/
|
inline |
Saturating subtraction, from https://locklessinc.com/articles/sat_arithmetic/
| T rex::saturate | ( | T | value | ) |
Clamps to [0, 1] with shading language rules. NaN becomes +0.
|
constexpr |
Returns a range of bits of a value, shifted down to bit 0.
| a | Index of the lowest bit to extract. |
| b | Index of the highest bit to extract. |
|
nodiscard |
Creates and initializes the drivers of a type, in list order.
| factory | The factory that finds the connected modules. |
| names | Driver names separated by commas. Empty, or only "none", selects no driver. |
| context | The context each driver initializes with. |
| void rex::SetRange | ( | Block * | bits, |
| size_t | first, | ||
| size_t | length ) |
Sets every bit in a range.
| Block | Unsigned word type of the bit array. |
| bits | The bit array. |
| first | Index of the first bit to set. |
| length | Number of bits to set starting at first. |
| void rex::ShowMessageBox | ( | MessageType | type, |
| std::string_view | message ) |
Shows a native message box and blocks until it closes. On POSIX it writes to stderr instead.
| type | The icon and severity. |
| message | The UTF-8 text. |
| void rex::Shutdown | ( | ) |
Runs Stop if needed, unloads the modules and ends the settings and logger sessions.
| void rex::Stop | ( | ) |
Shuts down and disconnects every module in reverse order and makes AppInterfaces::Get return null. The libraries, settings and logger stay open until Shutdown. Does nothing when called again or before Init.
|
inline |
Returns the number of trailing zero bits in a signed 16 bit value, or 16 when v is 0.
| v | The value to scan, read as unsigned. |
|
inline |
Returns the number of trailing zero bits in a signed 32 bit value, or 32 when v is 0.
| v | The value to scan, read as unsigned. |
|
inline |
Returns the number of trailing zero bits in a signed 64 bit value, or 64 when v is 0.
| v | The value to scan, read as unsigned. |
|
inline |
Returns the number of trailing zero bits in a signed 8 bit value, or 8 when v is 0.
| v | The value to scan, read as unsigned. |
|
inline |
Returns the number of trailing zero bits in a 16 bit value, or 16 when v is 0.
|
inline |
Returns the number of trailing zero bits in a 32 bit value, or 32 when v is 0.
|
inline |
Returns the number of trailing zero bits in a 64 bit value, or 64 when v is 0.
|
inline |
Returns the number of trailing zero bits in an 8 bit value, or 8 when v is 0.
| std::string rex::VirtualKeyToString | ( | VirtualKey | key | ) |
|
inlineconstexpr |
Opts an enum into the flag operators.
|
inlineconstexpr |
The symbol a module exports to report the SDK build it was compiled against. The loader logs the text and does not compare it. A module loads on the interface names and versions it serves and requires.
|
inlineconstexpr |
The symbol a module exports to hand over its interfaces.
|
inlineconstexpr |
The symbol a module exports to list its interfaces.