libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
WutPlatform.h
1/****************************************************************************
2 * Platform Abstraction Layer (WUT driver)
3 * Daryl Borth 2026
4 * WutPlatform.h
5 ***************************************************************************/
6#pragma once
7
8#include <whb/proc.h>
9#include "../Platform.h"
10#include "WutAudioDriver.h"
11#include "WutVideoDriver.h"
12#include "WutInputDriver.h"
13#include "WutFileSystemDriver.h"
14#include "WutThreadDriver.h"
15#include "WutLoggerOSReport.h"
16#include "WutLoggerUdp.h"
17#include "WutLoggerUsbSerial.h"
18#include "../LoggerFile.h"
19
22class WutPlatform : public Platform
23{
24 public:
25 WutPlatform() {}
26
27 void init(const PlatformConfig& config) override;
28 void requestExit() override;
29 SystemEvent getSystemEvent() override;
30 Status getStatus() const override { return status; }
31 void triggerExit() override { status = Status::Exiting; }
32
33 AudioDriver* getAudio() override { return audioDriver; }
34 VideoDriver* getVideo() override { return videoDriver; }
35 InputDriver* getInput() override { return inputDriver; }
36 FileSystemDriver* getFileSystem() override { return fileSystemDriver; }
37 ThreadDriver* getThread() override { return threadDriver; }
38 Logger* getLogger() override { return logger; }
39
40 protected:
41 void shutdown() override;
42
43 private:
44 Status status = Status::Running;
45 WutAudioDriver* audioDriver = nullptr;
46 WutVideoDriver* videoDriver = nullptr;
47 WutInputDriver* inputDriver = nullptr;
48 WutFileSystemDriver* fileSystemDriver = nullptr;
49 WutThreadDriver* threadDriver = nullptr;
50 Logger* logger = nullptr;
51};
Platform audio backend GuiSound delegates to: fixed one-shot PCM voices plus one background OGG strea...
Definition AudioDriver.h:18
Storage device enumeration/mount/poll backend for the SD/USB/DVD file browser.
Platform input backend GuiElements delegate to, via the per-channel InputController objects update() ...
Definition InputDriver.h:22
Central fan-out dispatcher.
Definition Logger.h:191
Composition root for a platform.
Definition Platform.h:66
PlatformConfig config
Set by init() in every concrete Platform - store the passed-in config as the very first line of the o...
Definition Platform.h:117
Raw platform threading primitives.
Platform video backend owning the frame lifecycle (init/render/clear, screen size,...
Definition VideoDriver.h:28
Wii U AudioDriver: AX (sndcore2), 16 fixed AXVoice slots for one-shots plus a dedicated stereo stream...
SD: a plain WHBMountSdCard() FSA mount, done once in init().
Wii U InputDriver: VPAD for the GamePad (stick, buttons, and touch, channel 0 only) plus KPAD/WPAD fo...
VideoDriver * getVideo() override
Definition WutPlatform.h:34
SystemEvent getSystemEvent() override
Polls Cafe OS process events.
void shutdown() override
Shuts down and releases all five drivers.
InputDriver * getInput() override
Definition WutPlatform.h:35
ThreadDriver * getThread() override
Definition WutPlatform.h:37
Logger * getLogger() override
May return nullptr on a Platform that hasn't finished init() yet - LogPrintf()/LOG_*() already guard ...
Definition WutPlatform.h:38
AudioDriver * getAudio() override
Definition WutPlatform.h:33
void triggerExit() override
Transitions platform state to move to Exiting.
Definition WutPlatform.h:31
void requestExit() override
Tears down the platform (via shutdown()) and then performs whatever platform-appropriate action actua...
Status getStatus() const override
Current platform lifecycle state (Running, Paused, Exiting).
Definition WutPlatform.h:30
void init(const PlatformConfig &config) override
Constructs and initializes all five drivers for this platform.
FileSystemDriver * getFileSystem() override
Definition WutPlatform.h:36
Wii U ThreadDriver, built on coreinit's OSThread/OSMutex/OSCondition.
Wii U VideoDriver: GX2 + libwhb's WHBGfx* helpers.
SystemEvent
A hardware/OS-level system event a Platform can report.
Definition Platform.h:37
Status
Platform execution state.
Definition Platform.h:27
Settings passed to Platform::init().
Definition Platform.h:50