Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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 Java2D/OpenGL bridge - does it actually work?  (Read 3885 times)
0 Members and 1 Guest are viewing this topic.
Offline Chagma

Senior Newbie





« Posted 2010-02-15 20:57:03 »

I ask because I have never actually seen it working and both of the JOGL demos that use this technology bring up a blank white window and nothing else when I run them on 3 separate machines under various flavours of Windows.

So, is this just an experimental technology or is there a way to get it to work?  We are very interested in this feature and hope that it can be made to work.
Offline Chagma

Senior Newbie





« Reply #1 - Posted 2010-02-15 21:13:27 »

In case there is any confusion, I am referring to what is more commonly known as the "Java2D/JOGL interoperability" technology.
Online Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2 - Posted 2010-02-15 21:42:47 »

If anything, steer clear of it. Sun ditched JOGL, and so don't expect much (any?) support.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Chagma

Senior Newbie





« Reply #3 - Posted 2010-02-15 21:58:18 »

Yes, Sun ditched JOGL but surely it has just as much support now as say LWJGL

The main reason I am interested in JOGL and the Java2D/JOGL interoperability is because our game relies heavily on text and we need the text to be clear and crisp.  LWJGL is an alternative but doesn't offer much (anything?) in the way of good text rendering.
Offline bienator

Senior Duke




OutOfCoffeeException


« Reply #4 - Posted 2010-02-15 22:10:22 »

I won't recommend using it esp. if you want to distribute your app via webstart/applets - it was never stable enough to be used on unknown hardware (IMO of course).

There are many other ways of implementing interop between java2d and jogl.

e.g
-google for swogl (swing for jogl)
-wonderland has also at least one working implementation (beside the JME one)
- https://scenegraph.dev.java.net/ has one too but its GPL (without classpath exception)

i've written one for my engine for debugging purposes but it isn't open source (screenshot)

Offline bienator

Senior Duke




OutOfCoffeeException


« Reply #5 - Posted 2010-02-15 22:14:36 »

The main reason I am interested in JOGL and the Java2D/JOGL interoperability is because our game relies heavily on text and we need the text to be clear and crisp.
use the TextRenderer. Renders any java font you like in your gl scene. (but thats not the full interop i referred to in the last post)

Offline Chagma

Senior Newbie





« Reply #6 - Posted 2010-02-15 22:20:54 »

Just to be clear, are you referring to the Java2D/JOGL interoperability or JOGL itself when you say "don't use it" and that it's unstable?

Also, there are other reasons why we would like to fully investigate the viability of Java2D/JOGL interoperability so I would appreciate someone close to the JOGL project commenting on its status.
Offline Nate

JGO Kernel


Medals: 149
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2010-02-15 22:34:00 »

The main reason I am interested in JOGL and the Java2D/JOGL interoperability is because our game relies heavily on text and we need the text to be clear and crisp.  LWJGL is an alternative but doesn't offer much (anything?) in the way of good text rendering.
LWJGL differs from JOGL in that it is, for the most part, only an OpenGL binding. It doesn't include a bunch of other stuff. I see this as a good thing.

I wrote Unicode font support for Slick, which is based on LWJGL:
https://bob.newdawnsoftware.com/repos/slick/trunk/Slick/src/org/newdawn/slick/UnicodeFont.java
It wouldn't be too hard to pull this out of Slick. There is also a tool for designing your fonts:
http://slick.cokeandcode.com/demos/hiero.jnlp
(Blame Kevin, Slick's author, for the Hiero tool not closing properly. Tongue) This tool saves a ".hiero" file that UnicodeFont can open which describes font size, spacing, and effects (colors, borders, etc). UnicodeFont then renders (at startup or on the fly) glyphs from TrueType fonts to OpenGL atlas textures using Java2D. Because UnicodeFont can render glyphs on the fly, apps can support allowing the user to type Unicode characters.

The Hiero tool can also alternatively output the BMFont format and any number of packed glyph images. This is a fine solution if you know all the glyphs up front. Quality is the same, including kerning. The AngelCodeFont class in Slick renders fonts with these. The BMFont format is easy to render, eg I have written a renderer for both the iPhone and Android.

Offline bienator

Senior Duke




OutOfCoffeeException


« Reply #8 - Posted 2010-02-15 22:39:15 »

Just to be clear, are you referring to the Java2D/JOGL interoperability or JOGL itself when you say "don't use it" and that it's unstable?
Java2D/JOGL interoperability

Also, there are other reasons why we would like to fully investigate the viability of Java2D/JOGL interoperability so I would appreciate someone close to the JOGL project commenting on its status.
i am one of the main contributors of the community version of JOGL2, its probably close enough Wink

If I say Java2D/JOGL interoperability i mean:
1. Enable swing opengl rendering with sun.java2d.opengl=true property
2. and use GLJPanel which will render directly into swings gl backbuffer.
(now you can do everything you like with swing or gl)

problem is 1.) is already unstable. Try it.

Offline Chagma

Senior Newbie





« Reply #9 - Posted 2010-02-16 07:40:28 »

If I say Java2D/JOGL interoperability i mean:
1. Enable swing opengl rendering with sun.java2d.opengl=true property
2. and use GLJPanel which will render directly into swings gl backbuffer.
(now you can do everything you like with swing or gl)

problem is 1.) is already unstable. Try it.

Thanks for the info.  Do I need (1) to do (2)?

And thanks for confirming that (1) is unstable.  Is anything being done to address this?  Is it a Java issue or a JOGL issue?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #10 - Posted 2010-02-16 08:42:24 »

Thanks for the info.  Do I need (1) to do (2)?

And thanks for confirming that (1) is unstable.  Is anything being done to address this?  Is it a Java issue or a JOGL issue?
So we know Java2D is a Sun API, and JOGL was. Now knowing Sun ditched JOGL, and Java2D is constantly changing its implementation do you expect the JOGL developers to keep up?? There is little gain in Java2D/OpenGL interoperability anyway, the alternatives (also mentioned in this thread) are way better.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline gouessej
« Reply #11 - Posted 2010-02-16 16:17:45 »

Currently I use Java2D/OpenGL bridge under Linux and Windows, it works quite fine when I don't try to force the Java2D OpenGL pipeline. I use it to display transparent Swing components into a control part (Eclipse RCP application) including a JOGL GLJPanel.

Offline Chagma

Senior Newbie





« Reply #12 - Posted 2010-02-16 16:55:27 »

it works quite fine when I don't try to force the Java2D OpenGL pipeline

Thanks for the info but I don't really know what you mean by this.  Could you please elaborate?

And how do you get it to work?  Even in my simplest program using a GLJPanel, if I set sun.java2d.opengl=true then I just end up with a blank white window.  If I don't set that property then the performance with multisampling is terrible!
Offline gouessej
« Reply #13 - Posted 2010-02-17 10:41:32 »

Thanks for the info but I don't really know what you mean by this.  Could you please elaborate?

And how do you get it to work?  Even in my simplest program using a GLJPanel, if I set sun.java2d.opengl=true then I just end up with a blank white window.  If I don't set that property then the performance with multisampling is terrible!
Don't set sun.java2d.opengl to true, only set sun.java2d.noddraw to true. I use multisampling and it works fine.

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.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!