GLState: workaround for canvas resize artifacts on desktop, fixes #5
This commit is contained in:
parent
ec4fa0ed5f
commit
92c10edb11
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
|
* Copyright 2016 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@ -19,6 +20,7 @@ package org.oscim.renderer;
|
|||||||
import static org.oscim.backend.GLAdapter.gl;
|
import static org.oscim.backend.GLAdapter.gl;
|
||||||
|
|
||||||
import org.oscim.backend.GL;
|
import org.oscim.backend.GL;
|
||||||
|
import org.oscim.backend.GLAdapter;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -149,12 +151,15 @@ public class GLState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setClearColor(float[] color) {
|
public static void setClearColor(float[] color) {
|
||||||
if (clearColor != null &&
|
// Workaround for artifacts at canvas resize on desktop
|
||||||
color[0] == clearColor[0] &&
|
if (!GLAdapter.GDX_DESKTOP_QUIRKS) {
|
||||||
color[1] == clearColor[1] &&
|
if (clearColor != null &&
|
||||||
color[2] == clearColor[2] &&
|
color[0] == clearColor[0] &&
|
||||||
color[3] == clearColor[3])
|
color[1] == clearColor[1] &&
|
||||||
return;
|
color[2] == clearColor[2] &&
|
||||||
|
color[3] == clearColor[3])
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
clearColor = color;
|
clearColor = color;
|
||||||
gl.clearColor(color[0], color[1], color[2], color[3]);
|
gl.clearColor(color[0], color[1], color[2], color[3]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user