File: simple_vispy.py

package info (click to toggle)
python-vispy 0.16.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,112 kB
  • sloc: python: 61,648; javascript: 6,800; ansic: 2,104; makefile: 141; sh: 6
file content (27 lines) | stat: -rwxr-xr-x 834 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
import sys

from vispy import app
from vispy.gloo import clear

# app.use_app('pyqt5')  # or pyside, glut, pyglet, sdl2, etc.

canvas = app.Canvas(size=(512, 512), title="Do nothing benchmark (vispy)",
                    keys='interactive')


@canvas.connect
def on_draw(event):
    clear(color=True, depth=True)
    canvas.update()  # Draw frames as fast as possible

if __name__ == '__main__':
    canvas.show()
    canvas.measure_fps()
    if sys.flags.interactive == 0:
        app.run()