Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 1057 times)
0 Members and 1 Guest are viewing this topic.
Offline SteveJohnson

Senior Newbie




Java games rock!


« Posted 2004-10-03 20: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 Duke




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.

Andy.

Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 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.

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!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 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 Coder


Medals: 9
Projects: 1
Exp: 18 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.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (36 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (27 views)
2014-10-15 16:18:58

TehJavaDev (52 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (42 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (77 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!