Merge pull request #978 from SiboVG/issue-977
[fixes #977] Fix Storm sky image going blank
This commit is contained in:
commit
0dfd5d52c5
@ -17,6 +17,7 @@ import com.jogamp.opengl.util.texture.awt.AWTTextureIO;
|
||||
public class SkyBoxCross extends Sky {
|
||||
|
||||
private final URL imageURL;
|
||||
private GL2 previousGL = null; // GL that the textures were previously bound to
|
||||
Texture north, east, south, west, up, down;
|
||||
|
||||
public SkyBoxCross(final URL imageURL) {
|
||||
@ -40,6 +41,7 @@ public class SkyBoxCross extends Sky {
|
||||
south = AWTTextureIO.newTexture(GLProfile.getDefault(), fixBug(i.getSubimage(dx * 3, dy, dx, dy)), true);
|
||||
up = AWTTextureIO.newTexture(GLProfile.getDefault(), fixBug(i.getSubimage(dx, 0, dx, dy)), true);
|
||||
down = AWTTextureIO.newTexture(GLProfile.getDefault(), fixBug(i.getSubimage(dx, 2 * dy, dx, dy)), true);
|
||||
previousGL = gl;
|
||||
} catch (IOException e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
@ -47,7 +49,7 @@ public class SkyBoxCross extends Sky {
|
||||
|
||||
@Override
|
||||
public void draw(GL2 gl, final TextureCache cache) {
|
||||
if (north == null) {
|
||||
if (north == null || gl != previousGL) {
|
||||
loadTextures(gl);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user