diff options
Diffstat (limited to 'txtgameengine/platform.py')
-rw-r--r-- | txtgameengine/platform.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/txtgameengine/platform.py b/txtgameengine/platform.py index cd3a17d..8258d33 100644 --- a/txtgameengine/platform.py +++ b/txtgameengine/platform.py @@ -5,6 +5,7 @@ import numpy as np from OpenGL.GL import * import OpenGL.GL.shaders as shaders from .twod import Texture +from .input.callbacks import CallbackHandler if typing.TYPE_CHECKING: from .app import TxtGameApp @@ -57,6 +58,12 @@ class PlatformComponent: def poll_events(): glfw.poll_events() + @staticmethod + def init_callbacks(window, handler: CallbackHandler): + glfw.set_key_callback(window, handler.get_keyboard_input_callback) + #glfw.set_mouse_button_callback(window, handler.get_mouse_click_callback()) + #glfw.set_cursor_pos_callback(window, handler.get_mouse_move_callback()) + def cleanup(self): glfw.destroy_window(self.app.window) glfw.terminate() |