Skip to content

Commit

Permalink
added shader compilation check for ImmediateModeRenderer20 (#6321)
Browse files Browse the repository at this point in the history
* added shader compilation check

* change exception type
  • Loading branch information
mgsx-dev committed Dec 19, 2020
1 parent 56c27ad commit 3c9a574
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -22,6 +22,7 @@
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.GdxRuntimeException;

/** Immediate mode rendering class for GLES 2.0. The renderer will allow you to specify vertices on the fly and provides a default
* shader for (unlit) rendering.
Expand Down Expand Up @@ -238,6 +239,7 @@ static public ShaderProgram createDefaultShader (boolean hasNormals, boolean has
String vertexShader = createVertexShader(hasNormals, hasColors, numTexCoords);
String fragmentShader = createFragmentShader(hasNormals, hasColors, numTexCoords);
ShaderProgram program = new ShaderProgram(vertexShader, fragmentShader);
if (!program.isCompiled()) throw new GdxRuntimeException("Error compiling shader: " + program.getLog());
return program;
}
}

0 comments on commit 3c9a574

Please sign in to comment.