public static String getMethodReturnType(MethodDeclaration method, GLreturn return_annotation, boolean buffer) { ParameterDeclaration return_param = null; for ( ParameterDeclaration param : method.getParameters() ) { if ( param.getSimpleName().equals(return_annotation.value()) ) { return_param = param; break; } } if ( return_param == null ) throw new RuntimeException("The @GLreturn parameter \"" + return_annotation.value() + "\" could not be found in method: " + method); PrimitiveType.Kind kind = NativeTypeTranslator.getPrimitiveKindFromBufferClass(Utils.getJavaType(return_param.getType())); if ( return_param.getAnnotation(GLboolean.class) != null ) kind = PrimitiveType.Kind.BOOLEAN; if ( kind == PrimitiveType.Kind.BYTE && (return_param.getAnnotation(GLchar.class) != null || return_param.getAnnotation(GLcharARB.class) != null) ) return "String"; else { final String type = JavaTypeTranslator.getPrimitiveClassFromKind(kind).getName(); return buffer ? Character.toUpperCase(type.charAt(0)) + type.substring(1) : type; } }
static boolean isReturnParameter(MethodDeclaration method, ParameterDeclaration param) { GLreturn string_annotation = method.getAnnotation(GLreturn.class); if ( string_annotation == null || !string_annotation.value().equals(param.getSimpleName()) ) return false; if ( param.getAnnotation(OutParameter.class) == null ) throw new RuntimeException("The parameter specified in @GLreturn is not annotated with @OutParameter in method: " + method); if ( param.getAnnotation(Check.class) != null ) throw new RuntimeException("The parameter specified in @GLreturn is annotated with @Check in method: " + method); if ( param.getAnnotation(GLchar.class) != null && Utils.getJavaType(param.getType()).equals(ByteBuffer.class) && string_annotation.maxLength().length() == 0 ) throw new RuntimeException("The @GLreturn annotation is missing a maxLength parameter in method: " + method); return true; }
@GLuint int glGetDebugMessageLogARB(@GLuint int count, @AutoSize(value = "messageLog", canBeNull = true) @GLsizei int logSize, @Check(value = "count", canBeNull = true) @GLenum IntBuffer sources, @Check(value = "count", canBeNull = true) @GLenum IntBuffer types, @Check(value = "count", canBeNull = true) @GLuint IntBuffer ids, @Check(value = "count", canBeNull = true) @GLenum IntBuffer severities, @Check(value = "count", canBeNull = true) @GLsizei IntBuffer lengths, @Check(canBeNull = true) @OutParameter @GLchar ByteBuffer messageLog);
@Reuse("GL33") void glBindFragDataLocationIndexed(@GLuint int program, @GLuint int colorNumber, @GLuint int index, @NullTerminated @Const @GLchar ByteBuffer name);
@Reuse("GL33") int glGetFragDataIndex(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
void glGetDriverControlStringQCOM(@GLuint int driverControl, @AutoSize(value = "driverControlString", canBeNull = true) @GLsizei int bufSize, @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length, @OutParameter @Check(canBeNull = true) @GLchar ByteBuffer driverControlString);
@Alternate("glGetDriverControlStringQCOM") @GLreturn(value = "driverControlString", maxLength = "bufSize") void glGetDriverControlStringQCOM2(@GLuint int driverControl, @GLsizei int bufSize, @OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(driverControlString_length)") IntBuffer length, @OutParameter @GLchar ByteBuffer driverControlString);
void glExtGetProgramBinarySourceQCOM(@GLuint int program, @GLenum int shadertype, @OutParameter @Check @GLchar ByteBuffer source, @OutParameter @Check("1") IntBuffer length);