public void glShaderSource(int shader, java.lang.String[] source) { int count = (null!=source)?source.length:0; if(count<=0) { throw new GLException("Method \"glShaderSource\" called with invalid length of source: "+count); } IntBuffer length = BufferUtil.newIntBuffer(count); for(int i=0; i=binLength) { throw new GLException("Method \"glShaderBinary\" without binary (limit == 0)"); } try { glShaderBinary(shaderNum, shaders, binFormat, bin, binLength); } catch (Exception e) { } } /** * Wrapper for glShaderBinary and glShaderSource. * Tries binary first, if not null, then the source code, if not null. * The binary trial will fail in case no binary interface exist (GL2 profile), * hence the fallback to the source code. */ public void glShaderBinaryOrSource(IntBuffer shaders, int binFormat, java.nio.Buffer bin, java.lang.String[][] sources) { int shaderNum = shaders.limit(); if(shaderNum<=0) { throw new GLException("Method \"glShaderBinaryOrSource\" called with shaders number <= 0"); } if(null!=bin) { try { glShaderBinary(shaders, binFormat, bin); return; // done } catch (Exception e) { } } if(null!=sources) { glShaderSource(shaders, sources); return; // done } throw new GLException("Method \"glShaderBinaryOrSource\" without binary nor source"); }