Jump to content
  • Advertisement
Sign in to follow this  
Luckless

[java] Best Documented OpenGL bindings for Java?

This topic is 4487 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For the last few weeks, I have been trying to get into 3D programing, however most guides to JOGL, LWJGL and that are all "Ok, here is a basic program that does stuff, don't worry about how it works, just follow along, you can stumble around later trying to work out just what we're talking about, because clearly no one wants to spend days reading background info before they see something on screen!" What is the easiest way to get started, learning the basics (draw and texture simple shapes) in a clear manner that lets you know WHY something works. (lack of ogl being OOP doesn't make it easier) Does anyone have a link to docs clearly explaining how to use the state machine, and how/why it works that way? And does the Red/Blue book cover things the same for a Java Binding as it does for standard C? Or are they more of an annoyance to use with Java? Thank you. (if mods feel this would do better in the main OGL forum, then feel free to move it there. I figured most people that knew the Java and OGL would be more likely to see here)

Share this post


Link to post
Share on other sites
Advertisement
its important to remember the apis are just bindings...both lwjgl and jogl are almost exact copies of regular opengl calls, so the usual opengl sources (red book, nehe, etc) will do you fine. the only niggling issues are with things like buffers replacing arrays in the original C, and that should be pretty quick to pick up (i think lwjgl has a pretty good wiki entry on using them).

Share this post


Link to post
Share on other sites
As already explained above, the red book and all OpenGL references are valid when using a binding - simply because these projects are bindings, and not APIs themselves.

The only differences you will find between JOGL and LWJGL are Sun's support for JOGL and some design differences. When it comes down to documentation, both have to document the parameters of the OpenGL API. Since documenting OpenGL itself isn't their responsibility, all you have is a referece in each method's doc, in order to help you recognize which method you're invoking in the underlying API, and what effect each parameter has, etc..

About the buffer/array issue, there's a commotion in the community requiring support for structs on the Java language. That would allow to map the input data for OpenGL directly in memory, and so benefiting performance and making programing in this paradigm quite easier.

Cas is the one who started the talks, so he's obviously the one suited to clarify this matter, but certainly we should look into it and take a side - if such benefits are indeed valid for the gaming community, we should try to achieve them.

Son Of Cain

Share this post


Link to post
Share on other sites
For some quick sample code to get you up and running, these demos should show you pretty much everything in the LWJGL api.

Other than that all the GL stuff works exactly like the C commands described in the Red Book.

Share this post


Link to post
Share on other sites
Some of the easiest to use documentation for OpenGL calls that I have found are actually those made for PyGL. I frequently use them for both C and Python OpenGL functions. You can find them here.

Hope that helps.

Share this post


Link to post
Share on other sites
Hi,

"The Red Book Examples using JOGL

This page contains ported C examples from the OpenGL Programming Guide (affectionately known among graphics programmers as the "red book"). They were ported using javax.media.opengl extension library."

Linky.

:)


- Chris

Share this post


Link to post
Share on other sites
NeHe has a lot of tutorials of OpenGL, many of which have been ported to different languages, including several Java bindings of OpenGL. You'll find them at the end of each tutorial. Keep in mind that some of the stuff covered will not work exactly the same (e.g. some font stuff, etc.) as given in the tutorial but is ported correctly (and usually documented) in the source. I won't say which I use (to make you lean toward one binding or another), but I would suggest just giving a few a try before deciding on one. May cost you a few days dev time, but save you being stuck having learned a bad binding later on.

Share this post


Link to post
Share on other sites
oh, right, forgot to post a thanks. Rated you all up but didn't say anything.

Been reading an online copy of OGL programing guide. And I must say, getting up around chapter 3 it become painful to keep going in one sitting. (and it isn't eyestrain painful) So, now to skip around it, finding interesting parts to read first.

That or I'm just going to skip reading that, and go for the straight docs. I'm not actually in a hurry to finish anything, so reinventing the wheel sounds fun! Screw efficiency, lets see just how many minutes it can take me to render a few untextured quads. Then I'll get back to you all to ask how much of a second it should be taking. :P

Share this post


Link to post
Share on other sites
Hi,

Thanks for the rate up :)

Also you may want to take a look at the jMonkey Engine (jME) which is a scene graph api. It sits on top of any rendering api (currently only lwjgl) and generally does a lot of helpful things for you. Meaning you wouldn't actually need to learn OpenGL as you'd be working at a higher abstraction level.

Of course if you want to learn OpenGL for the sake of learning, jME wouldn't help you there :P but if just want to make games I'd check it out for sure.


- Chris

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!