Converting from OpenGL version 2.1 to version 3.0 and above

I have a simple Go program, my first program in OpenGL. It uses OpenGL version 2.1:

https://github.com/pebbe/gl/blob/master/gl2.1/demo.go

I rewrote it for OpenGL version 3.0 and above. It’s much less simple now:

https://github.com/pebbe/gl/blob/master/gl3/demo.go

Would someone please take a look if there are still things in there that are not allowed in new versions of OpenGL?

Is glLineWidth() still allowed?

By the way, how do you exactly set the line width? glLineWidth(5) seems to have the same effect as glLineWidth(50).

The easiest way to check what’s allowed is to check the reference pages for OpenGL 3 or OpenGL 4. They only list the functions which are available in the core profile. The OpenGL 2 reference pages document legacy functions.

It is.

There are implementation-defined limits to the maximum line width. Use glGet(GL_ALIASED_LINE_WIDTH_RANGE) to determine the minimum and maximum widths for non-antialiased lines and glGet(GL_SMOOTH_LINE_WIDTH_RANGE) for anti-aliased lines.