From 3d940ba949bbd6eceb77fdbe8adf8849fcfe3029 Mon Sep 17 00:00:00 2001 From: Germain AUBERT Date: Sat, 19 Dec 2020 17:28:55 +0100 Subject: [PATCH] add cubemaps to the management, fixes #5047 --- gdx/src/com/badlogic/gdx/graphics/Cubemap.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gdx/src/com/badlogic/gdx/graphics/Cubemap.java b/gdx/src/com/badlogic/gdx/graphics/Cubemap.java index b054b2b729b..fc44a98672d 100644 --- a/gdx/src/com/badlogic/gdx/graphics/Cubemap.java +++ b/gdx/src/com/badlogic/gdx/graphics/Cubemap.java @@ -95,6 +95,7 @@ public Cubemap (CubemapData data) { super(GL20.GL_TEXTURE_CUBE_MAP); this.data = data; load(data); + if (data.isManaged()) addManagedCubemap(Gdx.app, this); } /** Construct a Cubemap with the specified texture files for the sides, does not generate mipmaps. */ @@ -137,13 +138,7 @@ public Cubemap (int width, int height, int depth, Format format) { /** Construct a Cubemap with the specified {@link TextureData}'s for the sides */ public Cubemap (TextureData positiveX, TextureData negativeX, TextureData positiveY, TextureData negativeY, TextureData positiveZ, TextureData negativeZ) { - super(GL20.GL_TEXTURE_CUBE_MAP); - minFilter = TextureFilter.Nearest; - magFilter = TextureFilter.Nearest; - uWrap = TextureWrap.ClampToEdge; - vWrap = TextureWrap.ClampToEdge; - data = new FacedCubemapData(positiveX, negativeX, positiveY, negativeY, positiveZ, negativeZ); - load(data); + this(new FacedCubemapData(positiveX, negativeX, positiveY, negativeY, positiveZ, negativeZ)); } /** Sets the sides of this cubemap to the specified {@link CubemapData}. */