Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
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  
  Using Both LWJGL and JOGL  (Read 802 times)
0 Members and 1 Guest are viewing this topic.
Offline SteveJohnson

Senior Newbie




Java games rock!


« Posted 2004-10-03 22:55:33 »

Hello,

 Looking for some advice here.  I have a hang up with having my code work both with LWJGL and JOGL.  However I am completly stuck with creating a generic interface to both.   Is there anything really wrong with just creating an interface with all the gl commands I will use? Somehow I have in my head that that won't work that great seems a waste of having methods that only call one line, but that is the best way to generically call gl methods and have total flexibility.
For example I want an interface called Renderable that has the method render(GLContext),  now GLContext will be the interface and will have all the gl methods that I need on it. Then obviously I have an LWJGL or JOGL class that will create an appropriate GLContext.  I am probably not making any sense and should just go with LWJGL but anyone have any advice?  
Offline ap_kelly

Junior Member




Java rocks!


« Reply #1 - Posted 2004-10-03 23:25:31 »

Doesn't Xith3D do something like this already?

It means that you're not tied to a given implementation. This also lets you implement a software only renderer should you ever need to.

I like the idea but it could be a lot of work to put in before you even start your game or whatever.

Andy.

Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #2 - Posted 2004-10-04 07:14:10 »

We did a similar thing for 2D a while ago in the J2DA project.

http://j2da.sf.net

However, the abstraction was initially over Java2D and JOGL. It would have been pretty easy to implement an additional layer to support LWJGL.

As advice goes a wise man once remarked to me that if you're just "playing" then abstraction of this type can be good fun. If you writing a game you want to complete then make an informed choice on rendering layer and stick to it. *

Kev

* Strictly, he wasn't as eloquent but its what he meant Wink

Games published by our own members! Check 'em out!
Play the free demo of Revenge of the Titans!
Offline princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #3 - Posted 2004-10-04 09:30:27 »

LWJGL utils package already contains a GL interface with GL1.1 to 1.5 and all the extensions, and a class that implements it using LWJGL. You could write a fairly simple adapter for JOGL that implemented that interface (and if you do we'd be grateful if you gave it to us Wink). Expect it to largely be a waste of time, as Kev sort of says...

Alternatively why not use a cut-down JOGL to create your contexts for you if you need AWT, and then use LWJGL to render if you prefer the API.

Cas Smiley

Offline Catharsis

Junior Member




EGR Software rocks!


« Reply #4 - Posted 2004-10-04 22:20:06 »

I have a library with Typhon that allows this.  A lot of code at least for Auriga3D can use the generic library; loading levels, etc.  Auriga3D allows for separate renderering components/plugins that are specific to LWJGL and JOGL in order to be as efficient as possible. The actual renderering loop to display a level in Auriga3D is not long.

I will be releasing Typhon/Auriga3D most likely in December.

Founder & Principal Architect; EGR Software LLC
http://www.typhonrt.org/
http://www.egrsoftware.com/
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Try the Free Demo of Revenge of the Titans

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (131 views)
2013-05-17 21:29:12

alaslipknot (140 views)
2013-05-16 21:24:48

gouessej (170 views)
2013-05-16 00:53:38

gouessej (164 views)
2013-05-16 00:17:58

theagentd (174 views)
2013-05-15 15:01:13

theagentd (159 views)
2013-05-15 15:00:54

StreetDoggy (203 views)
2013-05-14 15:56:26

kutucuk (227 views)
2013-05-12 17:10:36

kutucuk (227 views)
2013-05-12 15:36:09

UnluckyDevil (230 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.08 seconds with 20 queries.