s_gxDevice
global · gx
- Address
0xc0ed38· 4 bytes, up to0xc0ed3b- Type
void *- Meaning
- Holds the global graphics device the facade calls
- Confidence
- verified, proof one
- Finding
- gx/device#backend-selection-and-creation
Finding: Backend selection and creation in gx: the device
0x63a230 (the console's graphics start-up) sets the device type to 1 (Direct3D), then to 0 (OpenGl) when the CVar gxApi equals OpenGl ignoring case, then to 0 when command-line flag 5 (-opengl) is present, then to 1 when flag 0 (-d3d) is present. gxApi is registered at 0x63a833 with the default value direct3d (0x864f7c). It calls GxDevCreate (0x589ac0) with the type, the window procedure 0x42cfe0 and the format record. GxDevCreate allocates and constructs a CGxDeviceOpenGl (type 0, 0x58dd70) or a CGxDeviceD3d (type 1, 0x58ba70), stores it at 0xc0ed38, and calls its slot +0x20 with the format and window procedure; on failure it calls slot +0x18 with 1 and returns 0.
The derivation is in the doc.