We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to upgrade from Processing 2 to Processing 3. I am getting an error that the class GL2 does not exist. Do I need to install JOGL. If so, then how to install it for mac OS Sierra?
Answers
processing 3 uses, iirc, jogamp libraries, not jogl (i think they are the roughly the same thing, just renamed, updated). but you don't usually need to specify imports for that stuff, it's automatic.
post a runnable code sample that shows the problem.
What do you then do with gl2?
if i need raw opengl in v3 for, say, additive blending, i use the following
(ah, ok, that's GL and not GL2. and is very similar to yours)
which calls this
https://github.com/processing/processing/blob/83739c692754ec9d65d3730b4574a66619892575/core/src/processing/opengl/PJOGL.java#L238
or this
https://github.com/processing/processing/blob/83739c692754ec9d65d3730b4574a66619892575/core/src/processing/opengl/PJOGL.java#L254
this sets the protected GL2 variable called gl2x (and a bunch of others), if applicable. but both of those take an argument...
this should be fine
mine compiles and runs but tells me it's not a GL2 implementation.
This solved the issue. But now I am getting a new error.
The static field GL_LINE should be used in a static way. This is the code snippet for its use.
gl.glBegin(gl.GL_LINES); // start drawing points
Please guide me as to how to resolve this.
gl.GL_LINES should be GL.GL_LINES.
It's static so you need to use the class and bit the variable.