aspose file tools*
The moose likes Game Development and the fly likes In Game Opengl GUI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "In Game Opengl GUI" Watch "In Game Opengl GUI" New topic
Author

In Game Opengl GUI

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15292
    
    6

I was wondering if anyone that might be developing anything with Opengl in Java:

  • What wrapper API are you using? (Xith, jME, JOGL, LWJGL, etc)
  • If your game has an ingame gui system, what api are you using for it? I'm not talking about Swing for buttons and what not. I am talking about in game menus, buttons, etc.


  • I have tried so many different Java Opengl implementation my head hurts. And none of them are perfect. But I would like to be able to use some sort of GUI for in game menu's, options, etc but none of the implementations have any good solutions for this. A couple are even trying to say to use Swing on the opengl context. Ugh! How horrible of an idea is that.


    GenRocket - Experts at Building Test Data
    Steven Bell
    Ranch Hand

    Joined: Dec 29, 2004
    Posts: 1071
    You might want to look at this. I haven't finished it, but I think you might have to wait for the next article to get into the HUD stuff. Maybe something to look forward to though.
    Gregg Bolinger
    GenRocket Founder
    Ranch Hand

    Joined: Jul 11, 2001
    Posts: 15292
        
        6

    Originally posted by Steven Bell:
    You might want to look at this. I haven't finished it, but I think you might have to wait for the next article to get into the HUD stuff. Maybe something to look forward to though.


    I've already seen that. It really has nothing to do with my question. Greg has been working with a couple of the jME guys on making LWJGL work with Swing/SWT. That is not what I want. Thanks for the link though. Others might find that useful.
    Ernest Friedman-Hill
    author and iconoclast
    Marshal

    Joined: Jul 08, 2003
    Posts: 24168
        
      30

    JOGL rocks all up and down, as far as I'm concerned. Have you had any problems with it? After having used GL4Java, Java3D, and my own home-grown library, JOGL far and away wins my heart.

    No HUD, not a game.


    [Jess in Action][AskingGoodQuestions]
    Gregg Bolinger
    GenRocket Founder
    Ranch Hand

    Joined: Jul 11, 2001
    Posts: 15292
        
        6

    Originally posted by Ernest Friedman-Hill:
    JOGL rocks all up and down, as far as I'm concerned. Have you had any problems with it? After having used GL4Java, Java3D, and my own home-grown library, JOGL far and away wins my heart.

    No HUD, not a game.


    Yes, I have used JOGL. But again, no in game UI. Also, I have a need in one of my apps to use a complex GUI with a glcontext in a panel/canvas. I have used both the GLCanvas and GLJPanel and GLJPanel is tons slower than the GLCanvas, but with GLCanvas I run into Lightweight/Heavyweight issues with rendering the other controls using all Swing. Have you ever looked at how they render opengl on a Swing JPanel? It is so hacked. There are so many issues with Java and Opengl that you just don't run into using C++ and something like QT or wxWidgets.

    I developed an app with a friend of mine using gl4java and it was good in its day, but man did it have some problems. The least of which not being the coordinate system being reversed.
    Gregg Bolinger
    GenRocket Founder
    Ranch Hand

    Joined: Jul 11, 2001
    Posts: 15292
        
        6

    Hey Ernest, do you know if JOGL has a way to pump a ShaderLanguage script to the video card? LWJGL does. I thought that was pretty cool.
    Ernest Friedman-Hill
    author and iconoclast
    Marshal

    Joined: Jul 08, 2003
    Posts: 24168
        
      30

    Originally posted by Gregg Bolinger:
    It is so hacked. There are so many issues with Java and Opengl that you just don't run into using C++ and something like QT or wxWidgets.


    Yeah, the fundamental problem is that by the time JOGL, gl4java, or whatever gets involved, the window has already been allocated. I'm not a Windows guy -- most of my work is developed on and for Linux -- but on X/Windows, the only time you get a chance to choose the GL-relevant window features (depth buffer, bit planes, etc) is before the window is created. So the only way to write a GL api for Java that works on all X servers is to allocate a new X/Window and overlay it onto the one Java creates for your JFrame (or whatever.) This is why it's an enormous hassle to have lightweight components show up on top of a GL window -- because Java's busy drawing behind the GL window.

    But the GL app I work on has a GLCanvas in the middle of a JFrame, with menus on top, a JComboBox on the bottom, and tooltips all around, and there are just a few lines of code here and there to make sure all the popups and tooltips use heavyweight windows, and then everything works. I haven't seen this as a real limitation.

    Hmmm. So, if there's no HUD library for JOGL, maybe we could write one... there's kind of a fun project, yeah?
    Gregg Bolinger
    GenRocket Founder
    Ranch Hand

    Joined: Jul 11, 2001
    Posts: 15292
        
        6

    That would be a *fun* project. There is a bit more to it than just building a HUD though. Push buttons, textboxes, etc, all being rendered with opengl and processing events. It would be an undertaking. The JME guys are working on one for their API but it is in very early stages right now. Looks pretty nasty too.
    Ernest Friedman-Hill
    author and iconoclast
    Marshal

    Joined: Jul 08, 2003
    Posts: 24168
        
      30

    Originally posted by Gregg Bolinger:
    Hey Ernest, do you know if JOGL has a way to pump a ShaderLanguage script to the video card? LWJGL does. I thought that was pretty cool.


    Yep, right in the "GL" class you got your glCreateShaderObjectARB(), glShaderSourceARB(), glCompileShaderARB(), everything you need. Haven't used it myself but I know it's there!
    Gregg Bolinger
    GenRocket Founder
    Ranch Hand

    Joined: Jul 11, 2001
    Posts: 15292
        
        6

    Originally posted by Ernest Friedman-Hill:


    Yep, right in the "GL" class you got your glCreateShaderObjectARB(), glShaderSourceARB(), glCompileShaderARB(), everything you need. Haven't used it myself but I know it's there!


    Awesome!
    Johannes Schaback
    Greenhorn

    Joined: Apr 06, 2005
    Posts: 1
    Hi, I'm running joglui. I justed started working on a GUI System similar to Crazy Eddies or jMEs internal GUI but based on JOGL. I did not publish any release yet... Maybe you check it out in a few weeks (or consider to join the project, which would double the manpower ).

    Schabby
    Paulus Tuerah
    Greenhorn

    Joined: Feb 23, 2005
    Posts: 7
    - What wrapper API are you using? (Xith, jME, JOGL, LWJGL, etc)

    I use LWJGL and JOGL for my 2D game engine.

    - If your game has an ingame gui system, what api are you using for it? I'm not talking about Swing for buttons and what not. I am talking about in game menus, buttons, etc.

    I use my own GUI, GTGE GUI, you can take a look at http://www.goldenstudios.or.id/products/utilities/gui/
    It's component designed for gaming, I haven't update it recently, but I tried it with my game engine and it's working just fine with both LWJGL and JOGL.
    Basically it's only a sprite in game that looks like a component, so it's depend only by the graphics engine to render the image (component), not related with swing/awt/etc, only need graphics engine to draw the component and input engine to take input.

    You could try it out if you like, and tell me what you think later if you decide to try it.

    Anyway it's only for 2D game, and this is my game engine
    http://goldenstudios.or.id/products/GTGE

    The game engine name is Golden T Game Engine (GTGE)
    Joel Schuster
    Greenhorn

    Joined: May 03, 2005
    Posts: 1
    Take a look again at jME... I've finally gotten most of the finishing touched on the GUI for it.

    http://www.resonus.net/tiki-browse_gallery.php?galleryId=1
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: In Game Opengl GUI
     
    Similar Threads
    please guide !
    JOGL or LWJGL
    Popup lists
    Mixing Android GUI controls with game graphics
    Graphics2D and Opengl pipeline & Swing