fix: enforce OpenGL 3.3 Core profile, initialize global VAO, and corr…#14
Open
kasinadhsarma1 wants to merge 1 commit intomakehumancommunity:mainfrom
Open
fix: enforce OpenGL 3.3 Core profile, initialize global VAO, and corr…#14kasinadhsarma1 wants to merge 1 commit intomakehumancommunity:mainfrom
kasinadhsarma1 wants to merge 1 commit intomakehumancommunity:mainfrom
Conversation
…ect camera mouse tracking
31e03ee to
a1751d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request focuses on improving OpenGL initialization and compatibility across platforms, particularly for Linux/Mesa systems. The main changes ensure that the application consistently requests an OpenGL 3.3 Core Profile context with appropriate depth and stencil buffers, and also address requirements for VAO (Vertex Array Object) usage in Core Profile. There is also a minor bug fix in camera rotation handling.
OpenGL context and format initialization:
gui/application.py, theQSurfaceFormatis now explicitly configured for OpenGL 3.3 Core Profile with a depth buffer, stencil buffer, double buffering, and multisampling if available. The format is set before theQApplicationis created to ensure all widgets use the correct context.opengl/main.py, the OpenGL widget (QOpenGLWidget) explicitly applies the default surface format on initialization, ensuring the correct context is used regardless of Qt’s internal handling order.QSurfaceFormatandQOpenGLVertexArrayObjectare added toopengl/main.py.OpenGL Core Profile VAO requirement:
opengl/main.py, a singleQOpenGLVertexArrayObject(VAO) is created, bound during initialization, and destroyed during cleanup. This ensures compliance with OpenGL 3.3 Core Profile, which requires a VAO to be bound before making vertex attribute calls. [1] [2] [3]Bug fix:
opengl/camera.py, the last mouse position is updated inarcBallRotation, fixing potential issues with rotation state.