Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
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 1560 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 Kernel

Medals: 180

« 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 »


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  

EgonOlsen (42 views)
2018-06-10 19:43:48

EgonOlsen (22 views)
2018-06-10 19:43:44

EgonOlsen (43 views)
2018-06-10 19:43:20

DesertCoockie (197 views)
2018-05-13 18:23:11

nelsongames (124 views)
2018-04-24 18:15:36

nelsongames (123 views)
2018-04-24 18:14:32

ivj94 (863 views)
2018-03-24 14:47:39

ivj94 (124 views)
2018-03-24 14:46:31

ivj94 (768 views)
2018-03-24 14:43:53

Solater (140 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!