writer.println(") {");
writer.println("\t\treturn ");
boolean first = true;
while ( methods.hasNext() ) {
MethodDeclaration method = methods.next();
if ( method.getAnnotation(Alternate.class) != null )
continue;
if ( !first )
writer.println(" &");
else
first = false;
optional = method.getAnnotation(Optional.class) != null;
deprecated = method.getAnnotation(DeprecatedGL.class) != null;
dependent = method.getAnnotation(Dependent.class);
writer.print("\t\t\t(");
if ( optional )
writer.print('(');
if ( deprecated )
writer.print("forwardCompatible || ");
if ( dependent != null ) {
if ( dependent.value().indexOf(',') == -1 )
writer.print("!supported_extensions.contains(\"" + dependent.value() + "\") || ");
else {
writer.print("!(false");
for ( String extension : dependent.value().split(",") )
writer.print(" || supported_extensions.contains(\"" + extension + "\")");
writer.print(") || ");
}
}
if ( deprecated || dependent != null )
writer.print('(');
writer.print(Utils.getFunctionAddressName(d, method) + " = ");
PlatformDependent platform_dependent = method.getAnnotation(PlatformDependent.class);
if ( platform_dependent != null ) {
EnumSet<Platform> platform_set = EnumSet.copyOf(Arrays.asList(platform_dependent.value()));
writer.print("GLContext.getPlatformSpecificFunctionAddress(\"");
writer.print(Platform.ALL.getPrefix() + "\", ");
writer.print("new String[]{");
Iterator<Platform> platforms = platform_set.iterator();
while ( platforms.hasNext() ) {
writer.print("\"" + platforms.next().getOSPrefix() + "\"");
if ( platforms.hasNext() )
writer.print(", ");
}
writer.print("}, new String[]{");
platforms = platform_set.iterator();
while ( platforms.hasNext() ) {
writer.print("\"" + platforms.next().getPrefix() + "\"");
if ( platforms.hasNext() )
writer.print(", ");
}
writer.print("}, ");
} else if ( aliased ) {
writer.print("GLContext.getFunctionAddress(new String[] {\"" + method.getSimpleName() + "\",\"" + method.getSimpleName() + alias_annotation.postfix() + "\"})) != 0");
} else
writer.print("GLContext.getFunctionAddress(");
if ( !aliased )
writer.print("\"" + method.getSimpleName() + "\")) != 0");
if ( deprecated || dependent != null )
writer.print(')');
if ( optional )
writer.print(" || true)");
}