Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to use OpenGL compatibility profile by default. #140

Merged
merged 1 commit into from
Mar 31, 2019

Conversation

lava
Copy link
Contributor

@lava lava commented Mar 31, 2019

PyCAM's rendering code relies on the OpenGL fixed function
pipeline, which was removed from the OpenGL 3.2 Core profile.

Sadly, that is the default version used by Gdk, and the public
API of GLArea and GLContext does not allow switching the profile
or using a version < 3.2, therefore we have to attempt to change
Gdk behaviour through environment variables.

Ironically, setting `GDK_GL=legacy' will usually result in
a more modern OpenGL version being used, e.g. switching from
3.2 Core to 4.6 Compatibility on my machine.

PyCAM's rendering code relies on the OpenGL fixed function
pipeline, which was removed from the OpenGL 3.2 Core profile.

Sadly, that is the default version used by Gdk, and the public
API of GLArea and GLContext does not allow switching the profile
or using a version < 3.2, therefore we have to attempt to change
Gdk behaviour through environment variables.

Ironically, setting `GDK_GL=legacy' will usually result in
a more modern OpenGL version being used, e.g. switching from
3.2 Core to 4.6 Compatibility on my machine.
@ebo
Copy link
Collaborator

ebo commented Mar 31, 2019 via email

@lava
Copy link
Contributor Author

lava commented Mar 31, 2019

Well, for the amount of OpenGL code being used, judge for yourself:

~/src/pycam/pycam$ find . -name '*OpenGL*' | xargs wc -l
  113 ./Plugins/OpenGLViewGrid.py
   76 ./Plugins/OpenGLViewDimension.py
   73 ./Plugins/OpenGLViewSupportModelPreview.py
  192 ./Plugins/OpenGLViewModel.py
   94 ./Plugins/OpenGLViewBounds.py
   77 ./Plugins/OpenGLViewAxes.py
  948 ./Plugins/OpenGLWindow.py
   49 ./Plugins/OpenGLViewTool.py
  158 ./Plugins/OpenGLViewToolpath.py
   84 ./Gui/OpenGLTools.py
 1864 total
~/src/pycam/pycam$ grep gl[A-Z] . -r | wc -l
242

So I'd personally recommend against re-implementing that, since it's probably going to take 100+ hours just to get back to the state that's currently working, but of course you're free to spend your time as you see fit.

Until that replacement is finished, though, I think it would be better to have the OpenGL version not be broken by default on most modern systems.

@ebo
Copy link
Collaborator

ebo commented Mar 31, 2019 via email

@sumpfralle
Copy link
Collaborator

Indeed the above is surely an improvement of the current state - so I will just merge it. Thank you!

Regarding the replacement: it is almost there (as usual): #135 (comment) (see branch replace-opengl-with-x3d)

The usability of the new 3D visualization is still a bit painful. I will use my next chunk of pycam-dedicated time for fixing and releasing it.

@sumpfralle sumpfralle merged commit 10f9150 into SebKuzminsky:master Mar 31, 2019
@valeriob01
Copy link
Contributor

Indeed the above is surely an improvement of the current state - so I will just merge it. Thank you!

Regarding the replacement: it is almost there (as usual): #135 (comment) (see branch replace-opengl-with-x3d)

The usability of the new 3D visualization is still a bit painful. I will use my next chunk of pycam-dedicated time for fixing and releasing it.

Incredibly the last update is working better. The buttons on the visualization canvas now work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants