[solved] Getting GLG2D to work in my Java2D game.

Hey JGO members, I was looking into hardware accelleration with my Java2D game (No physics just static images and text that gets repainted alot)

I just can’t for the life of me figure out how to set it up, GLG2D (Actually calls upon GL methods in a more advanced way than Javas GL interaction).

If anyone’s successfully gotten GLG2D to work in a project could you please help me?

Any feedback’s appreciated, thanks guys/gals :slight_smile:

Any reason why GLG2D (I don’t even know what that is…)

Here’s their page if you’d be interested in reading:

http://brandonborkholder.github.io/glg2d/

Maybe you can find something out and help me :slight_smile:

Why do you even need this?

If you want increased performance move over to LWJGL or LibGDX, Java2D is best kept the way it is, minimum.

I’m too for using Libgdx or LWJGL for games… I don’t see the need to use any other library that is not ‘popular’

However, this thread is about getting something to work, so this is not really the place to talk about that stuff… However, could you just tell us if there is any specific reason you need to use GLG2D?

Hi

@TehJavaDev GLG2D relies on JOGL, it is a good solution to get the best of the both world, a better hardware acceleration with only a very few changes in your source code that still uses Java2D. GLG2D just provides an alternative Graphics2D implementation. You can use Marlin with it too.

However, if you really want to get some help on any JogAmp API, rather ask your question on our official forum:
http://forum.jogamp.org/

I won’t make any comment about what some members consider popular or not. LibGDX has a JOGL backend, it would allow you to get even better performance and Java2D isn’t a good choice for 2D games except maybe if you keep it very rudimentary.

Best regards.

Edit.: Have you tried to use a GLG2DCanvas?
Edit.: As GLG2D requires JOGL, you have to install JOGL and GlueGen:
http://jogamp.org/wiki/index.php/Setting_up_a_JogAmp_project_in_your_favorite_IDE

Thank you for the link, I’ll surely look into it :slight_smile:

Here is how I tried wrapping my rendering panel:


frame.getContentPane().add(new GLG2DCanvas(MainMenu.headerTitle));

It was gave me the following error:
NOTE: GLG2D jar was present in my build path.


The type javax.media.opengl.GLCapabilities cannot be resolved. 
It is indirectly referenced from required .class files

So I thought maybe I’m missing jogl librarys, I than added the following jars to my build path:


jogl-all.jar
jogl-all-android-natives-windows-amd64.jar
gluegen-rt.jar
gluegen-rt-natives-windows-amd64.jar

It than spat out errors relating to missing .dll files which were all named, so I added them:


nativewindow_awt.dll
nativewindow_win32.dll
gluegen-rt.dll

It than began spitting out errors relating to NoSuchMethodFound so here I am, STUCK :frowning:

I’m a airhead so I’ll be looking into the link you posted, url title sounds like what I need.

Thanks for your help :slight_smile:

You can read about why I’d like to use it here: http://brandonborkholder.github.io/glg2d/

If you don’t feel like reading their front page, I’ll take a few quotes that are behind my motivation for wanting to use it:

My personal attraction/desire for wanting to use it is to accelerate my rendering in Java2D and make it fancier if possible.
In Java2D Graphics all I can find to enhance my rendering is RenderingHints, that’s fine ^^
I’d just like to accelerate my rendering capabilities ^
^

If your game is “static images and text” as you say, then J2D is easily sufficient.

Otherwise the get started tutorial is right there on the homepage. If it’s to difficult to set up at the moment either you should
a) stay with J2D. Like I said it should be good enough. Don’t prematurely optimize.
b) use something “easier”, for whatever definition of easier. For set-up-and-go libGDX is hard to beat in the OGL wrappers/frameworks game. However it may be jarring to get used to coming from straight J2D with little experience in other methodologies.

Do either of these until your problem solving abilities and general programming experience are high enough.

@TehJavaDev What you did to install JOGL is wrong, you should have followed the instructions in the first link. There is no need to use any DLLs, you don’t need Android JARs, … Please follow the instructions first and if you still need some help, contact us on the official JogAmp forum.