view pytouhou/ui/opengl/background.pxd @ 553:8f51e34d911c

Refactor graphics backend selection, to make them fallbackable and optional.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 29 May 2014 12:31:55 +0200
parents b18f0bd30ad0
children 94725968dabb
line wrap: on
line source

from pytouhou.lib.opengl cimport GLuint, GLushort, GLsizei
from .renderer cimport Renderer

cdef struct Vertex:
    float x, y, z
    float u, v
    unsigned char r, g, b, a


cdef class BackgroundRenderer:
    cdef GLuint texture
    cdef GLsizei nb_indices
    cdef unsigned int use_fixed_pipeline

    # For modern GL.
    cdef GLuint vbo, ibo

    # For fixed pipeline.
    cdef Vertex *vertex_buffer
    cdef GLushort *indices

    cdef void render_background(self) except *
    cdef void load(self, background, Renderer renderer) except *