gpu: error when shader creation fails
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user