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
pygame.examples.glcube updated to use 'modern' API. #1730
Conversation
This pull request introduces 2 alerts when merging aa98938 into ea4a028 - view on LGTM.com new alerts:
|
Looks good. I ported glcube to modernGL, but your example seems to be the better way to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one.
I wonder if we should just remove the old OpenGL style code in here so it's easier to read? Then the _modern
parts could be removed.
I guess OpenGL.arrays.vbo could be used for the vertex buffers instead to avoid the ctypes import. Probably could use a few doc strings/comments in those transform functions.
I looked at the source code for this and it imports ctypes: So I'm not sure we'd be gaining anything by switching - it seems to be pretty much the same code in a wrapper. Not an openGL expert though.
The reason I kept the old parts is because the original point of updating the gl cube example was to show that you could switch the core context profile - in these lines:
..and I noticed that switching it higher than 3.1 didn't work because of the change between old gl and modern gl. If we remove the old style code, won't we just have the same problem in the other direction, where if you set the profile below 3 it won't work?
Yes, I will add some. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome :)
My attempt to update the gl cube example to show how you can switch the context profile.
So it actually works I also included a modern gl version of the gl cube as close as I could make it to the original.
This finishes fixing issue #85