How to use the vispy.gloo.clear function in vispy

To help you get started, we’ve selected a few vispy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vispy / vispy / examples / basics / visuals / reactive_regular_polygon.py View on Github external
def on_draw(self, ev):
        gloo.clear(color='black')
        gloo.set_viewport(0, 0, *self.size)
        self.draw_visual(self.rpolygon)
github vispy / vispy / examples / demo / gloo / rain.py View on Github external
def on_draw(self, event):
        gloo.clear()
        self.program.draw('points')
github cortex-lab / phy / phy / plot / waveforms.py View on Github external
def on_draw(self, event):
        """Draw the visual."""
        gloo.clear(color=True, depth=True)
        if self._show_mean:
            self.mean.draw()
        else:
            self.visual.draw()
github genicam / harvesters_gui / src / harvesters_gui / _private / frontend / canvas.py View on Github external
def on_draw(self, event):
        # Update on June 15th, 2018:
        # According to a VisPy developer, they have not finished
        # porting VisPy to PyQt5. Once they finished the development
        # we should try it out if it gives us the maximum refresh rate.
        # See the following URL to check the latest information:
        #
        #     https://github.com/vispy/vispy/issues/1394

        # Clear the canvas in gray.
        gloo.clear(color=self._background_color)

        drew = False
        try:
            if not self._pause_drawing:
                # Fetch a buffer.
                buffer = self.ia.fetch_buffer(timeout=0.0001)

                # Prepare a texture to draw:
                self._prepare_texture(buffer)

                # Draw the texture until the buffer object exists
                # within this scope:
                # (We keep the buffer until the next one is delivered to
                # keep the current chunk data alive but it depends on the
                # application; we just want to tell you that the texture
                # must be overdrawn until the content is alive:)
github genicam / harvesters / harvesters / _private / frontend / canvas.py View on Github external
def on_draw(self, event):
        # Clear the canvas in gray.
        gloo.clear(color=self._background_color)
        self._update_texture()
github vispy / vispy / examples / demo / gloo / terrain.py View on Github external
def on_draw(self, event):
        # Clear
        gloo.clear(color=True, depth=True)
        # Draw
        self.program.draw('triangles')
github vispy / vispy / examples / tutorial / gloo / rotating_quad.py View on Github external
def on_draw(self, event):
        gloo.set_clear_color('white')
        gloo.clear(color=True)
        self.program.draw('triangle_strip')