diff options
author | Jonas Bernard <public.jbernard@web.de> | 2021-04-24 04:19:39 +0200 |
---|---|---|
committer | Jonas Bernard <public.jbernard@web.de> | 2021-04-24 04:19:39 +0200 |
commit | a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8 (patch) | |
tree | 47768e46da3e6682acf6b72dddabaef78d0bfeb8 /txtgameengine/platform.py | |
parent | 635185baac3a2a9c5e50971d994ca7bcdec1d495 (diff) | |
download | txtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.tar.gz txtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.tar.bz2 txtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.zip |
Progress at night
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() |