Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
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 1156 times)
0 Members and 1 Guest are viewing this topic.
zahl2001
Guest
« Posted 2003-12-13 13:48:50 »

Hello,

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.  Anyway...how 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 Member




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


« Reply #1 - Posted 2003-12-13 18: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.

http://www.gregorypierce.com

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 Member




Speak Java!


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

Quote
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

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

Thanks for the advice Smiley
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.

xsi3rr4x (23 views)
2014-04-15 18:08:23

BurntPizza (18 views)
2014-04-15 03:46:01

UprightPath (32 views)
2014-04-14 17:39:50

UprightPath (16 views)
2014-04-14 17:35:47

Porlus (32 views)
2014-04-14 15:48:38

tom_mai78101 (58 views)
2014-04-10 04:04:31

BurntPizza (116 views)
2014-04-08 23:06:04

tom_mai78101 (216 views)
2014-04-05 13:34:39

trollwarrior1 (183 views)
2014-04-04 12:06:45

CJLetsGame (190 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!