Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
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  
  Multiple windows and OpenGL  (Read 2874 times)
0 Members and 1 Guest are viewing this topic.
Offline loom_weaver

JGO Coder

Medals: 17

« Posted 2012-03-11 23:06:43 »

Hi everyone,

I'm kind of at a crossroads in my game and I'm looking for input from people who've been here before.

My game is a cross between RPG and RTS strategy and the main panel uses an lwjgl display for performance reasons.  Ultimately, there will be several quite complicated windows required.  For example: a window to manage the party's inventory or one to buy and sell items between a trading caravan and a city's marketplace.  A good portion of this game will be heavily economy-based i.e. lots of data and I foresee the need to use sophisticated GUI elements including collapsible trees and tables.

To prevent myself from having to re-implement a full windowing system in OpenGL I've decided to use a mixture of Swing and an lwjgl display.  Thus the game will have a MDI (multiple-document interface) i.e. multiple windows.

| main window        |  
|  (lwjgl)           |  
|                    |     +-----------+
|                    |     | inventory |
|                    |     |  (swing)  |  
+--------------------+     |           |  
                           |           |  
            +---------+    |           |  
            | status  |    |           |  
            |         |    |           |  
            +---------+    +-----------+

Now I'm wondering if I'll regret this later on.  Would it be better to do everything in a single lwjgl frame?  That is either use a pre-existing OpenGL windowing lib or create a custom one for my game.  The graphical style is quite simple and I'd like to keep it that way.

What are your thoughts and/or experiences going down either path?
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #1 - Posted 2012-03-11 23:10:23 »

I'd keep it all within one window personally. How many games do you see with floating sub windows? Plus Swing tends to look and behave like crap for games, even after heavy reskinning.

There's plenty of OpenGL gui toolkits out there if you don't want to write your own, maybe start with TWL?

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline loom_weaver

JGO Coder

Medals: 17

« Reply #2 - Posted 2012-03-11 23:35:51 »

I've taken a look at TWL and it looks pretty sweet.  However there are a few concerns I have.  It doesn't integrate properly with the rest of the system e.g. the system clipboard etc.  And while the existing UI elements look good they're pretty simple compared to their Swing counterparts.

If I went with the MDI version and needed some very basic UI elements in the main lwjgl window then how tricky is it to write a UI toolkit?  I suppose there's nothing stopping me from using both TWL and other Swing windows...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kappa
« League of Dukes »

JGO Kernel

Medals: 119
Projects: 15


« Reply #3 - Posted 2012-03-11 23:58:22 »

I don't think there is any OpenGL gui that will integrate nicely with the system, besides you probably don't want that for game gui, if you do you could have a look at SWT.

Another nice option is Nifty GUI which takes a slightly different approach to TWL for GUI design.
Offline ra4king

JGO Kernel

Medals: 506
Projects: 3
Exp: 5 years

I'm the King!

« Reply #4 - Posted 2012-03-11 23:59:29 »

And while the existing UI elements look good they're pretty simple compared to their Swing counterparts.
TWL doesn't have a pre-built UI. It is a GUI toolkit, extremely flexible and completely customizable. You supply the looks, it creates the widgets Smiley

Offline davedes
« Reply #5 - Posted 2012-03-12 01:35:01 »

Swing doesn't mix very well with OpenGL -- it's really only useful for editors/toolsets IMO.

Writing your own GUI library is always an option, but if you need things like complex text widgets, lists/trees, tables, layout managers, animations, etc. it will amount to a lot of work. Unless you have good reason to reinvent the wheel, you should just use something like TWL. It's efficient, highly flexible and includes a very useful theme/widget/font editor.

Offline gouessej
« Reply #6 - Posted 2012-03-14 22:43:15 »

Another nice option is Nifty GUI which takes a slightly different approach to TWL for GUI design.
Does NiftyGUI still have an high memory footprint?

Julien Gouesse | Personal blog | Website | Jogamp
Pages: [1]
  ignore  |  Print  

xxMrPHDxx (13 views)
2017-11-21 16:21:00

xxMrPHDxx (10 views)
2017-11-21 16:14:31

xxMrPHDxx (10 views)
2017-11-21 16:10:57

Ecumene (113 views)
2017-09-30 02:57:34

theagentd (148 views)
2017-09-26 18:23:31

cybrmynd (246 views)
2017-08-02 12:28:51

cybrmynd (242 views)
2017-08-02 12:19:43

cybrmynd (242 views)
2017-08-02 12:18:09

Sralse (257 views)
2017-07-25 17:13:48

Archive (877 views)
2017-04-27 17:45:51
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

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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!