/** <a target="_blank" href="http://docs.gl/es3/glShaderSource">Reference Page</a> */ public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const * const *") CharSequence... string) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { long stringAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, string); nglShaderSource(shader, string.length, stringAddress, stringAddress - (string.length << 2)); org.lwjgl.system.APIUtil.apiArrayFree(stringAddress, string.length); } finally { stack.setPointer(stackPointer); } }
/** <a target="_blank" href="http://docs.gl/es3/glShaderSource">Reference Page</a> */ public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const * const *") CharSequence string) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { long stringAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, string); nglShaderSource(shader, 1, stringAddress, stringAddress - 4); org.lwjgl.system.APIUtil.apiArrayFree(stringAddress, 1); } finally { stack.setPointer(stackPointer); } }
/** * Sets the source code for the specified shader object {@code shaderObj} to the text strings in the {@code string} array. If the object previously had * source code loaded into it, it is completely replaced. * * <p>The strings that are loaded into a shader object are expected to form the source code for a valid shader as defined in the OpenGL Shading Language * Specification.</p> * * @param shaderObj the shader object * @param string an array of pointers to one or more, optionally null terminated, character strings that make up the source code */ public static void glShaderSourceARB(@NativeType("GLhandleARB") int shaderObj, @NativeType("GLcharARB const **") CharSequence... string) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { long stringAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, string); nglShaderSourceARB(shaderObj, string.length, stringAddress, stringAddress - (string.length << 2)); org.lwjgl.system.APIUtil.apiArrayFree(stringAddress, string.length); } finally { stack.setPointer(stackPointer); } }
/** * Sets the source code in {@code shader} to the source code in the array of strings specified by {@code strings}. Any source code previously stored in the * shader object is completely replaced. The number of strings in the array is specified by {@code count}. If {@code length} is {@code NULL}, each string is * assumed to be null terminated. If {@code length} is a value other than {@code NULL}, it points to an array containing a string length for each of the * corresponding elements of {@code strings}. Each element in the length array may contain the length of the corresponding string (the null character is not * counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or * parsed at this time; they are simply copied into the specified shader object. * * @param shader the shader object whose source code is to be replaced * * @see <a target="_blank" href="http://docs.gl/gl4/glShaderSource">Reference Page</a> */ public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") CharSequence string) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { long stringsAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, string); nglShaderSource(shader, 1, stringsAddress, stringsAddress - 4); org.lwjgl.system.APIUtil.apiArrayFree(stringsAddress, 1); } finally { stack.setPointer(stackPointer); } }
/** * Sets the source code for the specified shader object {@code shaderObj} to the text strings in the {@code string} array. If the object previously had * source code loaded into it, it is completely replaced. * * <p>The strings that are loaded into a shader object are expected to form the source code for a valid shader as defined in the OpenGL Shading Language * Specification.</p> * * @param shaderObj the shader object * @param string an array of pointers to one or more, optionally null terminated, character strings that make up the source code */ public static void glShaderSourceARB(@NativeType("GLhandleARB") int shaderObj, @NativeType("GLcharARB const **") CharSequence string) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { long stringAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, string); nglShaderSourceARB(shaderObj, 1, stringAddress, stringAddress - 4); org.lwjgl.system.APIUtil.apiArrayFree(stringAddress, 1); } finally { stack.setPointer(stackPointer); } }
/** * Sets the source code in {@code shader} to the source code in the array of strings specified by {@code strings}. Any source code previously stored in the * shader object is completely replaced. The number of strings in the array is specified by {@code count}. If {@code length} is {@code NULL}, each string is * assumed to be null terminated. If {@code length} is a value other than {@code NULL}, it points to an array containing a string length for each of the * corresponding elements of {@code strings}. Each element in the length array may contain the length of the corresponding string (the null character is not * counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or * parsed at this time; they are simply copied into the specified shader object. * * @param shader the shader object whose source code is to be replaced * @param strings an array of pointers to strings containing the source code to be loaded into the shader * * @see <a target="_blank" href="http://docs.gl/gl4/glShaderSource">Reference Page</a> */ public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") CharSequence... strings) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { long stringsAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, strings); nglShaderSource(shader, strings.length, stringsAddress, stringsAddress - (strings.length << 2)); org.lwjgl.system.APIUtil.apiArrayFree(stringsAddress, strings.length); } finally { stack.setPointer(stackPointer); } }