view pytouhou/utils/matrix.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 e5361b74b9ad
children
line wrap: on
line source

ctypedef struct Matrix:
    float a, b, c, d
    float e, f, g, h
    float i, j, k, l
    float m, n, o, p

cdef Matrix *new_matrix(Matrix *data) nogil
cdef Matrix *new_identity() nogil

cdef void mul(Matrix *mat1, Matrix *mat2) nogil
cdef void flip(Matrix *mat) nogil
cdef void scale2d(Matrix *mat, float x, float y) nogil
cdef void translate(Matrix *mat, float[3] offset) nogil
cdef void translate2d(Matrix *mat, float x, float y) nogil
cdef void rotate_x(Matrix *mat, float angle) nogil
cdef void rotate_y(Matrix *mat, float angle) nogil
cdef void rotate_z(Matrix *mat, float angle) nogil