use of org.lwjgl.opengl.GL11.glTranslatef in project LogisticsPipes by RS485.
the class OpenGLDebugger method updateNiceToHave.
private static void updateNiceToHave() {
OpenGLDebugger.niceToHave = new HashMap<>();
int crawlerVersion = 11;
boolean almostEnd = false;
boolean end = false;
while (!end) {
String packageGL = String.format("%s%d", "GL", crawlerVersion);
String nextGL = String.format("%s.%s", "org.lwjgl.opengl", packageGL);
try {
crawlerVersion++;
Class glClass = GL11.class.getClassLoader().loadClass(nextGL);
com.google.common.reflect.Reflection.initialize(glClass);
almostEnd = false;
for (Field f : glClass.getDeclaredFields()) {
try {
if (!f.getType().equals(int.class)) {
continue;
}
int id = f.getInt(null);
String nice = f.getName();
if (nice.endsWith("BIT")) {
continue;
}
// All the things that are being replaced are not that bad
if (OpenGLDebugger.niceToHave.containsKey(id) && !OpenGLDebugger.niceToHave.get(id).equals(nice)) {
System.out.printf("NiceToHave: ID %d exists. Replacing %s with %s!!%n", id, OpenGLDebugger.niceToHave.remove(id), nice);
}
OpenGLDebugger.niceToHave.put(id, String.format("%s.%s", packageGL, nice));
} catch (IllegalArgumentException e) {
System.out.printf("NiceToHave: Illegal Argument!%nNiceToHave: %s%n", e);
e.printStackTrace();
} catch (IllegalAccessException e) {
System.out.printf("NiceToHave: Illegal Access!%nNiceToHave: %s%n", e);
e.printStackTrace();
}
}
} catch (ClassNotFoundException e) {
if (almostEnd) {
end = true;
} else {
almostEnd = true;
crawlerVersion = (crawlerVersion / 10 + 1) * 10;
}
}
}
}
Aggregations