pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: OpenGL (was "Pivot/SWT")
Date Wed, 24 Feb 2010 14:43:30 GMT
> 1) How well does it handle 2D rendering? While it would be great to support richer 3D
effects, Pivot is still fundamentally a 2D user interface. OTOH, I believe WPF is backed by
Direct3D, and WPF is primarily 2D as well.
> 
> Yes, OpenGL does 2D.  You can see Swing running on opengl by using -Dsun.java2d.opengl.
 It's wicked fast.  

Interesting. I just tried that with the Kitchen Sink demo, but I didn't notice a difference.
Maybe OS X does this by default.

> 
> 2) How well does it handle text rendering? Text is the often biggest bottleneck in layout
and paint (especially in a multiline text component like TextArea). Would OpenGL be able to
support this?
> 
> It supports it, I think it's very fast, but I don't really know.

OK, maybe I will do some digging here.

> 3) What is the platform support like? I'm sure it runs fine on Linux and OS X, but what
about Windows? I remember hearing at one point that Windows didn't natively support it - is
that still the case? If so, how difficult is it to install? How big is the install?
> 
> You usually either have it in your graphics card, or you don't (you almost always do).
 If the Skins were in Java2D (or 3D!), then you can let the JVM decide to use the acceleration.
 I think the way to think about this without losing Pivot's ubiquity is to let the skins use
Java2D and let the JVM provide the graphics pipelines goodies for you.  

That is basically what we are doing now. The problem with this approach is:

a) Access to OpenGL functionality is hidden behind Java2D, which doesn't support any 3D operations.
It is also a potentially unnecessary level of indirection.

b) Drawing directly to an OpenGL API would allow us to seamlessly drop into either AWT (via
javax.media.opengl.GLCanvas) or SWT (via org.eclipse.swt.opengl.GLCanvas). We wouldn't need
to support _either_ AWT or SWT - we could natively support both.

So, rendering directly to OpenGL potentially gives us more flexibility all around.

> To get into SWT, you can use a bridge to get Java2D for SWT, see http://www.holongate.org/.
 

Yes, there is the possibility of using the SWT/AWT bridge, but that is another level of indirection,
and I have heard that it does not work particularly well.




Mime
View raw message