writer.println();
GLESCapabilitiesGenerator.generateClassPrologue(writer, context_specific, generate_error_checks);
DeclarationFilter filter = DeclarationFilter.getFilter(InterfaceDeclaration.class);
Collection<TypeDeclaration> interface_decls = filter.filter(env.getSpecifiedTypeDeclarations());
for ( TypeDeclaration typedecl : interface_decls ) {
InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
if ( Utils.isFinal(interface_decl) )
GLESCapabilitiesGenerator.generateField(writer, interface_decl);
}
writer.println();
if ( context_specific ) {
for ( TypeDeclaration typedecl : interface_decls ) {
InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
GLESCapabilitiesGenerator.generateSymbolAddresses(writer, interface_decl);
}
writer.println();
for ( TypeDeclaration typedecl : interface_decls ) {
InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
GLESCapabilitiesGenerator.generateAddressesInitializers(writer, interface_decl);
}
writer.println();
}
if ( context_specific ) {
writer.println("\tprivate static void remove(Set supported_extensions, String extension) {");
writer.println("\t\tLWJGLUtil.log(extension + \" was reported as available but an entry point is missing\");");
writer.println("\t\tsupported_extensions.remove(extension);");
writer.println("\t}\n");
}
GLESCapabilitiesGenerator.generateInitStubsPrologue(writer, context_specific);
for ( TypeDeclaration typedecl : interface_decls ) {
InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
GLESCapabilitiesGenerator.generateSuperClassAdds(writer, interface_decl);
}
for ( TypeDeclaration typedecl : interface_decls ) {
InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
if ( interface_decl.getSimpleName().startsWith("GLES") )
continue;
GLESCapabilitiesGenerator.generateInitStubs(writer, interface_decl, context_specific);
}
GLESCapabilitiesGenerator.generateInitStubsEpilogue(writer, context_specific);
writer.println();
writer.println("\tstatic void unloadAllStubs() {");
if ( !context_specific ) {
writer.println("\t\tif (!loaded_stubs)");
writer.println("\t\t\treturn;");
for ( TypeDeclaration typedecl : interface_decls ) {
InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
GLESCapabilitiesGenerator.generateUnloadStubs(writer, interface_decl);
}
writer.println("\t\tloaded_stubs = false;");
}
writer.println("\t}");
writer.println();
GLESCapabilitiesGenerator.generateInitializerPrologue(writer);
for ( TypeDeclaration typedecl : interface_decls ) {
InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl;
if ( Utils.isFinal(interface_decl) )
GLESCapabilitiesGenerator.generateInitializer(writer, interface_decl);
}
writer.println("\t}");
writer.println("}");