summaryrefslogtreecommitdiff
path: root/txtgameengine/platform.py
diff options
context:
space:
mode:
authorJonas Bernard <public.jbernard@web.de>2021-04-24 04:19:39 +0200
committerJonas Bernard <public.jbernard@web.de>2021-04-24 04:19:39 +0200
commita0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8 (patch)
tree47768e46da3e6682acf6b72dddabaef78d0bfeb8 /txtgameengine/platform.py
parent635185baac3a2a9c5e50971d994ca7bcdec1d495 (diff)
downloadtxtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.tar.gz
txtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.tar.bz2
txtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.zip
Progress at night
Diffstat (limited to 'txtgameengine/platform.py')
-rw-r--r--txtgameengine/platform.py7
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()