Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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  
  I want to use LWJGL, but I don't know OpenGL.  (Read 4266 times)
0 Members and 1 Guest are viewing this topic.
Offline ShadowProtocol

Senior Newbie





« Posted 2010-11-28 05:28:17 »

As topic says, I want to program using LWJGL. I know Java, but I don't know OpenGL. What is THE best way to learn so I can start programming using LWJGL?

My concerns for each method I've come up with so far:

1) If I read the LWJGL javadocs, will I be able to determine which is the starting point, then step 2, then step 3, etc, or will all of the information be given in alphabetical order like all other programming documentation, meaning I can't actually learn by reading the docs, serving as a reference only?

2) If I read the LWJGL and happen to be able to determine the proper order in which it should be read, will I be taught OpenGL using the methods of LWJGL well enough that I'd actually LEARN OpenGL in the process?

3) If I can't learn LWJGL from the documentation, which book is THE best and most current (in regards to the current release of LWJGL) that I can use to learn OpenGL?
3b) Will I have twice as much work to do if I learn OpenGL first, and then have to go back and learn all of the function calls for LWJGL afterwords?

Disclaimer: This is a serious topic which can hopefully bring in some detailed answers. If the quality of replies is good enough, we can probably turn this into an FAQ, so it can serve as a good reference to the people who visit JavaGaming.org.


Thanks everyone
Offline JL235

JGO Coder


Medals: 10



« Reply #1 - Posted 2010-11-28 09:14:40 »

One nice place to start with learning OpenGL is Nehe. They have some good examples for getting started, and some (all?) have been ported to Java.

Not sure if they use JOGL or LWJGL, but I don't believe that should really matter. It's about learning OpenGL not a specific binding.

Offline krasse
« Reply #2 - Posted 2010-11-28 10:05:32 »

I can recommend the book "OpengGL SuperBible". I got the fourth edition which is really a good introduction to OpenGL in my opinion. The fifth edition is more focused on OpenGL 3.0 which is more shader-centered. If you are more interested in writing OpenGL applications for newer, shader-enabled hardware I would recommend the fifth edition, otherwise I would go for the fourth instead.

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

« JGO Spiffy Duke »


Medals: 87
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #3 - Posted 2010-11-28 13:04:27 »

I was in the same position and started with understanding the applet sample on the lwjgl homepage. From there I mainly googled what I wanted to do next and I indeed often ended up on the NeHe tutorials.

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline ShadowProtocol

Senior Newbie





« Reply #4 - Posted 2010-11-28 14:47:28 »

One nice place to start with learning OpenGL is Nehe. They have some good examples for getting started, and some (all?) have been ported to Java.

Not sure if they use JOGL or LWJGL, but I don't believe that should really matter. It's about learning OpenGL not a specific binding.

In that case, I should be able to follow along with the tutorials, and then any time I learn a new GL command, I should just go to the LWJGL docs and find the equivalent?
Offline Mike

« JGO Spiffy Duke »


Medals: 87
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #5 - Posted 2010-11-28 17:25:14 »

They are usually called exactly the same and take the same kind of parameters Smiley

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline ShadowProtocol

Senior Newbie





« Reply #6 - Posted 2010-11-28 18:23:56 »

Ok thanks, I've got my IDE setup (eclipse) with LWJGL libraries ready to go as well. One problem, the NeHe tutorials ported for LWJGL are lessonX.jar files. How can I possibly open that up to view code? lol. I want to see .java files  Sad


I can open them with Winrar and extract the .java files and readme.txt  :]
Offline ShadowProtocol

Senior Newbie





« Reply #7 - Posted 2010-11-29 03:46:04 »

Hi, I am having trouble importing the jar from the topic title. I googled and found out it is in lwjgl_util.jar in LWJGL 2.6, so I added that external jar like I did for lwjgl.jar, but it can't seem to find that particular path.

Can you help me out? The only tutorials for LWJGL are not even tutorials, they are code files from NeHe ports, and those aren't the best for learning  Sad

EDIT: Got the solution. GLU is no longer a part of org.lwjgl.opengl.glu, but belongs to org.lwjgl.util.glu

I'm gonna be upset if Markus Persson (Notch) didn't use these NeHe LWJGL code files to learn, because this is my only resource and I feel like it won't be good enough when I get to the end, but maybe it will be  so I'll be determined to keep at it!!!
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #8 - Posted 2010-11-29 09:32:28 »

Once you've got the basics of the LWJGL Display system theirs not much more to it and the reset is pretty much just raw OpenGL.

Start with this page http://lwjgl.org/demos.php it contains basic single class examples that'll get you started quickly.

Then just grab the OpenGL Redbook, Nehe Tutorials or some other OpenGL guide and work your way through them.

If you just want to start making games quickly without learning OpenGL go for a library that sits on top of LWJGL like Slick2D, jMonkeyEngine, Ardor3d, etc.
Offline cylab

JGO Ninja


Medals: 55



« Reply #9 - Posted 2010-11-29 09:50:15 »

I'm gonna be upset if Markus Persson (Notch) didn't use these NeHe LWJGL code files to learn, because this is my only resource and I feel like it won't be good enough when I get to the end, but maybe it will be  so I'll be determined to keep at it!!!

The idea is to follow the actual NeHe C tutorials and only use the LWJGL ports for reference in case you don't succeed in converting single C calls to their java LWJGL equivalent. DON'T learn from the ports!

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ShadowProtocol

Senior Newbie





« Reply #10 - Posted 2010-11-29 13:39:44 »

The idea is to follow the actual NeHe C tutorials and only use the LWJGL ports for reference in case you don't succeed in converting single C calls to their java LWJGL equivalent. DON'T learn from the ports!

Yep! I have a window up now and can draw my first triangle and quad (and use glColor3F to color the points!)  Yay!!!
But I noticed all of the NeHe tutorials have calls that look like glSomething()  but LWJGL uses GL11.glSomething().

Will I always just add GL11. to get the equivalent call?
Offline cylab

JGO Ninja


Medals: 55



« Reply #11 - Posted 2010-11-29 14:37:43 »

Will I always just add GL11. to get the equivalent call?

Even simpler, do a
1  
import static org.lwjgl.opengl.GL11.*


and you are freed from the GL11 prefix...

Mathias - I Know What [you] Did Last Summer!
Offline ShadowProtocol

Senior Newbie





« Reply #12 - Posted 2010-11-29 14:56:00 »

Even simpler, do a
1  
import static org.lwjgl.opengl.GL11.*


and you are freed from the GL11 prefix...

How come GL_COLOR_BUFFER_BIT and GL_DEPTH_BUFFER_BIT didn't fix until I added "static"  to import static org.lwjgl.opengl.GL11.*   

?
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #13 - Posted 2010-12-01 12:26:00 »

Never heard of static imports? There were added in Java5. Just google it, and you'll see how they work.

For a quick introduction:
[import] imports classes
[import static] imports static fields and methods from classes

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
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.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!