summaryrefslogtreecommitdiff
path: root/libs/raylib/src/uwp_events.h
diff options
context:
space:
mode:
authorLucaSas <sas.luca.alex@gmail.com>2021-11-04 16:15:47 +0200
committerLucaSas <sas.luca.alex@gmail.com>2021-11-04 16:15:47 +0200
commit4e34ae85948438f726a911c9dbb8616968a378a5 (patch)
tree07b470559a9f973bcf695938606c7c28cd5e161a /libs/raylib/src/uwp_events.h
parentd96b4ebce5ee6245fa80d27d41b67aa56555c912 (diff)
parentd227d3c609c4b95fa9c8a0ba5a10e7c47bcb984c (diff)
downloadgamejam-slgj-2024-4e34ae85948438f726a911c9dbb8616968a378a5.tar.gz
gamejam-slgj-2024-4e34ae85948438f726a911c9dbb8616968a378a5.tar.bz2
gamejam-slgj-2024-4e34ae85948438f726a911c9dbb8616968a378a5.zip
Merge remote-tracking branch 'origin/master'
# Conflicts: # README.md # libs/raylib/.gitignore # libs/raylib/BINDINGS.md # libs/raylib/CHANGELOG # libs/raylib/CMakeLists.txt # libs/raylib/CONTRIBUTING.md # libs/raylib/HISTORY.md # libs/raylib/LICENSE # libs/raylib/README.md # libs/raylib/ROADMAP.md # libs/raylib/SPONSORS.md # libs/raylib/raylib.pc.in # libs/raylib/src/CMakeLists.txt # libs/raylib/src/Makefile # libs/raylib/src/camera.h # libs/raylib/src/config.h # libs/raylib/src/core.c # libs/raylib/src/easings.h # libs/raylib/src/external/cgltf.h # libs/raylib/src/external/dr_flac.h # libs/raylib/src/external/dr_mp3.h # libs/raylib/src/external/dr_wav.h # libs/raylib/src/external/glfw/CMake/glfw3.pc.in # libs/raylib/src/external/glfw/CMake/glfw3Config.cmake.in # libs/raylib/src/external/glfw/CMakeLists.txt # libs/raylib/src/external/glfw/README.md # libs/raylib/src/external/glfw/include/GLFW/glfw3.h # libs/raylib/src/external/glfw/src/cocoa_init.m # libs/raylib/src/external/glfw/src/cocoa_joystick.h # libs/raylib/src/external/glfw/src/cocoa_joystick.m # libs/raylib/src/external/glfw/src/cocoa_monitor.m # libs/raylib/src/external/glfw/src/cocoa_platform.h # libs/raylib/src/external/glfw/src/cocoa_window.m # libs/raylib/src/external/glfw/src/egl_context.c # libs/raylib/src/external/glfw/src/egl_context.h # libs/raylib/src/external/glfw/src/glfw_config.h.in # libs/raylib/src/external/glfw/src/init.c # libs/raylib/src/external/glfw/src/input.c # libs/raylib/src/external/glfw/src/internal.h # libs/raylib/src/external/glfw/src/linux_joystick.c # libs/raylib/src/external/glfw/src/linux_joystick.h # libs/raylib/src/external/glfw/src/mappings.h # libs/raylib/src/external/glfw/src/nsgl_context.m # libs/raylib/src/external/glfw/src/null_init.c # libs/raylib/src/external/glfw/src/null_joystick.c # libs/raylib/src/external/glfw/src/null_monitor.c # libs/raylib/src/external/glfw/src/null_platform.h # libs/raylib/src/external/glfw/src/null_window.c # libs/raylib/src/external/glfw/src/osmesa_context.h # libs/raylib/src/external/glfw/src/wgl_context.h # libs/raylib/src/external/glfw/src/win32_init.c # libs/raylib/src/external/glfw/src/win32_joystick.c # libs/raylib/src/external/glfw/src/win32_joystick.h # libs/raylib/src/external/glfw/src/win32_monitor.c # libs/raylib/src/external/glfw/src/win32_platform.h # libs/raylib/src/external/glfw/src/win32_window.c # libs/raylib/src/external/glfw/src/window.c # libs/raylib/src/external/glfw/src/wl_init.c # libs/raylib/src/external/glfw/src/wl_monitor.c # libs/raylib/src/external/glfw/src/wl_platform.h # libs/raylib/src/external/glfw/src/wl_window.c # libs/raylib/src/external/glfw/src/x11_init.c # libs/raylib/src/external/glfw/src/x11_monitor.c # libs/raylib/src/external/glfw/src/x11_platform.h # libs/raylib/src/external/glfw/src/x11_window.c # libs/raylib/src/external/jar_xm.h # libs/raylib/src/external/miniaudio.h # libs/raylib/src/external/stb_image.h # libs/raylib/src/external/stb_image_write.h # libs/raylib/src/external/stb_vorbis.h # libs/raylib/src/external/tinyobj_loader_c.h # libs/raylib/src/gestures.h # libs/raylib/src/models.c # libs/raylib/src/physac.h # libs/raylib/src/raudio.c # libs/raylib/src/raudio.h # libs/raylib/src/raylib.dll.rc # libs/raylib/src/raylib.dll.rc.data # libs/raylib/src/raylib.h # libs/raylib/src/raylib.rc # libs/raylib/src/raylib.rc.data # libs/raylib/src/raymath.h # libs/raylib/src/rglfw.c # libs/raylib/src/rlgl.h # libs/raylib/src/rmem.h # libs/raylib/src/rnet.h # libs/raylib/src/shapes.c # libs/raylib/src/text.c # libs/raylib/src/textures.c # libs/raylib/src/utils.c # libs/raylib/src/utils.h
Diffstat (limited to 'libs/raylib/src/uwp_events.h')
-rw-r--r--libs/raylib/src/uwp_events.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/libs/raylib/src/uwp_events.h b/libs/raylib/src/uwp_events.h
new file mode 100644
index 0000000..2c403fd
--- /dev/null
+++ b/libs/raylib/src/uwp_events.h
@@ -0,0 +1,119 @@
+/**********************************************************************************************
+*
+* raylib.uwp_events - Functions for bootstrapping UWP functionality within raylib's core.
+*
+*
+* LICENSE: zlib/libpng
+*
+* Copyright (c) 2020-2020 Reece Mackie (@Rover656)
+*
+* This software is provided "as-is", without any express or implied warranty. In no event
+* will the authors be held liable for any damages arising from the use of this software.
+*
+* Permission is granted to anyone to use this software for any purpose, including commercial
+* applications, and to alter it and redistribute it freely, subject to the following restrictions:
+*
+* 1. The origin of this software must not be misrepresented; you must not claim that you
+* wrote the original software. If you use this software in a product, an acknowledgment
+* in the product documentation would be appreciated but is not required.
+*
+* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
+* as being the original software.
+*
+* 3. This notice may not be removed or altered from any source distribution.
+*
+**********************************************************************************************/
+
+#ifndef UWP_EVENTS_H
+#define UWP_EVENTS_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(PLATFORM_UWP)
+
+// Determine if UWP functions are set and ready for raylib's use.
+bool UWPIsConfigured();
+
+// Call this to set the UWP data path you wish for saving and loading.
+void UWPSetDataPath(const char* path);
+
+// Function for getting program time.
+typedef double(*UWPQueryTimeFunc)();
+UWPQueryTimeFunc UWPGetQueryTimeFunc(void);
+void UWPSetQueryTimeFunc(UWPQueryTimeFunc func);
+
+// Function for sleeping the current thread
+typedef void (*UWPSleepFunc)(double sleepUntil);
+UWPSleepFunc UWPGetSleepFunc(void);
+void UWPSetSleepFunc(UWPSleepFunc func);
+
+// Function for querying the display size
+typedef void(*UWPDisplaySizeFunc)(int* width, int* height);
+UWPDisplaySizeFunc UWPGetDisplaySizeFunc(void);
+void UWPSetDisplaySizeFunc(UWPDisplaySizeFunc func);
+
+// Functions for mouse cursor control
+typedef void(*UWPMouseFunc)(void);
+UWPMouseFunc UWPGetMouseLockFunc();
+void UWPSetMouseLockFunc(UWPMouseFunc func);
+UWPMouseFunc UWPGetMouseUnlockFunc();
+void UWPSetMouseUnlockFunc(UWPMouseFunc func);
+UWPMouseFunc UWPGetMouseShowFunc();
+void UWPSetMouseShowFunc(UWPMouseFunc func);
+UWPMouseFunc UWPGetMouseHideFunc();
+void UWPSetMouseHideFunc(UWPMouseFunc func);
+
+// Function for setting mouse cursor position.
+typedef void (*UWPMouseSetPosFunc)(int x, int y);
+UWPMouseSetPosFunc UWPGetMouseSetPosFunc();
+void UWPSetMouseSetPosFunc(UWPMouseSetPosFunc func);
+
+// The below functions are implemented in core.c but are placed here so they can be called by user code.
+// This choice is made as platform-specific code is preferred to be kept away from raylib.h
+
+// Call this when a Key is pressed or released.
+void UWPKeyDownEvent(int key, bool down, bool controlKey);
+
+// Call this on the CoreWindow::CharacterRecieved event
+void UWPKeyCharEvent(int key);
+
+// Call when a mouse button state changes
+void UWPMouseButtonEvent(int button, bool down);
+
+// Call when the mouse cursor moves
+void UWPMousePosEvent(double x, double y);
+
+// Call when the mouse wheel moves
+void UWPMouseWheelEvent(int deltaY);
+
+// Call when the window resizes
+void UWPResizeEvent(int width, int height);
+
+// Call when a gamepad is made active
+void UWPActivateGamepadEvent(int gamepad, bool active);
+
+// Call when a gamepad button state changes
+void UWPRegisterGamepadButton(int gamepad, int button, bool down);
+
+// Call when a gamepad axis state changes
+void UWPRegisterGamepadAxis(int gamepad, int axis, float value);
+
+// Call when the touch point moves
+void UWPGestureMove(int pointer, float x, float y);
+
+// Call when there is a touch down or up
+void UWPGestureTouch(int pointer, float x, float y, bool touch);
+
+// Set the core window pointer so that we can pass it to EGL.
+void* UWPGetCoreWindowPtr();
+void UWPSetCoreWindowPtr(void* ptr);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // PLATFORM_UWP
+
+#endif // UWP_EVENTS_H