libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
GameCubePlatform.h
1/****************************************************************************
2 * Platform Abstraction Layer (OGC driver)
3 * Daryl Borth 2026
4 * GameCubePlatform.h
5 ***************************************************************************/
6#pragma once
7
8#include "../../Platform.h"
9#include "../OgcVideoDriver.h"
10#include "../OgcInputDriver.h"
11#include "../OgcThreadDriver.h"
12#include "../OgcAudioDriver.h"
13#include "GameCubeFileSystemDriver.h"
14#include "../OgcLoggerSysReport.h"
15#include "../OgcLoggerUsbGecko.h"
16#include "../../LoggerFile.h"
17
22class GameCubePlatform : public Platform
23{
24 public:
25 GameCubePlatform() {}
26
27 void init(const PlatformConfig& config) override;
28 void requestExit() override;
29
30 SystemEvent getSystemEvent() override { return SystemEvent::None; }
31 Status getStatus() const override { return status; }
32 void triggerExit() override { status = Status::Exiting; }
33
34 AudioDriver* getAudio() override { return audioDriver; }
35 VideoDriver* getVideo() override { return videoDriver; }
36 InputDriver* getInput() override { return inputDriver; }
37 FileSystemDriver* getFileSystem() override { return fileSystemDriver; }
38 ThreadDriver* getThread() override { return threadDriver; }
39 Logger* getLogger() override { return logger; }
40
41 protected:
42 void shutdown() override;
43
44 private:
45 Status status = Status::Running;
46 OgcAudioDriver* audioDriver = nullptr;
47 OgcVideoDriver* videoDriver = nullptr;
48 OgcInputDriver* inputDriver = nullptr;
49 GameCubeFileSystemDriver* fileSystemDriver = nullptr;
50 OgcThreadDriver* threadDriver = nullptr;
51 Logger* logger = nullptr;
52};
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.
GameCube FileSystemDriver: memory card slots, GC Loader, and DVD, plus DEVICE_SMB (broadband adapter)...
void requestExit() override
Tears down the platform (via shutdown()) and then performs whatever platform-appropriate action actua...
void init(const PlatformConfig &config) override
Constructs and initializes all five drivers for this platform.
Logger * getLogger() override
May return nullptr on a Platform that hasn't finished init() yet - LogPrintf()/LOG_*() already guard ...
ThreadDriver * getThread() override
FileSystemDriver * getFileSystem() override
VideoDriver * getVideo() override
AudioDriver * getAudio() override
void triggerExit() override
Transitions platform state to move to Exiting.
void shutdown() override
Shuts down and releases all five drivers.
SystemEvent getSystemEvent() override
Current hardware/OS-level system event, if any.
InputDriver * getInput() override
Status getStatus() const override
Current platform lifecycle state (Running, Paused, Exiting).
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
GC/Wii AudioDriver: AESND-based fixed voices for one-shots, wraps a GuiSoundOggPlayer for the backgro...
GC/Wii InputDriver: PAD (GameCube) / WPAD (Wiimote, Nunchuk, Classic, Wii U Pro Controller) plus a Wi...
GC/Wii ThreadDriver, built on libogc's LWP threading primitives.
GC/Wii VideoDriver: raw GX, double-buffered XFB.
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
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