diff options
author | gilzoide <gilzoide@gmail.com> | 2024-05-05 11:04:48 -0300 |
---|---|---|
committer | gilzoide <gilzoide@gmail.com> | 2024-05-05 11:08:42 -0300 |
commit | 9999ea36e68e910af8dbf1f8b0c0fc4bf2c3b6a5 (patch) | |
tree | 3f89305088b7f14965dce6c15af45b95b3eb0472 /sources/rl | |
parent | d78391bcf9d9730a70298c39871b60314629ed66 (diff) | |
download | gamejam-slgj-2024-9999ea36e68e910af8dbf1f8b0c0fc4bf2c3b6a5.tar.gz gamejam-slgj-2024-9999ea36e68e910af8dbf1f8b0c0fc4bf2c3b6a5.tar.bz2 gamejam-slgj-2024-9999ea36e68e910af8dbf1f8b0c0fc4bf2c3b6a5.zip |
Add script for automatically generating enums.c from raylib_api.json
Diffstat (limited to 'sources/rl')
-rw-r--r-- | sources/rl/enums.c | 118 | ||||
-rw-r--r-- | sources/rl/enums.h | 9 |
2 files changed, 127 insertions, 0 deletions
diff --git a/sources/rl/enums.c b/sources/rl/enums.c new file mode 100644 index 0000000..7a055e2 --- /dev/null +++ b/sources/rl/enums.c @@ -0,0 +1,118 @@ +// This file was automatically generated by tools/generate_raylib_enums.py +// Any manual modifications will be overwritten when running the script again +#include "enums.h" +#include "raylib.h" + +void rl_register_enums(s7_scheme *s7) { + // enum KeyboardKey + S7_DEFINE_ENUM(s7, KEY_NULL); + S7_DEFINE_ENUM(s7, KEY_APOSTROPHE); + S7_DEFINE_ENUM(s7, KEY_COMMA); + S7_DEFINE_ENUM(s7, KEY_MINUS); + S7_DEFINE_ENUM(s7, KEY_PERIOD); + S7_DEFINE_ENUM(s7, KEY_SLASH); + S7_DEFINE_ENUM(s7, KEY_ZERO); + S7_DEFINE_ENUM(s7, KEY_ONE); + S7_DEFINE_ENUM(s7, KEY_TWO); + S7_DEFINE_ENUM(s7, KEY_THREE); + S7_DEFINE_ENUM(s7, KEY_FOUR); + S7_DEFINE_ENUM(s7, KEY_FIVE); + S7_DEFINE_ENUM(s7, KEY_SIX); + S7_DEFINE_ENUM(s7, KEY_SEVEN); + S7_DEFINE_ENUM(s7, KEY_EIGHT); + S7_DEFINE_ENUM(s7, KEY_NINE); + S7_DEFINE_ENUM(s7, KEY_SEMICOLON); + S7_DEFINE_ENUM(s7, KEY_EQUAL); + S7_DEFINE_ENUM(s7, KEY_A); + S7_DEFINE_ENUM(s7, KEY_B); + S7_DEFINE_ENUM(s7, KEY_C); + S7_DEFINE_ENUM(s7, KEY_D); + S7_DEFINE_ENUM(s7, KEY_E); + S7_DEFINE_ENUM(s7, KEY_F); + S7_DEFINE_ENUM(s7, KEY_G); + S7_DEFINE_ENUM(s7, KEY_H); + S7_DEFINE_ENUM(s7, KEY_I); + S7_DEFINE_ENUM(s7, KEY_J); + S7_DEFINE_ENUM(s7, KEY_K); + S7_DEFINE_ENUM(s7, KEY_L); + S7_DEFINE_ENUM(s7, KEY_M); + S7_DEFINE_ENUM(s7, KEY_N); + S7_DEFINE_ENUM(s7, KEY_O); + S7_DEFINE_ENUM(s7, KEY_P); + S7_DEFINE_ENUM(s7, KEY_Q); + S7_DEFINE_ENUM(s7, KEY_R); + S7_DEFINE_ENUM(s7, KEY_S); + S7_DEFINE_ENUM(s7, KEY_T); + S7_DEFINE_ENUM(s7, KEY_U); + S7_DEFINE_ENUM(s7, KEY_V); + S7_DEFINE_ENUM(s7, KEY_W); + S7_DEFINE_ENUM(s7, KEY_X); + S7_DEFINE_ENUM(s7, KEY_Y); + S7_DEFINE_ENUM(s7, KEY_Z); + S7_DEFINE_ENUM(s7, KEY_LEFT_BRACKET); + S7_DEFINE_ENUM(s7, KEY_BACKSLASH); + S7_DEFINE_ENUM(s7, KEY_RIGHT_BRACKET); + S7_DEFINE_ENUM(s7, KEY_GRAVE); + S7_DEFINE_ENUM(s7, KEY_SPACE); + S7_DEFINE_ENUM(s7, KEY_ESCAPE); + S7_DEFINE_ENUM(s7, KEY_ENTER); + S7_DEFINE_ENUM(s7, KEY_TAB); + S7_DEFINE_ENUM(s7, KEY_BACKSPACE); + S7_DEFINE_ENUM(s7, KEY_INSERT); + S7_DEFINE_ENUM(s7, KEY_DELETE); + S7_DEFINE_ENUM(s7, KEY_RIGHT); + S7_DEFINE_ENUM(s7, KEY_LEFT); + S7_DEFINE_ENUM(s7, KEY_DOWN); + S7_DEFINE_ENUM(s7, KEY_UP); + S7_DEFINE_ENUM(s7, KEY_PAGE_UP); + S7_DEFINE_ENUM(s7, KEY_PAGE_DOWN); + S7_DEFINE_ENUM(s7, KEY_HOME); + S7_DEFINE_ENUM(s7, KEY_END); + S7_DEFINE_ENUM(s7, KEY_CAPS_LOCK); + S7_DEFINE_ENUM(s7, KEY_SCROLL_LOCK); + S7_DEFINE_ENUM(s7, KEY_NUM_LOCK); + S7_DEFINE_ENUM(s7, KEY_PRINT_SCREEN); + S7_DEFINE_ENUM(s7, KEY_PAUSE); + S7_DEFINE_ENUM(s7, KEY_F1); + S7_DEFINE_ENUM(s7, KEY_F2); + S7_DEFINE_ENUM(s7, KEY_F3); + S7_DEFINE_ENUM(s7, KEY_F4); + S7_DEFINE_ENUM(s7, KEY_F5); + S7_DEFINE_ENUM(s7, KEY_F6); + S7_DEFINE_ENUM(s7, KEY_F7); + S7_DEFINE_ENUM(s7, KEY_F8); + S7_DEFINE_ENUM(s7, KEY_F9); + S7_DEFINE_ENUM(s7, KEY_F10); + S7_DEFINE_ENUM(s7, KEY_F11); + S7_DEFINE_ENUM(s7, KEY_F12); + S7_DEFINE_ENUM(s7, KEY_LEFT_SHIFT); + S7_DEFINE_ENUM(s7, KEY_LEFT_CONTROL); + S7_DEFINE_ENUM(s7, KEY_LEFT_ALT); + S7_DEFINE_ENUM(s7, KEY_LEFT_SUPER); + S7_DEFINE_ENUM(s7, KEY_RIGHT_SHIFT); + S7_DEFINE_ENUM(s7, KEY_RIGHT_CONTROL); + S7_DEFINE_ENUM(s7, KEY_RIGHT_ALT); + S7_DEFINE_ENUM(s7, KEY_RIGHT_SUPER); + S7_DEFINE_ENUM(s7, KEY_KB_MENU); + S7_DEFINE_ENUM(s7, KEY_KP_0); + S7_DEFINE_ENUM(s7, KEY_KP_1); + S7_DEFINE_ENUM(s7, KEY_KP_2); + S7_DEFINE_ENUM(s7, KEY_KP_3); + S7_DEFINE_ENUM(s7, KEY_KP_4); + S7_DEFINE_ENUM(s7, KEY_KP_5); + S7_DEFINE_ENUM(s7, KEY_KP_6); + S7_DEFINE_ENUM(s7, KEY_KP_7); + S7_DEFINE_ENUM(s7, KEY_KP_8); + S7_DEFINE_ENUM(s7, KEY_KP_9); + S7_DEFINE_ENUM(s7, KEY_KP_DECIMAL); + S7_DEFINE_ENUM(s7, KEY_KP_DIVIDE); + S7_DEFINE_ENUM(s7, KEY_KP_MULTIPLY); + S7_DEFINE_ENUM(s7, KEY_KP_SUBTRACT); + S7_DEFINE_ENUM(s7, KEY_KP_ADD); + S7_DEFINE_ENUM(s7, KEY_KP_ENTER); + S7_DEFINE_ENUM(s7, KEY_KP_EQUAL); + S7_DEFINE_ENUM(s7, KEY_BACK); + S7_DEFINE_ENUM(s7, KEY_MENU); + S7_DEFINE_ENUM(s7, KEY_VOLUME_UP); + S7_DEFINE_ENUM(s7, KEY_VOLUME_DOWN); +} diff --git a/sources/rl/enums.h b/sources/rl/enums.h new file mode 100644 index 0000000..02b779c --- /dev/null +++ b/sources/rl/enums.h @@ -0,0 +1,9 @@ +#pragma once + +#include "s7/s7.h" + +/// Defines an enum in s7 with the same name and value as in C +#define S7_DEFINE_ENUM(s7, x) \ + s7_define_variable(s7, #x, s7_make_integer(s7, x)) + +void rl_register_enums(s7_scheme *s7); |