Example #1
0
def thread_main(thread):
    thread.window.swap_interval(1)

    with thread.window:
        while running:
            v = math.fabs(math.sin(fw.get_time() * 2.0))
            glClearColor(thread.r * v, thread.g * v, thread.b * v, 0.0)
            glClear(GL_COLOR_BUFFER_BIT)
            thread.window.swap_buffers()
Example #2
0
def thread_main(thread):
    thread.window.swap_interval(1)

    with thread.window:
        while running:
            v = math.fabs(math.sin(fw.get_time() * 2.0))
            glClearColor(thread.r * v, thread.g * v, thread.b * v, 0.0)
            glClear(GL_COLOR_BUFFER_BIT)
            thread.window.swap_buffers()
Example #3
0
    def _on_draw(self):
        """setup graphics context for canvas and call on_draw
        """
        self._win.make_current()

        t = glfw.get_time()
        cel = Cel(self._nvg, self._width, self._height, t)

        self._clear_screen()
        self._nvg.beginFrame(self._width, self._height, self._px_ratio)

        # call draw handler
        self.on_draw(cel)

        self._nvg.endFrame()
        self._win.swap_buffers()
Example #4
0
    def _on_draw( self ):
        """setup graphics context for canvas and call on_draw
        """
        self._win.make_current()

        t = glfw.get_time()
        cel = Cel( self._nvg, self._width, self._height, t)

        self._clear_screen()
        self._nvg.beginFrame( self._width, self._height, self._px_ratio )

        # call draw handler
        self.on_draw( cel )

        self._nvg.endFrame()
        self._win.swap_buffers()