Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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 1703 times)
0 Members and 1 Guest are viewing this topic.
Offline SteveJohnson

Senior Newbie

Java games rock!

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


 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 Devvie

Java rocks!

« Reply #1 - Posted 2004-10-03 21: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.


Offline kevglass

« JGO Spiffy Duke »

Medals: 319
Projects: 25
Exp: 22 years

Coder, Trainee Pixel Artist, Game Reviewer

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

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

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


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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »

Medals: 1012
Projects: 3
Exp: 20 years

Eh? Who? What? ... Me?

« Reply #3 - Posted 2004-10-04 07: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

JGO Ninja

Medals: 73
Projects: 1
Exp: 21 years

TyphonRT rocks!

« Reply #4 - Posted 2004-10-04 20: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.

Check out the TyphonRT Video Suite:

Founder & Principal Architect; TyphonRT, Inc.
Pages: [1]
  ignore  |  Print  

ivj94 (583 views)
2018-03-24 14:47:39

ivj94 (48 views)
2018-03-24 14:46:31

ivj94 (374 views)
2018-03-24 14:43:53

Solater (62 views)
2018-03-17 05:04:08

nelsongames (109 views)
2018-03-05 17:56:34

Gornova (151 views)
2018-03-02 22:15:33

buddyBro (693 views)
2018-02-28 16:59:18

buddyBro (92 views)
2018-02-28 16:45:17

xxMrPHDxx (493 views)
2017-12-31 17:17:51

xxMrPHDxx (733 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!