Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
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  
  JOGL and GUI creation/general guidelines  (Read 1037 times)
0 Members and 1 Guest are viewing this topic.
Offline Bolo

Junior Newbie





« Posted 2008-05-26 09:04:28 »

Hi everyone,

I'm teaching myself JOGL right now and am trying to produce "proof-of-concept" code to do various game-related things.

Right now, I'm trying to integrate a GUI into a simple JOGL application.  I'm just looking to put some buttons on or next to a GLCanvas.  There are a few options that I can think of, but I'm not certain if they'll work or what's the best.  Any guidance (even just links to other discussions) is appreciated!

1) Use Java2D with JOGL, using a GLJPanel rather than a GLCanvas.  From what I've read, this would work, but there may be performance issues, lightweight/heavyweight mixing issues, etc.

2) Draw the buttons as textured objects that are at fixed locations in the camera's field of view.  They would detect when the mouse is clicked on them or when it hovers over them.  I haven't seen this mentioned anywhere online, so might it be an extremely stupid idea?

3) Use an API such as FengGui to do it.  This might be easier, but these APIs also seem to come with their own bugs and limitations that I'd have to learn about as well.

Any recommendations are appreciated.  Thank you.
Offline cylab

JGO Ninja


Medals: 43



« Reply #1 - Posted 2008-05-26 11:03:24 »

to 1) It depends on the things you are doing, if the performance hit of using GLJPanel is a problem for you. From my understanding, it's just a copy-back related problem, so the more advanced stuff you are doing on the gfx-card the _less_ performance penalty you will notice. If it's just a proof-of-concept you can simple ignore this or wait for the java2d opengl-pipeline resumes to work reliably in later JRE versions.

to 2) If you only have buttons, this is the easiest way to go, but you will end up recreating an own gui library, if you need more advanced stuff like scrollable areas, list boxes or focus management incl. key controls etc.

to 3) You are right with your concerns to some degree, but this is the nature of developing larger applications. There are plenty of examples for failure due to the misconception that understanding the quirks of third-party-libraries is more difficult than writing your own. So if you expect to have a more complicated GUI than buttons and icons, you should at least try to use a GUI library before rolling your own.

Mathias - I Know What [you] Did Last Summer!
Offline Bolo

Junior Newbie





« Reply #2 - Posted 2008-05-27 21:36:29 »

Thanks!

I'm creating this code with an eye toward further development down the line, so I would definitely want to have scrollable areas, etc. later on.  I'll probably look at FengGUI right now.

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.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (24 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (48 views)
2014-08-09 21:09:32
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!