Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (516)
Games in Android Showcase (122)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  OpenGL/LWJGL over Built-In Libraries?  (Read 4330 times)
0 Members and 1 Guest are viewing this topic.
Offline Quentin

Senior Newbie




Big newb


« Posted 2012-05-25 08:03:22 »

Hey, I've been messing around with Games and stuff in Java for a few days now(planning to not quit this time xD) and I haven't been using any external libraries or anything, just Java's built-in libraries. I've been able to get spritesheets and animations working pretty well.
I used to make a few Minecraft mods, and I've used OpenGL quite a bit, but I don't like how LWJGL works, or at least how Minecraft uses it. Having to download different files for each operating system and all that jazz.

Are there any advantages to using OpenGL/LWJGL over regular Java libraries? If there are massive advantages, are there ways to use OpenGL without LWGJ? If not, is there a way to use your game without getting OS-dependant files all the time?

Thanks!
Online princec

JGO Kernel


Medals: 409
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2012-05-25 08:35:35 »

If you use the standard Java libraries, you don't get any 3D, you get an API that is surprisingly often even more obscure than OpenGL, you get random performance problems (in as much as the performance of any particular version of the JVM on any particular OS is never a known quantity and can range from as fast as OpenGL to 2fps).

If you want consistent, fastest possible performance, you need OpenGL, and the only way to access OpenGL from Java is through either LWJGL, or JOGL, which works in almost exactly the same way. There is no way around the need for native libraries for each OS, but honestly, why do you care about that? They're tiny, insignificant little files that do nothing on the wrong OSes.

Also, you'll probably be wanting some sort of reliable sound and input APIs for your game too, and LWJGL will achieve this for you as well. Games aren't just graphics!

Just do what you want to do in whatever OS you prefer to use and never mind the others until you're ready to show the world.

Cas Smiley

Offline Quentin

Senior Newbie




Big newb


« Reply #2 - Posted 2012-05-25 09:10:21 »

Thanks, princec! I didn't really want to use LWJGL because of having to drag a bunch of files with it. I'd much rather prefer giving people a single file that just works by itself. I think I will start using LWJGL just because you made it sound so much better now xD

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

JGO Kernel


Medals: 409
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2012-05-25 09:52:22 »

When you get to the stage of really wanting to show people stuff... it can be extremely helpful to distribute things in a way that the users of each respective OS expect and understand.

For Windows - that's an installer, either a .exe built with the excellent NSIS installer, or a .msi
For MacOS - a .dmg or .zip containing a single .app structure.
For Linux - gaaaah. I recommend both .deb and .tar.gz. And there are 32 and 64 bit complications.

You'll find significantly more people try out your stuff if you spoonfeed it to them in this way.

If you're really brave you could try applets or even Webstart but then you're into a world of considerably increased pain.

Cas Smiley

Offline gimbal

JGO Knight


Medals: 25



« Reply #4 - Posted 2012-05-25 11:25:09 »

You'll find significantly more people try out your stuff if you spoonfeed it to them in this way.

Speaking from personal experience here?

This has been mine so far.

Me: "Hey friends (because they are, no strangers but people I know and like), I'm working on this and that. Here, see these cool screenshots of the work in progress?"
everyone and their grandmother: "Hey cool man, can't wait to try it out! I'm psyched!"
Me, a month later: "I have the first version ready to test! You can download it here and I created an executable to make it easy to run, etc. etc."
*crickets chirping*

Now I just do stuff I like, its my hobby anyway Smiley
Offline gouessej
« Reply #5 - Posted 2012-06-11 17:50:03 »

If you're really brave you could try applets or even Webstart but then you're into a world of considerably increased pain.
Java Web Start is not very painful, just still a bit buggy.

Offline sproingie

JGO Kernel


Medals: 202



« Reply #6 - Posted 2012-06-11 18:02:06 »

Don't tell your friends that you're "ready to test, download it here and I totally made it easy to run blah blah".  Tell them what to do. "Hey check out what I made: <link here>".  And where the link leads to, include screenshots or heck, a youtube video. 

Marketing 101: The less association they have with something that they didn't care about before, the fresher it is.  Sort of a reverse corollary to brand identity.

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 136
Projects: 4
Exp: 3 years



« Reply #7 - Posted 2012-06-12 03:41:40 »

Yes. Most users don't care about that stuff. Or else they would be the ones writing the code.
Offline gimbal

JGO Knight


Medals: 25



« Reply #8 - Posted 2012-06-12 08:24:22 »

Don't tell your friends that you're "ready to test, download it here and I totally made it easy to run blah blah".  Tell them what to do. "Hey check out what I made: <link here>".  And where the link leads to, include screenshots or heck, a youtube video. 

Marketing 101: The less association they have with something that they didn't care about before, the fresher it is.  Sort of a reverse corollary to brand identity.

It is certainly good advice to apply to strangers, but I'm not going to play marketing/psychology tricks on my friends if you don't mind Wink Its already difficult enough to not do that seeing that I work for a marketing automation company...

(yes, I'm going to hell).
Online princec

JGO Kernel


Medals: 409
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #9 - Posted 2012-06-12 09:00:08 »

On your way down, please kick the Webstart developers and original applet integration team.

Cas Smiley

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

JGO Knight


Medals: 25



« Reply #10 - Posted 2012-06-12 09:33:11 »

On your way down, please kick the Webstart developers and original applet integration team.

Cas Smiley

Nah, those guys and gals only go to purgatory to have some time to think about their actions Wink

Let me be a little more on-topic for a change:

Are there any advantages to using OpenGL/LWJGL over regular Java libraries?

I use Java2D myself and as long as you stick with games that are no more technologically advanced as the 2D games that were created in the late 80's/begin 90's it is fine. But as soon as you want just a little bit more such as draw hundreds of sprites per frame, applying transformations (rotation or scaling for example) or you want to use transparency, the whole thing can crumble depending on what system you run it on. At that point Java2D simply is not an option anymore and you should consider going directly to the hardware, which LWJGL or JOGL allows.

Quote
If there are massive advantages
Its not like people use it because they want to make their life difficult you know, there is going to be a good reason for it Wink

Quote
, are there ways to use OpenGL without LWGJ?
Yes, JOGL. But same difference with less features.

Quote
If not, is there a way to use your game without getting OS-dependant files all the time?

"all the time" is a bit strong isn't it? Once per game install. Right now you could go the JavaFX 2 way and be able to have the games run on Windows and Mac environments with Linux following shortly. But you'd be pioneering a bit as I don't think many people have attempted to create games on top of JavaFX 2 yet. It has a very active community and the JavaFX dev team is really responsive, so its not the worst choice you could make. But I'm doing a bit of guesswork here, I have no idea what the custom painting capabilities of JFX2 are.
Offline ra4king

JGO Kernel


Medals: 353
Projects: 3
Exp: 5 years


I'm the King!


« Reply #11 - Posted 2012-06-12 18:23:21 »

I heard JavaFX 2 is still slow and useless for games. Smiley

Offline gouessej
« Reply #12 - Posted 2012-06-12 19:43:50 »

Yes, JOGL. But same difference with less features.
LWJGL should be compared to JogAmp (JOGL+JOAL+JOCL). I assume the Java binding for the OpenGL API of LWJGL has similar features than JOGL 2.0, neither less nor more, am I wrong? If I am, let us know.

If not, is there a way to use your game without getting OS-dependant files all the time?
It is almost impossible but in all APIs of JogAmp, you don't have any OS dependent setting, you just put all JARs containing classes into the classpath and all JARs containing native libraries into the same directory (but it is not required to put them into the classpath), you don't have to set the Java library path or any environment variable (which depends on the OS).

Only a small part of JavaFX 2.0 source code has been released (sse OpenJFX), I have not yet had a look at it. The previous version of JavaFX used a private build of JOGL 1, it was not that slow but I'm not really sure this API has been designed for games.

Offline Cero
« Reply #13 - Posted 2012-06-12 20:26:31 »

Yes, JOGL. But same difference with less features.
LWJGL should be compared to JogAmp (JOGL+JOAL+JOCL). I assume the Java binding for the OpenGL API of LWJGL has similar features than JOGL 2.0, neither less nor more, am I wrong? If I am, let us know.

Actually JOGL has features that LWJGL doesnt have, for example texture compression like S3TC...

Online matheus23

JGO Kernel


Medals: 110
Projects: 3


You think about my Avatar right now!


« Reply #14 - Posted 2012-06-12 20:29:25 »

Yes, JOGL. But same difference with less features.
LWJGL should be compared to JogAmp (JOGL+JOAL+JOCL). I assume the Java binding for the OpenGL API of LWJGL has similar features than JOGL 2.0, neither less nor more, am I wrong? If I am, let us know.

Actually JOGL has features that LWJGL doesnt have, for example texture compression like S3TC...

Pro tip: gouessej is one of the committers of JogAmp Wink (And I still wonder, why I choose LWJGL instead of JogAmp... sorry LWJGL... Sad )

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline sproingie

JGO Kernel


Medals: 202



« Reply #15 - Posted 2012-06-12 20:42:48 »

Isn't using compressed textures done in the driver, and thus accessed like any other extension?  Not sure in that case how it wouldn't be supported.  A texture compressor would be a nice utility, but others have done it better, and lwjgl's history is one of getting out the utilities morass (e.g. ditching DevIL and FMOD, and hopefully the vector classes in 3.0)
Offline Cero
« Reply #16 - Posted 2012-06-12 21:02:26 »

Isn't using compressed textures done in the driver, and thus accessed like any other extension?  Not sure in that case how it wouldn't be supported.  A texture compressor would be a nice utility, but others have done it better, and lwjgl's history is one of getting out the utilities morass (e.g. ditching DevIL and FMOD, and hopefully the vector classes in 3.0)

Well, looking at this thread: http://www.java-gaming.org/topics/loading-dds-files-to-lwjgl/24633/view
Quote
I think JOGL has some support for it, but I'm using LWJGL.
I'm trying to load S3TC textures into OpenGL.
Quote
You have to do it on your own.

I'm no expert but our OpenGL guy told me this: LWJGL has no Texture Compression but JOGL does. Which of course does not mean it is not doable in LWJGL...

Offline gouessej
« Reply #17 - Posted 2012-06-12 21:40:25 »

Yes, JOGL. But same difference with less features.
LWJGL should be compared to JogAmp (JOGL+JOAL+JOCL). I assume the Java binding for the OpenGL API of LWJGL has similar features than JOGL 2.0, neither less nor more, am I wrong? If I am, let us know.

Actually JOGL has features that LWJGL doesnt have, for example texture compression like S3TC...

Pro tip: gouessej is one of the committers of JogAmp Wink (And I still wonder, why I choose LWJGL instead of JogAmp... sorry LWJGL... Sad )
I'm the guy responsible for engine support:
http://jogamp.org/wiki/index.php/Maintainer_and_Contacts
My biggest contributions are rather in the environment around JogAmp, more than in its core. I have contributed to a lot of projects including NiftyGUI, Xith3D, Ardor3D, JMonkeyEngine 2 & 3, Jeti, Java3D, etc... Maybe we should take care, I don't want to start any flame war and each set of APIs has its weaknesses. For example, JOAL doesn't have (yet) a fully working OpenALSoft support, JInput for JogAmp lacks a plugin to work with our native windowing system (NEWT). Maybe our abstraction of virtual and physical screens could be improved.

Online princec

JGO Kernel


Medals: 409
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #18 - Posted 2012-06-12 23:54:33 »

Last time I looked, about 5 years ago, LWJGL supported texture compression.

Cas Smiley

Offline Cero
« Reply #19 - Posted 2012-06-13 00:07:17 »

Last time I looked, about 5 years ago, LWJGL supported texture compression.

Never mind then. Maybe texture compression is supported but specifically S3TC is not ? =o

Online princec

JGO Kernel


Medals: 409
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #20 - Posted 2012-06-13 00:12:01 »

No, S3TC has been specifically supported for 10000 years.

Cas Smiley

Offline davedes
« Reply #21 - Posted 2012-06-13 01:30:29 »

JogAmp includes some useful features that LWJGL does not. For example: GPU text rendering, texture IO.

The latter feature is probably what had you mistaken about texture compression. It includes a DDS format, which means it can decode a DXTn (S3TC) compressed image. LWJGL doesn't include any image decoders, and so you need to write your own DDS decoder (a basic decoder is fairly simple). However, the actual process of using compressed textures on the GPU has been supported by OpenGL (and thus LWJGL and JOGL) for ages.

Note that these aren't "missing features" of LWJGL. The library is designed to be a "thin wrapper," without the fluff of textures, fonts, etc. This is why Slick-Util tends to be a popular starting point for decoding.

Ideally one day a library more suitable than Slick-Util will take the stage.

Offline gimbal

JGO Knight


Medals: 25



« Reply #22 - Posted 2012-06-13 08:46:54 »

Eh, sorry for being the trigger that caused this thread to derail Wink I was referring to JOGL being "only" an OpenGL binding and LWJGL more a complete set.
Offline ra4king

JGO Kernel


Medals: 353
Projects: 3
Exp: 5 years


I'm the King!


« Reply #23 - Posted 2012-06-13 12:10:32 »

@gimbal it's the other way around. LWJGL tries to have as little utilities as possible. It's only job is to have bindings for OpenGL, OpenAL, and OpenCL. Any other utility is for higher level wrapping libraries.

Online princec

JGO Kernel


Medals: 409
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #24 - Posted 2012-06-13 13:04:34 »

And mouse, keyboard and controllers. And a simple display API.

Cas Smiley

Offline gimbal

JGO Knight


Medals: 25



« Reply #25 - Posted 2012-06-13 13:47:34 »

And a simple display API.

Cas Smiley

Does that include applet/Swing support?

I'm not helping. Why use LWJGL in stead of default JDK stuff. Go!
Online matheus23

JGO Kernel


Medals: 110
Projects: 3


You think about my Avatar right now!


« Reply #26 - Posted 2012-06-13 13:55:30 »

And a simple display API.

Cas Smiley

Does that include applet/Swing support?

I'm not helping. Why use LWJGL in stead of default JDK stuff. Go!


It does include Applet support, but Swing things can be included too, since you have the Display.setParent(Canvas), but in my opinion it's easier with JOGL's GLCanvas Tongue

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline ra4king

JGO Kernel


Medals: 353
Projects: 3
Exp: 5 years


I'm the King!


« Reply #27 - Posted 2012-06-13 14:32:56 »

I don't see the point of relying on at AWT anymore. LET IT DIE! Smiley

Online matheus23

JGO Kernel


Medals: 110
Projects: 3


You think about my Avatar right now!


« Reply #28 - Posted 2012-06-13 16:24:00 »

I don't see the point of relying on at AWT anymore. LET IT DIE! Smiley

Why that? I like awt...

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline ra4king

JGO Kernel


Medals: 353
Projects: 3
Exp: 5 years


I'm the King!


« Reply #29 - Posted 2012-06-13 16:33:14 »

I don't see the point of relying on at AWT anymore. LET IT DIE! Smiley

Why that? I like awt...
I used to like AWT, then I took an OpenGL to the brain.

Pages: [1] 2
  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.

TehJavaDev (31 views)
2014-10-27 03:28:38

TehJavaDev (26 views)
2014-10-27 03:27:51

DarkCart (40 views)
2014-10-26 19:37:11

Luminem (21 views)
2014-10-26 10:17:50

Luminem (26 views)
2014-10-26 10:14:04

theagentd (32 views)
2014-10-25 15:46:29

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

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

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

lcass (43 views)
2014-10-15 16:18:58
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!