| 89 | |
| 90 | |
| 91 | def __createPassQuad(self): |
| 92 | self.quad.vao = glGenVertexArrays(1) |
| 93 | glBindVertexArray(self.quad.vao) |
| 94 | |
| 95 | # Position(3), Texture(2) |
| 96 | vertices = np.array([-1.0, 1.0, 0.0, 1.0, |
| 97 | -1.0, -1.0, 0.0, 0.0, |
| 98 | 1.0, -1.0, 1.0, 0.0, |
| 99 | |
| 100 | -1.0, 1.0, 0.0, 1.0, |
| 101 | 1.0, -1.0, 1.0, 0.0, |
| 102 | 1.0, 1.0, 1.0, 1.0], dtype='float32') |
| 103 | |
| 104 | self.quad.vbo = glGenBuffers(1) |
| 105 | glBindBuffer(GL_ARRAY_BUFFER, self.quad.vbo) |
| 106 | glBufferData(GL_ARRAY_BUFFER, vertices, GL_STATIC_DRAW) |
| 107 | |
| 108 | stride = 4 |
| 109 | glEnableVertexAttribArray(0) |
| 110 | glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, self.d_fsize * stride, None) |
| 111 | |
| 112 | uv_offset = 2 |
| 113 | glEnableVertexAttribArray(1) |
| 114 | glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, self.d_fsize * stride, ctypes.cast(self.d_fsize * uv_offset, ctypes.c_void_p)) |
| 115 | |
| 116 | |
| 117 | def begin(self): |