Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fixed] issue 832, CameraGroupStrategy is now a Disposable as it migh…

…t create a shader when GLSL 2.0 is used.

git-svn-id: http://libgdx.googlecode.com/svn/trunk@3920 6c4fd544-2939-11df-bb46-9574ba5d0bfa
  • Loading branch information...
commit 9a685c12b025995bd879ff8ff31c4b563d0935a4 1 parent 8b5b5d8
badlogicgames authored
View
11 gdx/src/com/badlogic/gdx/graphics/g3d/decals/CameraGroupStrategy.java
@@ -23,6 +23,7 @@
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.utils.Array;
+import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.Pool;
@@ -35,6 +36,9 @@
* Can produce invisible artifacts when transparent decals overlap each other.
* </p>
* <p>
+ * Needs to be explicitely disposed as it might allocate a ShaderProgram when GLSL 2.0 is used.
+ * </p>
+ * <p>
* States (* = any, EV = entry value - same as value before flush):<br/>
* <table>
* <tr>
@@ -74,7 +78,7 @@
* </tr>
* </table>
* </p> */
-public class CameraGroupStrategy implements GroupStrategy {
+public class CameraGroupStrategy implements GroupStrategy, Disposable {
private static final int GROUP_OPAQUE = 0;
private static final int GROUP_BLEND = 1;
@@ -212,4 +216,9 @@ private void createDefaultShader () {
public ShaderProgram getGroupShader (int group) {
return shader;
}
+
+ @Override
+ public void dispose () {
+ if(shader != null) shader.dispose();
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.