Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def alarm_handler(signal_number, stack_frame):
"""
Close the current GLFW window when called due to a SIGALRM.
"""
assert signal_number == signal.SIGALRM
window = glfw.get_current_context()
assert window is not None
glfw.set_window_should_close(window, True)
def processInput(window):
if glfw.get_key(window, glfw.KEY_ESCAPE) == glfw.PRESS:
glfw.set_window_should_close(window, GL_TRUE)
def key_callback(self, window, key, scancode, action, mods):
"press ESCAPE to quit the application"
if key == glfw.KEY_ESCAPE and action == glfw.PRESS:
glfw.set_window_should_close(self.window, True)
def close(self):
glfw.set_window_should_close(self.window, True)
def processInput(window):
if glfw.get_key(window, glfw.KEY_ESCAPE) == glfw.PRESS:
glfw.set_window_should_close(window, GL_TRUE)