libgui 3.00
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
OgcInputUtil.h
1/****************************************************************************
2 * Platform Abstraction Layer (OGC driver)
3 * Daryl Borth 2026
4 * OgcInputUtil.h
5 *
6 * Small helpers shared by the GameCube/Wii input code (OgcInputDriver, the
7 * Wii extension drivers and the USB controller adapters).
8 ***************************************************************************/
9#pragma once
10
11static inline float OgcClampf(float v, float lo, float hi) {
12 return (v < lo) ? lo : (v > hi) ? hi : v;
13}
14
16static inline float OgcStickToFloat(int v) {
17 return OgcClampf((float)v / 128.0f, -1.0f, 1.0f);
18}