libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
WiiPlatform Class Reference

Wii Platform, built on the shared GC/Wii driver set (OgcVideoDriver, OgcAudioDriver, OgcInputDriver, OgcThreadDriver) plus WiiFileSystemDriver for hot-pluggable SD/USB/DVD. More...

#include <WiiPlatform.h>

Inheritance diagram for WiiPlatform:
[legend]

Public Member Functions

void init (const PlatformConfig &config) override
 Constructs and initializes all five drivers for this platform.
 
void requestExit () override
 Tears down the platform (via shutdown()) and then performs whatever platform-appropriate action actually ends the app - return to loader/menu, power off, or just exit(), depending on how getSystemEvent() last reported and how the platform was reached.
 
SystemEvent getSystemEvent () override
 Current hardware/OS-level system event, if any.
 
Status getStatus () const override
 Current platform lifecycle state (Running, Paused, Exiting).
 
void triggerExit () override
 Transitions platform state to move to Exiting.
 
AudioDriver * getAudio () override
 
VideoDriver * getVideo () override
 
InputDriver * getInput () override
 
FileSystemDriver * getFileSystem () override
 
ThreadDriver * getThread () override
 
Logger * getLogger () override
 May return nullptr on a Platform that hasn't finished init() yet - LogPrintf()/LOG_*() already guard against this, but code calling platform->getLogger() directly should too.
 
- Public Member Functions inherited from Platform
const PlatformConfig & getConfig () const
 The PlatformConfig this platform was init()'d with.
 
bool shouldExit ()
 True once triggerExit() has been called, or the platform's own getSystemEvent() independently reports ShutdownRequested (eg.
 

Protected Member Functions

void shutdown () override
 Shuts down and releases all five drivers.
 

Additional Inherited Members

- Protected Attributes inherited from Platform
PlatformConfig config {}
 Set by init() in every concrete Platform - store the passed-in config as the very first line of the override.
 

Detailed Description

Wii Platform, built on the shared GC/Wii driver set (OgcVideoDriver, OgcAudioDriver, OgcInputDriver, OgcThreadDriver) plus WiiFileSystemDriver for hot-pluggable SD/USB/DVD.

Examples
demo.cpp.

Definition at line 27 of file WiiPlatform.h.

Constructor & Destructor Documentation

◆ WiiPlatform()

WiiPlatform::WiiPlatform ( )
inline

Definition at line 30 of file WiiPlatform.h.

Member Function Documentation

◆ getAudio()

AudioDriver * WiiPlatform::getAudio ( )
inlineoverridevirtual
Returns
the audio driver, valid once init() has run

Implements Platform.

Definition at line 39 of file WiiPlatform.h.

◆ getFileSystem()

FileSystemDriver * WiiPlatform::getFileSystem ( )
inlineoverridevirtual
Returns
the storage driver, valid once init() has run

Implements Platform.

Definition at line 42 of file WiiPlatform.h.

◆ getInput()

InputDriver * WiiPlatform::getInput ( )
inlineoverridevirtual
Returns
the input driver, valid once init() has run

Implements Platform.

Definition at line 41 of file WiiPlatform.h.

◆ getLogger()

Logger * WiiPlatform::getLogger ( )
inlineoverridevirtual

May return nullptr on a Platform that hasn't finished init() yet - LogPrintf()/LOG_*() already guard against this, but code calling platform->getLogger() directly should too.

Implements Platform.

Definition at line 44 of file WiiPlatform.h.

◆ getStatus()

Status WiiPlatform::getStatus ( ) const
inlineoverridevirtual

Current platform lifecycle state (Running, Paused, Exiting).

Implements Platform.

Definition at line 36 of file WiiPlatform.h.

◆ getSystemEvent()

SystemEvent WiiPlatform::getSystemEvent ( )
overridevirtual

Current hardware/OS-level system event, if any.

A single query rather than independent shutdown/reset flags.

Implements Platform.

Definition at line 114 of file WiiPlatform.cpp.

◆ getThread()

ThreadDriver * WiiPlatform::getThread ( )
inlineoverridevirtual
Returns
the thread driver, valid once init() has run

Implements Platform.

Definition at line 43 of file WiiPlatform.h.

◆ getVideo()

VideoDriver * WiiPlatform::getVideo ( )
inlineoverridevirtual
Returns
the video driver, valid once init() has run

Implements Platform.

Definition at line 40 of file WiiPlatform.h.

◆ init()

void WiiPlatform::init ( const PlatformConfig & config)
overridevirtual

Constructs and initializes all five drivers for this platform.

Parameters
configGUI canvas size and asset scale for this platform

Implements Platform.

Definition at line 8 of file WiiPlatform.cpp.

◆ requestExit()

void WiiPlatform::requestExit ( )
overridevirtual

Tears down the platform (via shutdown()) and then performs whatever platform-appropriate action actually ends the app - return to loader/menu, power off, or just exit(), depending on how getSystemEvent() last reported and how the platform was reached.

It does not return.

Implements Platform.

Definition at line 101 of file WiiPlatform.cpp.

◆ shutdown()

void WiiPlatform::shutdown ( )
overrideprotectedvirtual

Shuts down and releases all five drivers.

Any background Thread that might still call into a driver must be stopped and joined (eg. via Thread::JoinAll()) before calling this, since the drivers it deletes may be in active use.

Implements Platform.

Definition at line 48 of file WiiPlatform.cpp.

◆ triggerExit()

void WiiPlatform::triggerExit ( )
inlineoverridevirtual

Transitions platform state to move to Exiting.

Implements Platform.

Definition at line 37 of file WiiPlatform.h.


The documentation for this class was generated from the following files: