JAVA and OpenGL

right now I implement OpenGL in C++ (Borland C++ Builder). Do you think this is a good strategic combination for industrial applications?

What do you know about OpenGL and JAVA? I did never code JAVA. What compiler would you use to code JAVA? What is standard? How easy is it to implement OpenGL…

Thank for your help!!

Originally posted by evian:
right now I implement OpenGL in C++ (Borland C++ Builder). Do you think this is a good strategic combination for industrial applications?

C/C++ suit very well for such applications. Actually java always seems a bit slower than C/C++ programs.

For java, you need the java SDK for your plateform (available at the sun website). You’ll also need java-gl. At the time I was doing some Java, it appeared that there were 2 ways to do gl within this language: so check that too.

as regards Java and Opengl you have two relatively mature bindings, JOGL and LWJGL. JOGL is the (soon to be?) official Sun java binding, integrates with swing, java 1.6 or later apparently will use it for hardware accelerated GUI elements. LWJGL is an opensource (LGPL) binding thats been used in a few commercial games (tribal trouble, Ultratron) and includes the binding and sound/input libraries combined. The javagaming forums are at …

do a search on JOGL v LWJGL or read their respective forums to get an idea of the strangtsh and weaknesses of the two bindings.


Java’s greatest strength is factors into its strongest weakness. And that strength is that it is, by and large, interpreted. Now, that makes it great for anything that must be expected to run over a myraid of operating systems, but it costs you in speed to do it.

And keep in mind that because all Java apps require the VM, you’re necessitating that people install more than your game on their machine in order to play it (assuming that they do not already have the VM installed).

Every language has its strengths, but I do not believe that Java’s strength lies in high-performance games.

As to which of the Java-OpenGL bindings are better, that’s something for the fanboys to fight over.

Quite luckly, I’m developing a Java JOGL program right now.
The impressions are that Java does not seem to be so much slow (altough I still have to benchmark it) but I think it eats up much more memory than C.
JOGL itself is good but there’s something I don’t really like.
Personally, as soon as this is completed, I’ll go back to C. While Java effectively has broader audience and faster prototyping, I am way too experienced with C and I find Java constraining.
Right now, JOGL have some dirty problems with installations, which are not easy on linux (not tried on win32 yet). Java Web Start easily solves the problem but it also gives you a sandbox to deal with.

So, my choice would be C/C++ and GL but I guess it depends on how much experience do you have on your head.

Thank you so far, that gave me an impression.

Actually I do not want to code games. I would like to code industrial stuff, e.g. visualization of 2D and 3D data. I thinks I am ok with C++ there.

Where would you define the “border”, where a application cannot be done anymore with C++ graphics commands only?

Do you think the OpenGL commands will “loose their power/magic” one day, because everything can be done with the programming languages itself??

Have a great weekend friends!

No ! I think you misunderstand some things. OpenGL is a library, implemented for several languages (ranged from C up to Visual Basic). A language is (almost) just a mean in order to interface between the programmer and the machine.

Nowadays, GL allows us to directly use the GPU for performing some graphic stuffs (and even if it’s not graphical). Noone (I guess) will never be able to do some stuffs on the GPU without using GL (or Dx). When you program with any language, you program the CPU not the GPU. Actually, the single exception is from using shaders (GLSL, HLSL, cG) but they all are inherited from GL (that’s a library).

Still from the older days, anyone was able to do some 3D: this was not a limit from the language or the library but was limited by the computer performances only. Now the computers are more performant this changes many things, but really that’s not a language that prevents someone from doing any 3D. (of course, some languages are inherited from their system, so some are slowler, some are fast…).

If you don’t want OpenGL for doing 3D, don’t use it ! But since Geforce series, your applications will be slowler than those using T&L, shaders and so (so threw GL or Dx).

If you want some limits, they all came from different kind of things: what you want to do, how fast you need it to perform, how real you want it to look and so on. If you want to make the new Quake 2, then I’m pretty sure you can do it without using GL at all, just by doing some maths on the CPU. This is the same for industrial applications: if the simulation is really more important that the look, then GL might not suit your needs.

I reread your last question. And I guess you might be right. If we look well, shaders are replacing default GL commands (Translate,Rotate…) but shaders are still part of GL. I guess this is the aim: beeing able to program whether the CPU or the GPU. Using normal ways (C,C++,Java…) will do stuffs on CPU, and using shaders will do work on GPU.

Hope I answered your questions.

See, the reason I ask is easy! I do not want to critisize OpenGL or something!! I am thinking of starting up a little programming bureau for programming C++ and OpenGL. Mainly for the industry. I just try to find out, if OpenGL will survive as it is today. Or if all the commands can be done by the languages itself one day. You understand the background of my question now. I like OpenGL and think it would be fun for me doing it. Hope there is a market…

Okay evian :slight_smile: Since I didn’t knew that, I had to do assumptions. Now that you stippled explicitly your aims, I must admit I was regarding you wrong. Anyway, I appreciate your aims.

I think (is it a hope ?) that OpenGL will ‘survive’ a long time. Even if Microsoft actually wishes to ‘erase’ GL from its (let’s say) OSes, OpenGL is widely used anywhere else: from Linux to embeded systems, VR, sciences and so on.
Just see on this site: does it look dead ? No.

I think too that GL won’t be integrated into a language, just as linked lists or trees aren’t. OpenGL is a mean to represent graphical stuffs, not a mean to solve general stuffs.
Java is an exception as it is a mixture of a language and a wide common library. And Java specifications aren’t free at all.
I remembered I used only a single program written in Java for making some UML. It was really heavy, memory hungry, slow. I stopped using it since I didn’t want to buy a too much expensive computer :wink:
More, OpenGL includes a pretty full language for doing GPU stuffs (GLSL).

Now regarding OpenGL and the industry. I must admit I find that a bit large. What industry do you aim ? Games ? Car/engines ? Aerospatial ? Medical ? A mixture of all of them ? Others ? (I don’t expect an answer on this one as it might be personal).

Well, if I where you, I would use C++, OpenGL and Linux (all are free and powerful !). But if you want to do VRML or little applications that might not suit your needs.

Hope that helps.

Do U think OpenGl and JAVA will be widely and frequently used in programm,when computer hardware
higher in future.

This might not be an industrial example, but its a great way to demonstrate what Java and OpenGL is capable of:

My best java builder ( and compiler ) is Visual Age for Java, this is an IBM program and i think it is free, or maybe just for 3 months, but you can install again, and all the problems gone. In java the only difference that is opengl hasn’t got global funtions :slight_smile: