In JOGL (any version), display() gets called in three ways:1. In response to repaint() requests from AWT, so you get one display() when the frame is made visible2. If you use an Animator or FPSAnimotor to repeatedly call display()3. If you call it yourself (not recommended unless you know what you're doing).

Are people not supposed to be using the GL object nowadays? Are my friend and I reading some old outdated tutorials? Is it a complete waste to not use a GL4?

JOGL has a very thin abstraction layer above OpenGL. In C/C++, this layer is replaced by GLUT for example. Both in Java and in C you have to use something to update your display frequently. In C, when using GLUT, you call glutPostRedisplay() as far as I know. In Java, when using JOGL, you use lhkbob's suggestions, especially the 2 first ones.

You have to use GL objects to perform the actual GL operations. As you've been doing, you get the GL objects from the GLAutoDrawables passed into the methods from the GLEventListener. This is still the way to do things.

Simple answer is that you need to use the FPSAnimator to make it constantly redraw like it does in C based OpenGL.

Option 3 that lhkbob suggested is what I use and I don't think it is a big deal - I just don't want to have my display constantly repainting the same scene that doesn't change. So I force a display update only on keyboard/mouse inputs or various event updates

Are people not supposed to be using the GL object nowadays? Are my friend and I reading some old outdated tutorials? Is it a complete waste to not use a GL4?

JOGL has a very thin abstraction layer above OpenGL. In C/C++, this layer is replaced by GLUT for example. Both in Java and in C you have to use something to update your display frequently. In C, when using GLUT, you call glutPostRedisplay() as far as I know. In Java, when using JOGL, you use lhkbob's suggestions, especially the 2 first ones.

When I said "not supposed to use a GL object" i meant a GL object as opposed to a GL2, 3, or 4. All of the later ones have the exact same fields as the original GL, so is there any reason to not use a GL4?

The numbers after them correspond to the OpenGL version profile that is used. Since OpenGL 3, OpenGL is no longer backwards compatible. Additionally, there are different profiles for desktop devices and mobile devices. The GL object represents the operations defined in OpenGL that are shared by every profile.

Another example is the GL2GL3 object, this is the extension of GL that defines the OpenGL operations shared between version 2.0 and 3.0. Depending on what you want to do, you must choose a different version to work with. I generally use GL2GL3 for a lot of my engine code that can be shared between versions (such as textures and VBOs) so I won't have to rewrite it.

If you want to use the fixed functionality of OpenGL or run on older graphics cards, you'll need to use GL2. If you want to use GL4, you'll have to have OpenGL version 4.0 installed and supported on your graphics card.

If you can get away with programming to the GL interface without picking a specific version, I would try that because it will allow you to run your code across more computers more easily. If you're the only one using your program and you want to program to 4.0 and you have OpenGL 4 (or are fine with only having it run on newer computers), then you can do that too.

Gotcha. So if we're intending to make our game compatible with as many computers and GPU's as we can, we should try to stick to GL or GL2. Currently we are using GL, but from what you're saying it sounds like there's really no reason we wouldn't want to use GL2 instead.

java-gaming.org 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‑gaming.org