Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (546)
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  
  LWJGL Beginning  (Read 2620 times)
0 Members and 1 Guest are viewing this topic.
Offline jparril1

Junior Member





« Posted 2011-03-17 03:31:25 »

hey guys,
     
          Even though Im still learning to get better at using just core Java for games, I want to begin messing with LWJGL drawing. I started with the tutorials at NinjaCave, and they were helpful. I really like to learn from the API documentation, but the javadocs for the LWJGL are basically non existant. I looked in the documentation for the GL11 class, and there are no descriptions at all for the fields or methods. The only things I found actual write ups for are the Mouse, Keyboard, Display, etc classes. So Is there somewhere that I can learn what all these methods and fields are?? Some examples:

GL11.glMatrixMode(GL11.GL_PROJECTION);
      GL11.glLoadIdentity();
      GL11.glOrtho(0, 800, 600, 0, 1, -1);
      GL11.glMatrixMode(GL11.GL_MODELVIEW);

This stuff works... but I have NO IDEA what is what
Offline IronclawsBt

Junior Member


Medals: 1



« Reply #1 - Posted 2011-03-17 03:40:47 »

You should look at the Redbook. It is the programming guide for OpenGL. The commands for LWJGL are pretty much identical to the normal OpenGL calls, so it should be strait forward to use other material. If you dig around on the LWJGL page you can also find some additional information in the documentation section.

It's not what you know, it's what other people think you know.
Just hope you don't get quizzed on it.
Game engine design tutorials
Offline SimonH
« Reply #2 - Posted 2011-03-17 03:42:10 »

...or use the openGL docs.
'It works' is good! Working in GL takes a change of headspace!

People make games and games make people
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jparril1

Junior Member





« Reply #3 - Posted 2011-03-17 04:37:00 »

Wait, so the LWJGL syntax is the same as plain OPENGL? So does LWJGL just add some methods specific to game creation?? Confused now!
Offline Bonbon-Chan

JGO Coder


Medals: 12



« Reply #4 - Posted 2011-03-17 07:55:59 »

LWJGL is mainly an OpenGL binding. With it, you can access low level hardware acceleration : OpenGL, OpenAL, joystic/joypad (with a simplier class than JInput).

LWJGL is not a game engine, it doesn't add class to deal with texture/sprite loading for example. If you want a game engine, there is quite some that use LWJGL  Wink.
Offline lhkbob

JGO Knight


Medals: 32



« Reply #5 - Posted 2011-03-17 15:11:32 »

As you saw before, LWJGL had classes for keyboard and mouse handling.  LWJGL also lets you create windows.  OpenGL does not control keyboard/mouse input or window creation (it assumes the OS can do that).  So LWJGL has a Java binding to OpenGL as well as other classes to manage displays (and interact with them).

All of the GL11.glXYZ calls are Java methods that match the identically named OpenGL functions.  The Java OpenGL bindings in LWJGL are organized by OpenGL version or extension.  So GL11 contains the functions for OpenGL 1.1, GL20 has OpenGL 2.0, etc.  You will not need to worry about extensions for a while.

Offline jparril1

Junior Member





« Reply #6 - Posted 2011-03-17 15:32:00 »

Ah ok, a game engine is NOT what I wanted so this is good. Im going to pick up a good OpenGL book then or read some docs online. Thanks for the help guys. What Im curious about is, does LWJGL support image loading and all of that stuff or am I going to need to use SLICK2d or some other libraries. My goal is to learn as much of the lower level stuff as possible, without the unnecessarily low level stuff of course. So would I not be able to use the old java classes such as Image and ImageIcon while using LWJGL? Or can I combine them? This is actually pretty confusing
Offline xinaesthetic

Senior Member


Medals: 1



« Reply #7 - Posted 2011-03-17 17:18:51 »

So would I not be able to use the old java classes such as Image and ImageIcon while using LWJGL?
Not directly.  You'll have to get at the actual Image data and take care of setting up GPU memory and transferring it to OpenGL.  I'm sure there are examples of that about.

I'm not actually familiar with LWJGL; FWIW JOGL has some helper classes for loading textures and such... in fact, the JOGL source might not be such a bad place to look for an example of how to load data from a Java Image into an OpenGL texture.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 75
Projects: 15


★★★★★


« Reply #8 - Posted 2011-03-17 17:21:16 »

About loading textures, you should have look at the LWJGL Wiki, theres a number of options and help classes there that you can use to load textures with LWJGL including ones that use AWT.
Offline jparril1

Junior Member





« Reply #9 - Posted 2011-03-18 18:23:39 »

Ok so the latest edition of the RedBook got awful reviews saying that 90% of the code is deprecated.. any truth to this? I was thinking of getting the superbible. Some people said to get the older edition, something about OpenGl switching something with functions and pipelining in the newer releases?? Honestly I have no idea what theyre talking about, I just want to get the best book lol.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 359
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2011-03-18 19:37:06 »

This is true; a fairly large amount of stuff in the Red Book is out-of-date, but: it teaches the basics, and it all still works, and the 10% that isn't deprecated is still the way you're meant to do it.
The NeHe tutorials are supposed to be pretty good.

Cas Smiley

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 75
Projects: 15


★★★★★


« Reply #11 - Posted 2011-03-18 19:52:21 »

IMO the new opengl stuff (opengl 3.0+) is overrated, its all cool stuff but hardly any low end/mid range cards support it yet. Until that changes the old stuff is still good to use for mass distribution.
Offline jparril1

Junior Member





« Reply #12 - Posted 2011-03-18 20:10:30 »

Ok, so if I were to get the SuperBible, should I get the 4th edition from 2007 or the 5th from 2010?
Offline ReBirth
« Reply #13 - Posted 2011-03-20 04:16:41 »

LWJGL wiki is already enough I think. For the rest just google it.

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.

atombrot (19 views)
2014-08-19 09:29:53

Tekkerue (21 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (11 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (55 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (26 views)
2014-08-08 02:01:56

Norakomi (35 views)
2014-08-06 19:49:38

BurntPizza (64 views)
2014-08-03 02:57:17
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!