Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (564)
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  
  GL4Java or LWJGL?  (Read 4776 times)
0 Members and 1 Guest are viewing this topic.
Offline jhawkes

Junior Newbie




Have you seen my glasses?


« Posted 2003-03-06 16:27:17 »

Ok, I'm new to the whole Java gaming scene so humor me. Roll Eyes  (I am, however, an experienced enterprise Java programmer.)  What's wrong with GL4Java?  In other words, why LWJGL?  I've never used either binding, but I've seen some pretty neat demos done with GL4Java.  I've also heard some scary things about LWJGL (direct memory access through pointers in Java!)  Also, GL4Java is available for multiple platforms whereas LWJGL (at the moment) is not.  What's the deal?  Where is GL4Java's fatal flaw? Huh


BTW: Smileys are fun  Grin
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #1 - Posted 2003-03-06 17:03:42 »

Quote
Also, GL4Java is available for multiple platforms whereas LWJGL (at the moment) is not.


LWJGL is available on Windows & Linux - Mac OS X is in the works, but until Apple releases 1.4.x that version is being stalled.

Quote
What's wrong with GL4Java?

`
This perhaps?
1  
Version 2.8.2 - Release 0 - 11th December 2001


Or just the simple fact that GL4Java is about OpenGL for Java (incedently), where as LWJGL is about creating a barebones library for accessing the required HW to do games (graphics, sound, input & vector math for 3d operations)

Quote
I've also heard some scary things about LWJGL (direct memory access through pointers in Java!)

Not scary... and besides - we want performance!

Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #2 - Posted 2003-03-06 17:17:30 »

Also, currently if you want to mix your OpenGL display with AWT or Swing, you can't do it with LWJGL.  Also, LWJGL is intended to be used full-screen - windowed mode is a little... primitive. Wink

However, LWJGL also gives you access to an OpenAL implementation for sound support, and interfaces for using mice, keyboards, joysticks and gamepads.

If you're political sort, it's also worth noting that LWJGL is BSD, GL4Java is LGPL. Grin Roll Eyes

LWJGL's "scary" pointer stuff is really easy and not scary at all once you work out what it's doing.  It's all in the name of making things faster.

There are advantages and disadvantages to both - you have to decide based on your needs.

Hellomynameis Charlie Dobbie.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jhawkes

Junior Newbie




Have you seen my glasses?


« Reply #3 - Posted 2003-03-06 17:26:43 »

When I say "scary", I don't mean that I'm scared of pointers.  I started out as a C programmer.  The scary part is that pointers defeat one of Java's primary design goals.  Java programs are intended to run in a strictly controlled environment.  Giving programs unrestricted memory access is not something that I find acceptable for a Java program.  It will certainly never be supported by Sun.
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #4 - Posted 2003-03-06 18:24:48 »

Quote
It will certainly never be supported by Sun.

http://java.sun.com/j2se/1.4/docs/guide/jni/jni-14.html#GetDirectBufferAddress

You were saying?
Tongue

Offline princec

JGO Kernel


Medals: 380
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2003-03-06 18:56:25 »

We don't give programs direct memory access, we only give them opaque integer handles. They just happen to be pointers but there's no way to use them as pointers from Java. Your code is safe Smiley You can still crash the VM and cause all sorts of mayhem by getting it wrong but there's very few places in OpenGL that write back to client memory so you just have to keep them watertight.

We would have stuck to using DirectByteBuffers instead but discovered there was a significant overhead calling GetDirectBufferAddress which added up to a large overhead during the course of a typical video frame.

But the key crucial difference is:

- if you want to write OpenGL games that use windows, AWT controls, or even Swing widgets, and are fractionally less concerned about frame rates and the very latest features, you need GL4Java.

- if you want to write the lowest-level, fastest code around and want to write full-screen game applications using the latest technology without the help of the AWT, LWJGL is for you. LWJGL turns your computer into a console running a JavaVM, no less. By only a short stretch of the imagination we might get it ported to something like PS3 pending some OpenGL drivers. Put that in your pipe and render it!

Cas Smiley

Offline mitu

Senior Newbie




Java game newbie extraordinaire!


« Reply #6 - Posted 2003-03-07 07:26:05 »

Funny, I just stopped by to start a thread with the exact same name! So, I thought I'd just post in here Smiley

I'm still so very confused as to which API to use. I've read around these boards for hours, but still, I'm finding it difficult to decide.

I'm completely new to games programming, although not too new to Java and C/C++. Hence, I've been doing a lot of hunting for tutorials and such ,and it seems to me that gl4java has more documentation for newbies? (the thread http://www.java-gaming.org/cgi-bin/JGOForums/YaBB.cgi?board=LWJGL;action=display;num=1045166451 is probably a prime example of this?). Am I wrong in thinking the only beginners resource for lwjgl are the examples included in the distribution?

I am very keen to get to started with java games, so I'd really appreciate if anyone could convince me either way? Smiley

Edit: forget what I said about newbie tutorials/documentation - I since found chman's site Smiley

Offline mitu

Senior Newbie




Java game newbie extraordinaire!


« Reply #7 - Posted 2003-03-07 07:56:18 »

Oh, if it's at all relevant, I should probably mention that I am interested in both 2d and 3d.

Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #8 - Posted 2003-03-07 10:19:15 »

That's a fair comment.  However, GL4Java has been running a lot longer than LWJGL - while LWJGL only officially started work July last year, GL4Java was already on version 2.0 over 4 years ago.

There's already a large number of (ported) tutorials available for LWJGL, and people on this site are usually helpful. Grin

With documentation being such an enjoyable task for programmers, I'm sure when LWJGL reaches version 1.0 it will have full Javadoc, installation and troubleshooting guides, example code etc. Roll Eyes

Hellomynameis Charlie Dobbie.
Offline mitu

Senior Newbie




Java game newbie extraordinaire!


« Reply #9 - Posted 2003-03-07 10:22:14 »

Actually, in an amazing overcoming of my indecisiveness, I just decided I will stick with lwjgl after all!
Thanks, cfmdobbie

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

JGO Kernel


Medals: 380
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2003-03-07 11:07:00 »

There's a bunch of useful bits of code in my Shaven Puppy Game Library too, for stuff like creating textures and the like. Maybe the most useful stuff in there is the font rendering and converting code.

You've got to remember that with LWJGL you basically don't/shouldn't have access to any AWT classes - which sadly includes BufferedImage and ImageIO and all their little friends like Points and Rectangles and Dimensions - so you've got to have something in their place.

Cas Smiley

Offline princec

JGO Kernel


Medals: 380
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #11 - Posted 2003-03-07 11:07:44 »

LWJGL is the way of the Samurai  Cool

Cas Smiley

Offline jhawkes

Junior Newbie




Have you seen my glasses?


« Reply #12 - Posted 2003-03-07 16:38:50 »

Quote


Matzon, I think you missed the point...

princec, I found your answer helpful.  Now I know the difference.  Thank you.
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #13 - Posted 2003-03-07 17:24:05 »

Quote
Matzon, I think you missed the point...

no no no - why did you think I added the  Tongue

Wink

Having opaque pointers, like we have in lwjgl, does indeed support the Java Security Model - we are aware of that. But the purpose of lwjgl, isn't to be a general purpose java library  - like the Collections class, but more of a direct route to the HW. If you want to go the "Java way" by all means use Java 3D, however if you want the job done, without all the fuss, lwjgl is the library of choice for high performance graphics and indeed sound.

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #14 - Posted 2003-03-07 18:56:08 »

Its in the API and lwjgl isn't doing anything that Java3D itself isn't already doing so I would argue that lwjgl is just as much the Java way as Java3D.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline princec

JGO Kernel


Medals: 380
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #15 - Posted 2003-03-07 19:35:38 »

He means the "Sun way" I think.
Or is that "wrong way"? Grin

Cas Smiley

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #16 - Posted 2003-03-09 03:06:03 »

Well I don't want to go bashing the Sun folks - they've done good stuff in the past. They just never really aimed their work at gaming and apparently never surveyed game developers when building their game oriented solutions.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline princec

JGO Kernel


Medals: 380
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #17 - Posted 2003-03-09 09:41:34 »

I hope they're getting a lot of feedback in here now. It's been, what, 2 years or so?

Cas Smiley

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #18 - Posted 2003-03-09 18:43:33 »

I'm sure they're getting a lot of good feedback, and if they're smart - they're looking at how to promote LWJGL as a Sun solution the same as they do all of the Apache stuff. It would be 'unfortunate' if they went off and tried to keep up with us on their own. We'll toast them easily Smiley

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline princec

JGO Kernel


Medals: 380
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #19 - Posted 2003-03-09 21:18:46 »

Yes, especially as I'm beginning to have sneaky thoughts about a proper game-orientated scenegraph library on top of SPGL...

Cas Smiley

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.

Grunnt (20 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (108 views)
2014-09-10 06:39:09
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!