private void prepareShaders(GL gl, GlslShader vert, GlslShader frag) throws Exception { vert.compile(gl); if (!vert.isValid(gl)) throw new Exception("vertex shader: " + vert.getInfoLog(gl)); frag.compile(gl); if (!frag.isValid(gl)) throw new Exception("fragment shader: " + frag.getInfoLog(gl)); program = gl.glCreateProgram(); attachShader(gl, frag); attachShader(gl, vert); link(gl); if (!isValid(gl)) throw new Exception(getInfoLog(gl)); }
public void attachShader(GL gl, GlslShader shader) { gl.glAttachShader(program, shader.getName()); }