mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge remote-tracking branch 'origin/fix-gl-matrix' into overlay
This commit is contained in:
commit
c8cc3a46b3
1 changed files with 4 additions and 0 deletions
|
@ -75,6 +75,8 @@ void GLBackend::syncTransformStateCache() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLBackend::updateTransform() {
|
void GLBackend::updateTransform() {
|
||||||
|
GLint originalMatrixMode;
|
||||||
|
glGetIntegerv(GL_MATRIX_MODE, &originalMatrixMode);
|
||||||
// Check all the dirty flags and update the state accordingly
|
// Check all the dirty flags and update the state accordingly
|
||||||
if (_transform._invalidProj) {
|
if (_transform._invalidProj) {
|
||||||
_transform._transformCamera._projection = _transform._projection;
|
_transform._transformCamera._projection = _transform._projection;
|
||||||
|
@ -132,6 +134,7 @@ void GLBackend::updateTransform() {
|
||||||
(void) CHECK_GL_ERROR();
|
(void) CHECK_GL_ERROR();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (_transform._invalidModel || _transform._invalidView) {
|
if (_transform._invalidModel || _transform._invalidView) {
|
||||||
if (_transform._lastMode != GL_MODELVIEW) {
|
if (_transform._lastMode != GL_MODELVIEW) {
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
@ -160,6 +163,7 @@ void GLBackend::updateTransform() {
|
||||||
|
|
||||||
// Flags are clean
|
// Flags are clean
|
||||||
_transform._invalidView = _transform._invalidProj = _transform._invalidModel = false;
|
_transform._invalidView = _transform._invalidProj = _transform._invalidModel = false;
|
||||||
|
glMatrixMode(originalMatrixMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue