Porting java.awt stuff to jogl.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Porting java.awt stuff to jogl.

sarevok
Hello,

I'm porting java application to Android.
This app is using JOGL a lot in connection with awt. Since AWT is not available on Android I need to get rid of it. (But the best thing will be if all stuff will be as much crossplatform as possible)

So first thing I made was replace all AWT events with NAWT equivalents then porting main AWT frame creating main window with NAWT GLWindow.

Now I have some things like:
java.awt.Graphics2D
java.awt.Graphics
java.awt.image.BufferedImage
java.awt.Font

That needs to be replaced with JOGL equivalents (if there is any).

Propably JOGL has some kind of textrenderer class to handle all stuff related to text rendering, could anyone point me to any documentation? (I will be able to replace java.awt.Font and all text rendering stuff with it propably)

What with Graphics*? It is possible to replace them simple way by NAWT somehow?
What with BufferedImage? I need to display image in my app. There's android.graphics.Bitmap that could be used as BufferedImage  equivalent but it's not cross-platform solution and maybe JOGL has some classes for image manipulation, hm?

Any tip will be helpful :)
Im just an beginner in JOGL world and this is my first post, hello! :)
Reply | Threaded
Open this post in threaded view
|

Re: Porting java.awt stuff to jogl.

gouessej
Administrator
Hi

Someone made a kind of Java2D implementation based on JOGL :
https://github.com/brandonborkholder/glg2d

I assume you speak about NEWT. You can replace some AWT classes by those available in the Android SDK, can't you?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Porting java.awt stuff to jogl.

Brandon Borkholder
Someone made a kind of Java2D implementation based on JOGL :
https://github.com/brandonborkholder/glg2d


glg2d is an implementation of java.awt.Graphics2D that renders everything using jogl calls.

I don't know what version of OpenGL runs on Android.  Version 0.1 of glg2d only supports a GL2 profile, which is OpenGL 3.0.  I'm currently working on an pure shader-based implementation.

I think Android only supports OpenGL ES 2.x.  In that case, glg2d won't support it out of the box, but it could be adapted very easily.  It's very pluggable.