annotate pytouhou/ui/opengl/framebuffer.pxd @ 610:1b31169dc344

Move the passthrough shader to the Framebuffer class, since it isn’t used in the use_framebuffer_blit path.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 21 Dec 2014 18:52:18 +0100
parents 6c9d8a3d853f
children a6af3ff86612
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
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
24 cdef void render(self, int x, int y, int width, int height) except *