diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-22 16:23:22 +0900 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-22 16:23:22 +0900 |
commit | d82f0d5a7ea3b964118a0923e14b28128b081ecf (patch) | |
tree | 1215b872f66c74772de2deda7c3233fd09e6116a | |
parent | 7119092665e1b771b04b305813be81e9892dfc1b (diff) |
Implement dynamic reload in shared library
-rw-r--r-- | src/ray.c | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -16,7 +16,6 @@ */ #include "config.h" -#include <limits.h> #include <raylib.h> #include <stdio.h> #include <stdlib.h> @@ -105,7 +104,15 @@ read_input(void) if (IsKeyPressed(KEY_ENTER)) { TraceLog(LOG_INFO, "enter key pressed"); - return INT_MAX; + return DISP_QUIT; + } + if (IsKeyPressed(KEY_Q)) + { + return DISP_QUIT; + } + if (IsKeyPressed(KEY_R) || IsKeyPressed(KEY_G)) + { + return DISP_RELOAD; } /* EndDrawing(); */ } @@ -123,3 +130,19 @@ destroy(void) { CloseWindow(); } + +#ifndef NDEBUG +void * +pre_reload(void) +{ + TraceLog(LOG_INFO, "pre-reload actions done"); + return NULL; +} + +void +post_reload(void *state) +{ + (void) state; + TraceLog(LOG_INFO, "post-reload actions done"); +} +#endif |