12 comments

[ 2.9 ms ] story [ 33.9 ms ] thread
It blows my mind that there are still people calling it 'JAVA' instead of 'Java' in 2011.
It blows my mind that there are still people linking to tutorials that instruct people to use immediate mode in 2011.
Please, link to something better.
I suppose you've missed the title OpenGL in "Java". You point to a nice website that teaches you how to use OpenGL in ... C++.

Anyway I doubt JOGL does not let you to use buffers, so you can draw in memory and after that draw on screen. Even the Red Book starts with drawing directly on the screen; the double buffer technique is useful for animations ...

It's the idea that counts, not the language. The number of OpenGL function calls balloons very quickly when using immediate mode.

For example, I recently prototyped a simple 16x16 tile demo over an 800x600 screen. In immediate mode, that's 1900 tiles on screen at once, and each one demanded 4 calls for tex coords (GL_QUADS) and 4 more for vertex data. That came to 15200 OpenGL calls every single frame, enough to stress my modest hardware. With vertex arrays, buffers or display lists, that could be brought down by orders of magnitude, probably with a dramatic performance boost.

Most people hardware is much better than mine, but my point is that OpenGL immediate mode doesn't scale well even for simple things.

Step 1) Stop! Setp 2) Consider WebGL, C, or C++
C/C++ works only for desktop based apps, try to put a C++ app on a webpage.

WebGL yes, for HTML5 aware web browsers and if you want to have your source code open (maybe I'm wrong here, but I've understand that the code will be available just like any JavaScript code on the page source). Maybe in a few years.

As an example of why Java+OpenGL could be an interesting thing to study even today I would say a single word ... minecraft:

http://www.minecraft.net/

Just go read the source to NASA Worldwind :)
Why "JAVA"? It's not an acronym, it doesn't stand for "Just Another Verbose Algol".