Small static import finder tool (for LWJGL)

Started by Riven, December 12, 2012, 10:26:39

Previous topic - Next topic

Riven

N.B: crosspost from: java-gaming.org thread


    Introduction
    I bet anybody working with LWJGL has run into this problem... you need, say, the methods & the field

    • glDrawElementsInstanced(...)
    • glGetUniformLocation(...)
    • GL_FRAMEBUFFER
    but where on earth are they defined? Google usually answered my question, but it was such a hassle!

    Static-Import-Tool to the rescue!

    Features

    • Intelligent query engine: can match partial camel-case patterns (see screenshot)
    • Results are ordered so that most likely method is listed first
    • Generates the static-import line, selects it when clicked for easy copying.
    • Nothing else, it's a small tool!

    Screenshots



    Download


    Usage:
    [/list]
    java -jar static-import-tool.jar /path/to/lwjgl.jar
    // or just Run in Eclipse, and it will search for lwjgl.jar in the classpath
    

    Rednax

    import static org.lwjgl.opengl.GL11.*;
    import static org.lwjgl.opengl.GL12.*;
    import static org.lwjgl.opengl.GL13.*;
    import static org.lwjgl.opengl.GL14.*;
    import static org.lwjgl.opengl.GL15.*;
    import static org.lwjgl.opengl.GL20.*;
    import static org.lwjgl.opengl.GL21.*;
    import static org.lwjgl.opengl.GL30.*;
    import static org.lwjgl.opengl.GL31.*;
    import static org.lwjgl.opengl.GL32.*;
    import static org.lwjgl.opengl.GL33.*;
    import static org.lwjgl.opengl.GL40.*;
    import static org.lwjgl.opengl.GL41.*;
    import static org.lwjgl.opengl.GL42.*;
    :P

    CodeBunny

    This does seem like an unnecessary addition to the workflow. I feel like this would slow you down.

    After all, if you know what functions you need to call, you probably have at least a good idea of what class they are in; and if you don't, you can just do what Rednax posted.