| 39 | float g3_GetAspectRatio() { return sAspect; } |
| 40 | |
| 41 | void g3_GetViewPortMatrix(float *viewMat) { |
| 42 | // extract the viewport data from the renderer |
| 43 | int viewportWidth, viewportHeight; |
| 44 | int viewportX, viewportY; |
| 45 | rend_GetProjectionScreenParameters(viewportX, viewportY, viewportWidth, viewportHeight); |
| 46 | |
| 47 | float viewportWidthOverTwo = ((float)viewportWidth) * 0.5f; |
| 48 | float viewportHeightOverTwo = ((float)viewportHeight) * 0.5f; |
| 49 | |
| 50 | // setup the matrix |
| 51 | memset(viewMat, 0, sizeof(float) * 16); |
| 52 | viewMat[0] = viewportWidthOverTwo; |
| 53 | viewMat[5] = -viewportHeightOverTwo; |
| 54 | viewMat[12] = viewportWidthOverTwo + (float)viewportX; |
| 55 | viewMat[13] = viewportHeightOverTwo + (float)viewportY; |
| 56 | viewMat[10] = viewMat[15] = 1.0f; |
| 57 | } |
| 58 | |
| 59 | void g3_GetProjectionMatrix(float zoom, float *projMat) { |
| 60 | // get window size |
no test coverage detected