summaryrefslogtreecommitdiff
path: root/src/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/platforms')
-rw-r--r--src/platforms/core_desktop.c26
-rw-r--r--src/platforms/core_desktop_sdl.c26
-rw-r--r--src/platforms/core_web.c20
3 files changed, 48 insertions, 24 deletions
diff --git a/src/platforms/core_desktop.c b/src/platforms/core_desktop.c
index 614062d..d2c595e 100644
--- a/src/platforms/core_desktop.c
+++ b/src/platforms/core_desktop.c
@@ -3,7 +3,7 @@
#include "core.h"
#include "platforms/core_desktop.h"
-static void platformDefineGlobals() {
+void platformDefineGlobals() {
lua_State *L = state->luaState;
lua_getglobal( L, "RL" );
@@ -87,17 +87,6 @@ int lcoreGetKeyScancode( lua_State *L ) {
return 1;
}
-static void luaPlatformRegister() {
- lua_State *L = state->luaState;
- lua_getglobal( L, "RL" );
-
- /* Input-related functions: keyboard. */
- assingGlobalFunction( "GetKeyName", lcoreGetKeyName );
- assingGlobalFunction( "GetKeyScancode", lcoreGetKeyScancode );
-
- lua_pop( L, -1 );
-}
-
/* Events. */
/*
@@ -649,3 +638,16 @@ static void platformRegisterEvents() {
// state->glfwtabletCursorCallback = glfwSetPenTabletCursorCallback( penTabletCursorEvent );
// state->glfwtabletProximityCallback = glfwSetPenTabletProximityCallback( penTabletProximityEvent );
}
+
+void luaPlatformRegister() {
+ lua_State *L = state->luaState;
+ lua_getglobal( L, "RL" );
+
+ /* Input-related functions: keyboard. */
+ assingGlobalFunction( "GetKeyName", lcoreGetKeyName );
+ assingGlobalFunction( "GetKeyScancode", lcoreGetKeyScancode );
+
+ lua_pop( L, -1 );
+
+ platformRegisterEvents();
+}
diff --git a/src/platforms/core_desktop_sdl.c b/src/platforms/core_desktop_sdl.c
index f1483e5..9ad1c58 100644
--- a/src/platforms/core_desktop_sdl.c
+++ b/src/platforms/core_desktop_sdl.c
@@ -3,7 +3,7 @@
#include "core.h"
#include "platforms/core_desktop_sdl.h"
-static void platformDefineGlobals() {
+void platformDefineGlobals() {
lua_State *L = state->luaState;
lua_getglobal( L, "RL" );
@@ -111,17 +111,6 @@ int lcoreGetScancodeFromKey( lua_State *L ) {
return 1;
}
-static void luaPlatformRegister() {
- lua_State *L = state->luaState;
- lua_getglobal( L, "RL" );
-
- /* Input-related functions: keyboard. */
- assingGlobalFunction( "GetKeyName", lcoreGetKeyName );
- assingGlobalFunction( "GetScancodeFromKey", lcoreGetScancodeFromKey );
-
- lua_pop( L, -1 );
-}
-
/* Events. */
/*
@@ -555,3 +544,16 @@ Event occurs an event of type SDL_DOLLARGESTURE or SDL_DOLLARRECORD is reported.
}
state->SDL_eventQueueLen = 0;
}
+
+void luaPlatformRegister() {
+ lua_State *L = state->luaState;
+ lua_getglobal( L, "RL" );
+
+ /* Input-related functions: keyboard. */
+ assingGlobalFunction( "GetKeyName", lcoreGetKeyName );
+ assingGlobalFunction( "GetScancodeFromKey", lcoreGetScancodeFromKey );
+
+ lua_pop( L, -1 );
+
+ platformRegisterEvents()
+}
diff --git a/src/platforms/core_web.c b/src/platforms/core_web.c
new file mode 100644
index 0000000..24d3bf2
--- /dev/null
+++ b/src/platforms/core_web.c
@@ -0,0 +1,20 @@
+#include "main.h"
+#include "lua_core.h"
+#include "core.h"
+
+void platformDefineGlobals() {
+ lua_State *L = state->luaState;
+
+ lua_getglobal( L, "RL" );
+/*DOC_DEFINES_START*/
+/*DOC_DEFINES_END*/
+ lua_pop( L, -1 );
+}
+
+/* Functions. */
+
+/* Events. */
+
+void luaPlatformRegister() {
+ return;
+}