Pārlūkot izejas kodu

Don't create an ortho matrix when the viewport is 0 in any axis. (#1504)

* Don't create an ortho matrix when the viewport is 0 in any axis.
Not all compilers divide by 0 and return inf, some segfault.
The matrix is not used by anything when minimized, so it just needs to not be called.

* Better fix that always ensures the rlgl matrix is always valid

* Better fix that always ensures the rlgl matrix is always valid
pull/1515/head
Jeffery Myers pirms 4 gadiem
committed by GitHub
vecāks
revīzija
5d4aada526
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. +6
    -0
      src/rlgl.h

+ 6
- 0
src/rlgl.h Parādīt failu

@ -1100,6 +1100,12 @@ void rlFrustum(double left, double right, double bottom, double top, double znea
// Multiply the current matrix by an orthographic matrix generated by parameters // Multiply the current matrix by an orthographic matrix generated by parameters
void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar) void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar)
{ {
if (right - left <= 0 || bottom - top <= 0)
{
*RLGL.State.currentMatrix = MatrixIdentity();
return;
}
Matrix matOrtho = MatrixOrtho(left, right, bottom, top, znear, zfar); Matrix matOrtho = MatrixOrtho(left, right, bottom, top, znear, zfar);
*RLGL.State.currentMatrix = MatrixMultiply(*RLGL.State.currentMatrix, matOrtho); *RLGL.State.currentMatrix = MatrixMultiply(*RLGL.State.currentMatrix, matOrtho);

Notiek ielāde…
Atcelt
Saglabāt