From 7a2ed359c860009197c919ba6850bfb605e0cb50 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Tue, 19 Jan 2021 16:27:46 -0800 Subject: [PATCH] Changed glClearColor to set on each draw call Changed glClearColor to set on each draw call Changed glClearColor color definition to global const --- core/src/main/java/com/riiablo/Client.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/riiablo/Client.java b/core/src/main/java/com/riiablo/Client.java index 76124c80..df3f2a2a 100644 --- a/core/src/main/java/com/riiablo/Client.java +++ b/core/src/main/java/com/riiablo/Client.java @@ -134,6 +134,13 @@ public class Client extends Game { private String realm; + private static final Color glClearColor; + static { + // TODO: This needs to be updated if some shader settings change to match the "new" black + final float color = 10 / 255f;//0.025f; + glClearColor = new Color(color, color, color, 1f); + } + public Client(FileHandle home) { this(home, Riiablo.DESKTOP_VIEWPORT_HEIGHT); } @@ -356,10 +363,6 @@ public class Client extends Game { setScreen(new SplashScreen()); } - // TODO: This needs to be updated if some shader settings change to match the "new" black - final float color = 10/255f;//0.025f; - Gdx.gl.glClearColor(color, color, color, 1.0f); - Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); } @@ -408,6 +411,7 @@ public class Client extends Game { @Override public void render() { + Gdx.gl.glClearColor(glClearColor.r, glClearColor.g, glClearColor.b, glClearColor.a); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); audio.update();