Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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 1863 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.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
+--------------------+
| 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: 56
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? http://wiki.l33tlabs.org/bin/view/TWL/

[ TriangularPixels.com - 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: 77
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: 347
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?

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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (43 views)
2014-09-23 14:38:19

radar3301 (25 views)
2014-09-21 23:33:17

BurntPizza (62 views)
2014-09-21 02:42:18

BurntPizza (32 views)
2014-09-21 01:30:30

moogie (37 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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!