Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
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 3323 times)
0 Members and 1 Guest are viewing this topic.
Offline jparril1

Junior Devvie

« 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.glOrtho(0, 800, 600, 0, 1, -1);

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

Junior Devvie

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 Devvie

« 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 Devvie

« 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 Devvie

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: 96
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 Devvie

« 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 Spiffy Duke »

Medals: 581
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: 96
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 Devvie

« 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.

KaiHH (12 views)
2015-10-06 20:22:20

KaiHH (11 views)
2015-10-06 19:41:59

BurntPizza (21 views)
2015-10-06 19:04:48

basil_ (44 views)
2015-09-30 17:04:40

shadowstryker (22 views)
2015-09-29 15:55:06

TheSpaceHedgehog (28 views)
2015-09-29 01:58:48

GamerC4 (54 views)
2015-09-24 21:10:38

GamerC4 (71 views)
2015-09-24 21:09:48

htuy (28 views)
2015-09-24 04:57:24

htuy (38 views)
2015-09-24 04:56:35
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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‑
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!