aboutsummaryrefslogtreecommitdiff
path: root/source/raylib.c
diff options
context:
space:
mode:
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();
+}