Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (517)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (578)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Small static import finder tool (for LWJGL)  (Read 1860 times)
0 Members and 1 Guest are viewing this topic.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 823
Projects: 4
Exp: 16 years


Hand over your head.


« Posted 2012-12-12 09:48:32 »

    Introduction
    I bet anybody working with LWJGL has run into this problem... you need, say, these:
    • 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]
    1  
    2  
    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

    Hi, appreciate more people! Σ ♥ = ¾
    Learn how to award medals... and work your way up the social rankings
    Offline Riven
    « League of Dukes »

    JGO Overlord


    Medals: 823
    Projects: 4
    Exp: 16 years


    Hand over your head.


    « Reply #1 - Posted 2012-12-12 11:12:00 »

    Added support for static fields!

    The matching algorithm is a tad better than Eclipse's (fwiw), as Eclipse cannot auto-complete on partially provided static fields ("GL_CO_B_" -> "GL_COLOR_BUFFER_BIT")

    Hi, appreciate more people! Σ ♥ = ¾
    Learn how to award medals... and work your way up the social rankings
    Offline Regenuluz
    « Reply #2 - Posted 2012-12-12 11:18:06 »

    I get an error, when trying to run it.

    Quote
    java -jar /Users/Regenuluz/Downloads/static-import-tool.jar
    classpath entry: file:/Users/Regenuluz/Downloads/static-import-tool.jar
    failed to find lwjgl.jar in classpath.
    Games published by our own members! Check 'em out!
    Legends of Yore - The Casual Retro Roguelike
    Offline Riven
    « League of Dukes »

    JGO Overlord


    Medals: 823
    Projects: 4
    Exp: 16 years


    Hand over your head.


    « Reply #3 - Posted 2012-12-12 11:18:40 »

    Thanks for testing!

    Usage:
    1  
    2  
    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


     Kiss

    Hi, appreciate more people! Σ ♥ = ¾
    Learn how to award medals... and work your way up the social rankings
    Offline Regenuluz
    « Reply #4 - Posted 2012-12-12 11:23:46 »

    Arh, neat. Now I just get a handful of warnings, but the app runs without problems. Smiley

    Quote
    warning: no lwjgl in java.library.path
    warning: Could not initialize class org.lwjgl.Sys
    warning: org/lwjgl/opengles/PowerManagementEventException
    warning: org/lwjgl/opengles/PowerManagementEventException
    warning: Could not initialize class org.lwjgl.Sys
    warning: org/lwjgl/opengles/PowerManagementEventException
    warning: Could not initialize class org.lwjgl.Sys
    warning: Could not initialize class org.lwjgl.Sys
    warning: Could not initialize class org.lwjgl.Sys
    Offline Riven
    « League of Dukes »

    JGO Overlord


    Medals: 823
    Projects: 4
    Exp: 16 years


    Hand over your head.


    « Reply #5 - Posted 2012-12-12 11:31:27 »

    @Regenuluz: those warnings are the result of Class.forName(anyClassNameInJar) failing - which is harmless.



    I just added support for UP / DOWN key events in the query textfield, so you can select the best match, without using the mouse.

    Hi, appreciate more people! Σ ♥ = ¾
    Learn how to award medals... and work your way up the social rankings
    Offline matheus23

    JGO Kernel


    Medals: 110
    Projects: 3


    You think about my Avatar right now!


    « Reply #6 - Posted 2012-12-12 17:36:36 »

    This is quite an intresting tool.

    If you want to have static-import autocompletion, then you can edit your "Favourites" preferences in eclipse. Go to Window -> Preferences then go to what this image shows:


    Personally I find this a much faster and cleaner way, but since this only works in eclipse this is not useful to IntelliJ and NetBeans users Smiley

    See my:
        My development Blog:     | Or look at my RPG | Or simply my coding
    http://matheusdev.tumblr.comRuins of Revenge  |      On Github
    Offline sproingie

    JGO Kernel


    Medals: 202



    « Reply #7 - Posted 2012-12-12 19:00:23 »

    It's just not all that necessary for IntelliJ.  Just start typing a static member name for something that's in your project's scope and hit ctrl-space twice (or ctrl-alt-space once).
    Offline davedes
    « Reply #8 - Posted 2012-12-12 19:15:52 »

    If you want to have static-import autocompletion, then you can edit your "Favourites" preferences in eclipse.
    I was hoping Eclipse had something like this -- thanks!

    Offline Nate

    JGO Kernel


    Medals: 153
    Projects: 4
    Exp: 14 years


    Esoteric Software


    « Reply #9 - Posted 2012-12-12 19:26:58 »

    The matching algorithm is a tad better than Eclipse's (fwiw), as Eclipse cannot auto-complete on partially provided static fields ("GL_CO_B_" -> "GL_COLOR_BUFFER_BIT")
    Neat tool! FWIW, Eclipse syntax for a search (eg, in the Open Resource dialog) Some*ing. Doesn't work for autocomplete of course.

    Games published by our own members! Check 'em out!
    Legends of Yore - The Casual Retro Roguelike
    Offline matheus23

    JGO Kernel


    Medals: 110
    Projects: 3


    You think about my Avatar right now!


    « Reply #10 - Posted 2012-12-12 19:39:14 »

    If you want to have static-import autocompletion, then you can edit your "Favourites" preferences in eclipse.
    I was hoping Eclipse had something like this -- thanks!
    You're welcome Smiley

    See my:
        My development Blog:     | Or look at my RPG | Or simply my coding
    http://matheusdev.tumblr.comRuins of Revenge  |      On Github
    Pages: [1]
      ignore  |  Print  
     
     
    You cannot reply to this message, because it is very, very old.

     

    Add your game by posting it in the WIP section,
    or publish it in Showcase.

    The first screenshot will be displayed as a thumbnail.

    DarkCart (16 views)
    2014-10-31 21:44:48

    DarkCart (21 views)
    2014-10-31 21:43:57

    TehJavaDev (40 views)
    2014-10-27 03:28:38

    TehJavaDev (31 views)
    2014-10-27 03:27:51

    DarkCart (44 views)
    2014-10-26 19:37:11

    Luminem (27 views)
    2014-10-26 10:17:50

    Luminem (30 views)
    2014-10-26 10:14:04

    theagentd (36 views)
    2014-10-25 15:46:29

    Longarmx (64 views)
    2014-10-17 03:59:02

    Norakomi (62 views)
    2014-10-16 15:22:06
    Understanding relations between setOrigin, setScale and setPosition in libGdx
    by mbabuskov
    2014-10-09 22:35:00

    Definite guide to supporting multiple device resolutions on Android (2014)
    by mbabuskov
    2014-10-02 22:36:02

    List of Learning Resources
    by Longor1996
    2014-08-16 10:40:00

    List of Learning Resources
    by SilverTiger
    2014-08-05 19:33:27

    Resources for WIP games
    by CogWheelz
    2014-08-01 16:20:17

    Resources for WIP games
    by CogWheelz
    2014-08-01 16:19:50

    List of Learning Resources
    by SilverTiger
    2014-07-31 16:29:50

    List of Learning Resources
    by SilverTiger
    2014-07-31 16:26:06
    java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
    Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!