Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
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  
  ? Widgets that overlap the GLCanvas...  (Read 1354 times)
0 Members and 1 Guest are viewing this topic.
« Posted 2003-12-13 12:48:50 »


This week I began tinkering around with OpenGL and JOGL in particular.  The first thing I wanted to do was to learn a bit about creating a GUI before I got into any OpenGL specific code.  Here are my questions:

1) In games like Dungeon Siege and others, they use
   nifty translucent windows for inventory screens etc.
   that overlap the drawing area.  The first thing I tried
   was to create an OPAQUE 'inventory screen' using a
   heavyweight component ( JDialog ).  The dialog
   dutifully appeared, and behaved as normal, but the
   animation of the GL drawing slowed quite a bit ( I
   used on of the early NeHe tutorials as a guinea pig).
   Thoughts on that?  I forgot to mention it, but here is
   the setup: An AWT Frame containing a GLCanvas
   added to it's  BorderLayout.CENTER, with a JDialog
   using the Frame as it's parent. to use
   opaque widgets without slowing animation?

2) How to use translucent widgets?  I don't see any
   methods to .addComponent() to the GLCanvas, so
   I'm stuck.  

Thanks much
Offline gregorypierce

Senior Devvie

I come upon thee like the blue screen of death....

« Reply #1 - Posted 2003-12-13 17:16:24 »

GLCanvas is a heavyweight drawing area - nothing with overlap it as per Z ordering of heayweight components, the GLCanvas will be drawn last.

What you're referring to aren't GUI components, they're part of the actual application being rendered in DirectX. To do something similar you would have to draw your GUI widgets in OpenGL and since there isn't any immediate plan to render the entire GUI system in OpenGL, there can be no overlap between the two.

IIRC, even JDialog isn't heavyweight. Its just rendered in a modal manner on the swing thread. So your performance loss could be coming from the context switching between the Swing thread and the AWT rendering system for GLCanvas.

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Yuri Vl. Gushchin

Senior Devvie

Speak Java!

« Reply #2 - Posted 2003-12-13 17:48:27 »

To do something similar you would have to draw your GUI widgets in OpenGL

...and if you would like to do something like this, you can take a look on Xith3D GUI rendering subsystem, which allows to draw Swing components inside OpenGL context (i.e. directly in 3D scene).


Yuri Vl. Gushchin
JProof Group
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
« Reply #3 - Posted 2003-12-13 20:35:51 »

Thanks for the advice Smiley
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

BurntPizza (21 views)
2015-10-08 03:11:46

BurntPizza (15 views)
2015-10-08 00:30:40

BurntPizza (16 views)
2015-10-07 17:15:53

BurntPizza (31 views)
2015-10-07 02:11:23

KaiHH (37 views)
2015-10-06 20:22:20

KaiHH (16 views)
2015-10-06 19:41:59

BurntPizza (31 views)
2015-10-06 19:04:48

basil_ (46 views)
2015-09-30 17:04:40

shadowstryker (24 views)
2015-09-29 15:55:06

TheSpaceHedgehog (30 views)
2015-09-29 01:58:48
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!