view pytouhou/ui/opengl/framebuffer.pxd @ 617:a6af3ff86612

Change all “void except *” function into “bint except True”, to prevent PyErr_Occurred() from being called at each call.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 29 Mar 2015 00:08:20 +0100
parents 1b31169dc344
children
line wrap: on
line source

from pytouhou.lib.opengl cimport GLuint
from pytouhou.utils.matrix cimport Matrix
from .shader cimport Shader

cdef struct PassthroughVertex:
    short x, y
    float u, v


cdef class Framebuffer:
    cdef GLuint fbo, texture, rbo

    # Used by the use_framebuffer_blit path
    cdef int x, y, width, height

    # Used by the other one.
    cdef GLuint vbo, vao
    cdef Shader shader
    cdef Matrix *mvp
    cdef PassthroughVertex[4] buf

    cpdef bind(self)
    cdef void set_state(self) nogil
    cdef bint render(self, int x, int y, int width, int height) except True