Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (798)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (865)
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  
  [solved] Getting GLG2D to work in my Java2D game.  (Read 3106 times)
0 Members and 1 Guest are viewing this topic.
Offline TehJavaDev

JGO Knight


Medals: 17
Projects: 3
Exp: 7-9 months


Java is so dope they wanna >:D


« Posted 2014-08-29 08:01:26 »

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 ^__^

Checkout my new easy to use java networking library: GNetLib
Offline trollwarrior1
« Reply #1 - Posted 2014-08-29 08:03:33 »

Any reason why GLG2D (I don't even know what that is..)
Offline TehJavaDev

JGO Knight


Medals: 17
Projects: 3
Exp: 7-9 months


Java is so dope they wanna >:D


« Reply #2 - Posted 2014-08-29 08:06:20 »

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 ^__^

Checkout my new easy to use java networking library: GNetLib
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Gibbo3771

JGO Kernel


Medals: 128
Projects: 5
Exp: 1 year


Currently inactive on forums :(


« Reply #3 - Posted 2014-08-29 08:34:56 »

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.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline trollwarrior1
« Reply #4 - Posted 2014-08-29 08:39:01 »

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?
Offline gouessej
« Reply #5 - Posted 2014-08-29 11:56:18 »

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

Julien Gouesse | Personal blog | Website | Jogamp
Offline TehJavaDev

JGO Knight


Medals: 17
Projects: 3
Exp: 7-9 months


Java is so dope they wanna >:D


« Reply #6 - Posted 2014-08-29 22:03:44 »

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 ^_^

Here is how I tried wrapping my rendering panel:
1  
frame.getContentPane().add(new GLG2DCanvas(MainMenu.headerTitle));


It was gave me the following error:
NOTE: GLG2D jar was present in my build path.
1  
2  
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:
1  
2  
3  
4  
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:
1  
2  
3  
nativewindow_awt.dll
nativewindow_win32.dll
gluegen-rt.dll


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

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 ^_^

Checkout my new easy to use java networking library: GNetLib
Offline TehJavaDev

JGO Knight


Medals: 17
Projects: 3
Exp: 7-9 months


Java is so dope they wanna >:D


« Reply #7 - Posted 2014-08-29 22:11:45 »

However, could you just tell us if there is any specific reason you need to use GLG2D?

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:
Quote
The most recent versions of the Oracle JVM have an OpenGL pipeline to accelerate drawing on some platforms. But the pipeline doesn't use the full power of OpenGL since it doesn't make use of OpenGL's ability to draw primitives directly, like glRectf*().

Quote
The Oracle implementation processes most of the Graphics2D calls in Java then sends very primitive commands to the OpenGL system. In addition, Oracle's implementation is not very reliable and will not work on some platforms.

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 ^_^

Checkout my new easy to use java networking library: GNetLib
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #8 - Posted 2014-08-29 23:55:21 »

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.
Offline gouessej
« Reply #9 - Posted 2014-08-30 08:49:02 »

@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.

Julien Gouesse | Personal blog | Website | Jogamp
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (45 views)
2019-09-04 15:33:17

hadezbladez (4025 views)
2018-11-16 13:46:03

hadezbladez (1468 views)
2018-11-16 13:41:33

hadezbladez (4048 views)
2018-11-16 13:35:35

hadezbladez (780 views)
2018-11-16 13:32:03

EgonOlsen (4098 views)
2018-06-10 19:43:48

EgonOlsen (4685 views)
2018-06-10 19:43:44

EgonOlsen (2762 views)
2018-06-10 19:43:20

DesertCoockie (3657 views)
2018-05-13 18:23:11

nelsongames (3867 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
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!