Help with dated OpenGl code

Hello. I've been having issues with running a sketch I have found that was made back in 2012. I've updated a lot of the code but there are some functions and ways of calling with OpenGl that give me errors. I would appreciate if anyone could help me to update the following:

PGraphicsOpenGL pg = (PGraphicsOpenGL) g; // processings opengl graphics object PGL pgl = beginPGL(); gl2 = ((PJOGL)pgl).gl.getGL2(); pgl.enable(GL2.GL_LINE_SMOOTH); // make points round pgl.LineWidth(lineWeight); gl.glBegin(GL.GL_LINES);

Currently I'm getting "the function LineWidth(int) does not exist." What do I need to change? I'm using Processing 2.2.1

Dated sketch can be found here: https://github.com/trentbrooks/Noise-Ink/tree/master/NoiseInk

Tagged:

Answers

  • I'm not into openGL, but if you want to make old code working again I guess it would be better to make it working for Processing 3 else your still a step behind.

  • Hiya. Yes, that's likely to be true. But that would also mean running into a lot more issues with the kinect related libraries I'm using too. For the time being (at least for this sketch) I will be using this version of processing.

  • I've changed the above code that I posted to this:

    PGraphicsOpenGL pg = (PGraphicsOpenGL) g; // processings opengl graphics object PGL pgl = beginPGL(); gl2 = ((PJOGL)pgl).gl.getGL2(); pgl.enable(GL2.GL_LINE_SMOOTH); // make points round gl2.glLineWidth(lineWeight); gl2.glBegin(GL2.GL_LINES);

    No errors anymore, at least for now!

Sign In or Register to comment.