CGxDeviceOpenGl::LoadProjection
function · gx · host
- Address
0x59fe20· 480 bytes, up to0x59ffff- Signature
void __thiscall (CGxDeviceOpenGl *this, const float *matrix)- Meaning
- Negates the third row of a projection matrix, scales it and loads it as the OpenGL projection
- Confidence
- verified, proof one
- Finding
- gx/draw#projection-matrix
- Test
gx::proj_matrix_load_matches_binary
Finding: Projection matrix in gx: drawing
0x5a11d0 (Direct3D) and 0x59fe20 (OpenGL) take a pointer to a 4 by 4 float matrix, copy it, change it for the device and load it as the projection. Direct3D first stores the caller's matrix at [dev+0xf50] (0x5925e0), divides all sixteen elements by element 11 when that is neither 1 nor near 0, and rewrites elements 10 and 14 to the device depth range, in one form when element 15 is 0 and another when it is not. OpenGL negates elements 8 to 11, the third row. Both then multiply the matrix by a diagonal of 0.2, 0.2, 0.2, 1 when capability bit 8 of [dev+0x269c] is clear and element 15 is not 1.
The derivation is in the doc.
Callers 1
Callees 3
Calls and jumps by a bare address, from tables/calls.tsv.