Mercurial > touhou
annotate pytouhou/ui/opengl/framebuffer.pxd @ 753:a662dddd4a2b
examples: Use array textures for enemy PNGs
This requires luminance 0.39.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 25 Feb 2020 21:03:44 +0100 |
parents | a6af3ff86612 |
children |
rev | line source |
---|---|
586
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 from pytouhou.lib.opengl cimport GLuint |
610
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
2 from pytouhou.utils.matrix cimport Matrix |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
3 from .shader cimport Shader |
586
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 cdef struct PassthroughVertex: |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 short x, y |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 float u, v |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 cdef class Framebuffer: |
610
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
11 cdef GLuint fbo, texture, rbo |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
12 |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
13 # Used by the use_framebuffer_blit path |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
14 cdef int x, y, width, height |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
15 |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
16 # Used by the other one. |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
17 cdef GLuint vbo, vao |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
18 cdef Shader shader |
1b31169dc344
Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
19 cdef Matrix *mvp |
586
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 cdef PassthroughVertex[4] buf |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
21 |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
22 cpdef bind(self) |
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
23 cdef void set_state(self) nogil |
617
a6af3ff86612
Change all “void except *” function into “bint except True”, to prevent PyErr_Occurred() from being called at each call.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
610
diff
changeset
|
24 cdef bint render(self, int x, int y, int width, int height) except True |