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

Use with other PySide modules #4

Open
jmatthess opened this issue Nov 2, 2023 · 0 comments
Open

Use with other PySide modules #4

jmatthess opened this issue Nov 2, 2023 · 0 comments

Comments

@jmatthess
Copy link

Hey

I took a stab at trying to integrate your 3d viewer into a pyside6 project. I see that QGLWidget was deprecated in place of QtOpenGLWidgets, when loading a obj file into the scene it seems to hard crash with no error prints. I've narrowed it down to the moderngl vertex_array.py render() function. Although i've switched my code to use pyqt5 instead of pyside6, i'm curious if you'd know why it would crash.
Reading the documentation it notes that QOpenGLWidget turns on OpenGL-based compositing for the entire window, where as QGLWidget has a seperate native child window. But can't be sure if that's the reason why and curious if you'd know the differences.

    def render(
        self,
        mode: Optional[int] = None,
        vertices: int = -1,
        *,
        first: int = 0,
        instances: int = -1,
    ) -> None:
        """
        The render primitive (mode) must be the same as the input primitive of the GeometryShader.

        Args:
            mode (int): By default :py:data:`TRIANGLES` will be used.
            vertices (int): The number of vertices to transform.

        Keyword Args:
            first (int): The index of the first vertex to start with.
            instances (int): The number of instances.
        """
        if mode is None:
            mode = self._mode

        if self.scope:
            with self.scope:
                self.mglo.render(mode, vertices, first, instances)
        else:
            self.mglo.render(mode, vertices, first, instances) # <------------------ crashes here

Thanks

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

No branches or pull requests

1 participant