Is it possible to support JoGL?

Started by bilbo0s, April 13, 2009, 11:04:55 PM

Previous topic - Next topic

EgonOlsen

Quote from: AGP on April 15, 2009, 06:43:14 PM
Egon, can I ask what it is you e-mail him? I'm very interested in this issue right now.
Sure. That were the GL related parts of jPCT for him to port to jogl...which he already did. However, i'm undecided what to do with the port. I can't use it in the way it is, because it's a straight port and it removes LWJGL support. I also don't want to take care of another renderer nor do i want to add an abstraction layer that increases size and slows things down. I have an idea that *might* work instead and i'm currently looking at the port to give it a try...i'll keep you posted.

AGP


EgonOlsen

Works pretty well so far...many many thanks to bilbo0s for his initial port. It has been VERY helpful to me. What i have working now is this: jPCT's renderers are still using LWJGL as ever before. In addition, i'll supply a small jar (around 15kb) called glfacade.jar. If this jar is in the classpath, LWJGL must not be there and JOGL has to be. If this is given and you enable jPCT's canvas renderer, you'll get a JOGL GLCanvas instead and all the rendering magically happens on this canvas. If you enable the normal GLRenderer, you'll get a crash...which is not nice. The denial should be more gracefully...i guess i have to work on this some more...



JavaMan

#18
Great Egon :D I'm not sure what are the big advantages of JOGL vs LWJGL, but its nice to be able to JOGL instead of LWJGL if I ever need to. Also, JOGL should continue to have support from Sun since it is used, I think, in JavaFX.

EgonOlsen

Quote from: JavaMan on April 16, 2009, 12:24:08 AM
Great Egon :D I'm not sure what are the big advantages of JOGL vs LWJGL, but its nice to be able to JOGL instead of LWJGL if I ever need to. Also, JOGL should continue to have support from Sun since it is used, I think, in JavaFX.
Personally, i don't see any advantages...expect for the security dialog thing maybe. I like LWJGL more, but maybe i'm just used to it. But with the current implementation, i can almost ignore the fact that JOGL support is there somehow, which is what i wanted. The drawback is, that you can't switch renderers on the fly, but why would you!? At least that's better than having multiple renderers added to the engine and only one works correctly (like in JME and xith, where JOGL support is broken in JME and LWJGL support is broken in xith).

zammbi

#20
Sounds great that your adding in JOGL support. Everyone at the JavaGaming.Org site knows 1 person over who would loves JOGL ::) , which he says it has less bugs. If that's true or not, at least you get people who think that will use your engine now.  :)
You could also benchmark and see if there's any speed differences  ;) That's if your not sick of benchmarks....

EgonOlsen

Quote from: zammbi on April 16, 2009, 07:39:01 AM
Everyone at the JavaGaming.Org site knows 1 person over who would loves JOGL ::) , which he says it has less bugs.
Ahem...yes. Must be the reason why the stable release of JOGL didn't even work out of the box because a jar was missing...

Quote from: zammbi on April 16, 2009, 07:39:01 AM
You could also benchmark and see if there's any speed differences  ;) That's if your not sick of benchmarks....
It should be a little slower than LWJGL, because it carries the overhead of the AWTGLRenderer with it and all GL-calls go through the facade...plus a tiny little bit of reflection code that i had to use. It shouldn't really matter though and the reflection part can be speed up anyway if needed.

AGP

Also, from what I understand, lwjgl supports OpenGL 3.0 whereas JoGL only supports 2. Still, I'm getting my ass kicked by an lwjgl applet (their appletloader system is clever but doesn't seem to work all the time), so maybe JoGL can help there. Again, Egon, I appreciate all you do here a whole lot. So thanks.

EgonOlsen

OpenGL 3.0 doesn't have much relevance IMHO. If you create a real OpenGL 3.0 context, absolutely nothing will work in jPCT (or any other engine), because they have deprecated almost everything that isn't shader related. In a real 3.0 context, you have to do everything with shaders...there's no support for any fixed function pipeline stuff anymore. However, you can use an 3.0 context that stays compatible with 2.x...but all you get are a few extensions. Nothing to get crazy about.

EgonOlsen

I've just released a second beta that includes the JOGL option. See the news section for more details.

EgonOlsen

Quote from: EgonOlsen on April 16, 2009, 08:11:33 AM
It should be a little slower than LWJGL, because it carries the overhead of the AWTGLRenderer with it and all GL-calls go through the facade...plus a tiny little bit of reflection code that i had to use. It shouldn't really matter though and the reflection part can be speed up anyway if needed.
I stand corrected: Performance is on par with LWJGL. The additional overhead of the facade and reflection isn't noticable.