• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

In Game Opengl GUI

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
     
    Ranch Hand
    Posts: 1071
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Ranch Hand
    Posts: 15304
    6
    Mac OS X IntelliJ IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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.
     
    author and iconoclast
    Posts: 24207
    46
    Mac OS X Eclipse IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    Gregg Bolinger
    Ranch Hand
    Posts: 15304
    6
    Mac OS X IntelliJ IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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
    Ranch Hand
    Posts: 15304
    6
    Mac OS X IntelliJ IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Posts: 24207
    46
    Mac OS X Eclipse IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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
    Ranch Hand
    Posts: 15304
    6
    Mac OS X IntelliJ IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Posts: 24207
    46
    Mac OS X Eclipse IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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
    Ranch Hand
    Posts: 15304
    6
    Mac OS X IntelliJ IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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!
     
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
     
    Greenhorn
    Posts: 7
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    - 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)
     
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
     
    Then YOU must do the pig's work! Read this tiny ad. READ IT!
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic