Need some startup directions

Hi,
I’ve been develping games with core J2SE for several years and with C++/Direct-X before that. But now I want to start to use JOGL for my 2D games.

But which is the best aproach? To start look at the not to many JOGL 2D examples and open source projects or start by concentrating on just OpenGL and learn from C++ examples and tutorials?

Are there alot of API or coding diffreneces when using JOGL compared to OpenGL using C++?

I could realy use some pointers about this matter.

The best you can do is learn OpenGL first. If you skip this step, you’ll find yourself scratching your head for hours, wondering why it doesn’t work. The OpenGL Redbook is an excellent starting point.

Once you have read the first few chapters, you can read about the basic framework of a JOGL application. Syntax is almost the same, you just have to pass along a GL object in your rendering code.

gl.glEnable(GL.GL_TEXTURE_2D);

When you are using java 1.5 you can use the static import to make it even more like C code

gl.glEnable(GL_TEXTURE_2D);

If you decide not to pass the gl-reference around (and you need only one instance - one canvas), you can use some class with a public-static reference to your gl-object, and combined with static-import, write your opengl-calls like:

glEnable(GL_TEXTURE_2D);

So much for the syntax-adjustments, that’s just for convenience. With the Redbook you should learn OpenGL pretty quickly.

I hope it will give you a jumpstart.

I think this is not recommended, since it is not guaranteed, that the gl-object stays the same after resizing, minimizing or hiding the frame that contains the canvas. Only use the gl object passed in to your GLEventListener implementation, never store it (not even temporarily) to play save with JOGL.

Valid point.

Easy to fix: assign the gl-object to the static reference at the beginning of every frame or init/resize.

By the way…when talking about starting to learn OpenGL; Are the jogl versions of the NeHe-tutorials up to date with the latest JOGL? Does anyone know?