view pytouhou/ui/window.pxd @ 772:7492d384d122 default tip

Rust: Add a Glide renderer (2D only for now) This is an experiment for a Rust renderer, iterating over the Python data using pyo3. It requires --feature=glide to be passed to cargo build, doesn’t support NPOT textures, text rendering, the background, or even msg faces, some of that may come in a future changeset.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 05 Sep 2022 17:53:36 +0200
parents 80687f258001
children
line wrap: on
line source

cimport pytouhou.lib.gui as gui


cdef class Clock:
    cdef unsigned long _ref_tick
    cdef long _target_fps, _ref_frame, _fps_tick, _fps_frame
    cdef double fps

    cdef void set_target_fps(self, long fps) nogil
    cdef bint tick(self) nogil except True


cdef class Runner:
    cdef long width, height

    cdef bint start(self) except True
    cdef bint finish(self) except True
    cpdef bint update(self, bint render) except -1


cdef class Window:
    cdef gui.Window win
    cdef Runner runner
    cdef Clock clock
    cdef int frame, frameskip
    cdef int width, height

    cdef void set_size(self, int width, int height) nogil
    cpdef set_runner(self, Runner runner=*)
    cpdef run(self)
    cdef bint run_frame(self) except -1
    cdef double get_fps(self) nogil
    cdef list get_events(self)
    cdef int get_keystate(self) nogil
    cdef void toggle_fullscreen(self) nogil