aboutsummaryrefslogtreecommitdiff
path: root/source/raylib.c
diff options
context:
space:
mode:
authorEmil Williams2026-02-11 22:40:44 +0000
committerEmil Williams2026-02-14 00:52:41 +0000
commitdc655ac2079e0eea55c56b6712bf6a2167b57845 (patch)
tree1006f06ddda24c87ffdf549ab7639c89703cc9fb /source/raylib.c
parentcd111fbabfa1f84c9c9aa35f1242d4edbec15b22 (diff)
downloadMonobomberman-dc655ac2079e0eea55c56b6712bf6a2167b57845.tar.xz
Monobomberman-dc655ac2079e0eea55c56b6712bf6a2167b57845.tar.zst
primitive implementation
added movement, explosions, the conception of death, and bugs
Diffstat (limited to 'source/raylib.c')
-rw-r--r--source/raylib.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/source/raylib.c b/source/raylib.c
index 935feee..d96aa4a 100644
--- a/source/raylib.c
+++ b/source/raylib.c
@@ -1,13 +1,3 @@
-/* raylib.c & raygui.c */
-
-#include <raylib.h>
-
-Font DefaultFont(char * choice) {
- Font font = LoadFont(choice);
- if (!IsFontValid(font)) { font = GetFontDefault(); }
- return font;
-}
-
/* raygui.c */
#pragma GCC diagnostic push
@@ -31,3 +21,33 @@ void GuiLoadStyleDarkSimple(void) {
GuiSetStyle(darkStyleProps[i].controlId, darkStyleProps[i].propertyId, darkStyleProps[i].propertyValue);
}
}
+
+/* raylib.c */
+
+#include <raylib.h>
+
+Font DefaultFont(char * choice) {
+ Font font = LoadFont(choice);
+ if (!IsFontValid(font)) { font = GetFontDefault(); }
+ return font;
+}
+
+void RaylibInitialize(int horizontal, int vertical, char * window_name, Font default_font) {
+#ifdef NDEBUG
+ SetTraceLogLevel(LOG_NONE);
+#endif
+ /* SetConfigFlags(FLAG_WINDOW_RESIZABLE); */
+ InitWindow(horizontal, vertical, window_name);
+ SetWindowState(FLAG_WINDOW_HIDDEN);
+ /* we should spawn this in the center of the screen and have our window scale to the limit of the screen */
+ InitAudioDevice();
+ SetWindowPosition(0, 0);
+ GuiLoadStyleDarkSimple();
+ GuiSetFont(default_font);
+}
+
+void RaylibDeinitialize(void) {
+ SetWindowState(FLAG_WINDOW_HIDDEN);
+ CloseAudioDevice();
+ CloseWindow();
+}