libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
GuiControllerDraw.h
1/****************************************************************************
2 * libgui
3 * Daryl Borth 2026
4 * GuiControllerDraw.h
5 *
6 * The pure geometry behind GuiControllerView: how a controller and its
7 * controls look in each state. No elements, no platform; tested on a host.
8 ***************************************************************************/
9#pragma once
10#include "GuiPaint.h"
11#include "GuiTheme.h"
12#include "GuiControllerLayout.h"
13
16enum class CTL_STATE {
17 NORMAL,
20 LIT_HIGHLIGHT
21};
22
27void GuiBuildControllerBody(GuiMesh& mesh, const GuiControllerLayout& layout, float scale);
28
31void GuiBuildControllerSpot(GuiMesh& mesh, const GuiControlSpot& spot, CTL_STATE state, float scale);
32
35void GuiBuildControllerStickCap(GuiMesh& mesh, const GuiControlSpot& spot, float x, float y, bool lit, float scale);
Accumulates shapes as a triangle list of MeshVertex.
void GuiBuildControllerSpot(GuiMesh &mesh, const GuiControlSpot &spot, CTL_STATE state, float scale)
Builds one control in one state (an analog stick's cap is separate, see GuiBuildControllerStickCap).
void GuiBuildControllerBody(GuiMesh &mesh, const GuiControllerLayout &layout, float scale)
Builds the resting drawing of a controller (silhouette, then every decorative control) in local coord...
void GuiBuildControllerStickCap(GuiMesh &mesh, const GuiControlSpot &spot, float x, float y, bool lit, float scale)
Builds an analog stick's cap, displaced by (x, y) (each -1 to 1) from the middle of its ring.
CTL_STATE
The look a control is drawn in.
@ HIGHLIGHT
Being edited / pointed at.
@ LIT
Pressed.
One control on a controller drawing.
A controller: its drawing size, silhouette and controls.