Custom context manager for the GLFW based GUI.
| 38 | |
| 39 | |
| 40 | class DoubleBufferedGlfwContext(glfw_renderer.GLFWContext): |
| 41 | """Custom context manager for the GLFW based GUI.""" |
| 42 | |
| 43 | def __init__(self, width, height, title): |
| 44 | self._title = title |
| 45 | super().__init__(max_width=width, max_height=height) |
| 46 | |
| 47 | @_check_valid_backend |
| 48 | def _platform_init(self, width, height): |
| 49 | glfw.window_hint(glfw.SAMPLES, 4) |
| 50 | glfw.window_hint(glfw.VISIBLE, 1) |
| 51 | glfw.window_hint(glfw.DOUBLEBUFFER, 1) |
| 52 | self._context = glfw.create_window(width, height, self._title, None, None) |
| 53 | self._destroy_window = glfw.destroy_window |
| 54 | |
| 55 | @property |
| 56 | def window(self): |
| 57 | return self._context |
| 58 | |
| 59 | |
| 60 | class GlfwKeyboard(base.InputEventsProcessor): |
no outgoing calls
no test coverage detected
searching dependent graphs…