gpu: error when shader creation fails

This commit is contained in:
Adam
2020-08-30 18:02:43 -04:00
parent c79c8f55e0
commit 45bbf31fe9

View File

@@ -71,6 +71,11 @@ public class Shader
{
Unit unit = units.get(i);
int shader = gl.glCreateShader(unit.type);
if (shader == 0)
{
throw new ShaderException("Unable to create shader of type " + unit.type);
}
String source = template.load(unit.filename);
gl.glShaderSource(shader, 1, new String[]{source}, null);
gl.glCompileShader(shader);