Add basic ortho and perspective projection APIs to love.graphics.

- Added love.graphics.setOrthoProjection.
- Added love.graphics.setPerspectiveProjection.
- Added love.graphics.resetProjection.

Note that the projection is reset whenever the canvas changes.
This commit is contained in:
Alex Szpakowski
2022-01-08 22:56:21 -04:00
parent 7f3538d2ba
commit ff83ee6a9c
8 changed files with 219 additions and 15 deletions
+1 -1
View File
@@ -1081,7 +1081,7 @@ void Shader::updateBuiltinUniforms(love::graphics::Graphics *gfx, int viewportW,
BuiltinUniformData data;
data.transformMatrix = gfx->getTransform();
data.projectionMatrix = gfx->getProjection();
data.projectionMatrix = gfx->getDeviceProjection();
// The normal matrix is the transpose of the inverse of the rotation portion
// (top-left 3x3) of the transform matrix.