(cls, camera)
| 58 | |
| 59 | @classmethod |
| 60 | def drawDebug(cls, camera): |
| 61 | if not cls.__vao.count: |
| 62 | return |
| 63 | |
| 64 | #glDisable(GL_DEPTH_TEST) |
| 65 | #glDisable(GL_MULTISAMPLE) |
| 66 | glLineWidth(2.0) |
| 67 | |
| 68 | shader = PWShaders.getShader(ShaderTypes.DEBUG_SHADER) |
| 69 | glUseProgram(shader.shader) |
| 70 | glUniformMatrix4fv(shader.proj_view, 1, GL_FALSE, camera.getProjectionView()) |
| 71 | |
| 72 | # -------- |
| 73 | |
| 74 | glBindBuffer(GL_ARRAY_BUFFER, cls.__vao.data) |
| 75 | glBufferData(GL_ARRAY_BUFFER, cls.__data, GL_STREAM_DRAW) |
| 76 | #glBufferSubData could work here better if more lines are needed |
| 77 | |
| 78 | glBindVertexArray(cls.__vao.vao) |
| 79 | glDrawArrays(GL_LINES, 0, 2 * cls.__vao.count) |
| 80 | |
| 81 | # Reset line count |
| 82 | cls.__vao.count = 0 |
| 83 | |
| 84 | #glEnable(GL_DEPTH_TEST) |
| 85 | #glEnable(GL_MULTISAMPLE) |
| 86 | glLineWidth(1.0) |
| 87 | |
| 88 | |
| 89 | if __name__ == "__main__": |
no test coverage detected