Search in sources :

Example 6 with GL11.glTranslatef

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;
            }
        }
    }
}
Also used : JTextField(javax.swing.JTextField) Field(java.lang.reflect.Field) GL11(org.lwjgl.opengl.GL11)

Aggregations

GL11 (org.lwjgl.opengl.GL11)6 List (java.util.List)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 GlStateManager (net.minecraft.client.renderer.GlStateManager)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Collectors (java.util.stream.Collectors)2 DefaultVertexFormats (net.minecraft.client.renderer.vertex.DefaultVertexFormats)2 ItemStack (net.minecraft.item.ItemStack)2 TileQuarry (buildcraft.builders.tile.TileQuarry)1 BCCoreItems (buildcraft.core.BCCoreItems)1 ItemPaintbrush_BC8 (buildcraft.core.item.ItemPaintbrush_BC8)1 ChunkLoaderManager (buildcraft.lib.chunkload.ChunkLoaderManager)1 DetachedRenderer (buildcraft.lib.client.render.DetachedRenderer)1 DebugRenderHelper (buildcraft.lib.debug.DebugRenderHelper)1 GuiBC8 (buildcraft.lib.gui.GuiBC8)1 GuiIcon (buildcraft.lib.gui.GuiIcon)1