/** * @param gl * the context of this shader program. * @param shaderId * to attach to this program. * @return true iff this program and the given shader id are valid and the id could be attached to the program * (attaching is not linking!). */ public boolean attachShader( GL gl, int shaderId ) { boolean result = false; if ( isShaderIdValid( gl, shaderId ) ) { gl.glAttachShader( oglProgramId, shaderId ); result = true; } else { LOG.warn( "Either the program id: " + oglProgramId + " or the given shader id: " + shaderId + " are not valid, cannot attach the shader." ); } return result; }
/** * @param gl * the context of this shader program. * @param shaderId * to be detached from this program. * @return true iff the current program id and the given shaderId are valid and the shader could be detached from * this program. */ public boolean detachShader( GL gl, int shaderId ) { boolean result = false; if ( isShaderIdValid( gl, shaderId ) ) { gl.glDetachShader( oglProgramId, shaderId ); result = true; } else { LOG.warn( "Either the program id: " + oglProgramId + " or the given shader id: " + shaderId + " are not valid, cannot detach the shader." ); } return result; }