summaryrefslogtreecommitdiffhomepage
path: root/src/platforms/rcore_desktop_rgfw.c
diff options
context:
space:
mode:
authorColleague Riley <[email protected]>2024-05-10 15:09:22 -0400
committerGitHub <[email protected]>2024-05-10 21:09:22 +0200
commitf62202198e35161a9fe394a14bbd1a7c655107ad (patch)
treef60619507ceb4fe6ee74a093408f56dfc786638b /src/platforms/rcore_desktop_rgfw.c
parent8a5fd3ac1d481ff978363b80298770ed8eeca9f8 (diff)
downloadraylib-f62202198e35161a9fe394a14bbd1a7c655107ad.tar.gz
raylib-f62202198e35161a9fe394a14bbd1a7c655107ad.zip
remove #define RGFWDEF and make the #undefs only happen for their OS (RGFW) (#3971)
* Fix Makefile issues (RGFW) (linux) (macOS) * Do not use nanosleep on windows at all (PLATFORM_DESKTOP_RGFW) * remove #define RGFWDEF and make the #undefs only happen for their OS
Diffstat (limited to 'src/platforms/rcore_desktop_rgfw.c')
-rw-r--r--src/platforms/rcore_desktop_rgfw.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c
index e4f74938..623dc0e7 100644
--- a/src/platforms/rcore_desktop_rgfw.c
+++ b/src/platforms/rcore_desktop_rgfw.c
@@ -55,35 +55,46 @@
void ShowCursor(void);
void CloseWindow(void);
+#ifdef __linux__
#define _INPUT_EVENT_CODES_H
-#define _APISETSTRING_
-#define RGFWDEF
+#endif
+
+#if defined(__unix__) || defined(__linux__)
#define _XTYPEDEF_FONT
+#endif
+
#define RGFW_IMPLEMENTATION
+#if defined(__WIN32) || defined(__WIN64)
#define WIN32_LEAN_AND_MEAN
#define Rectangle rectangle_win32
#define CloseWindow CloseWindow_win32
#define ShowCursor __imp_ShowCursor
+#define _APISETSTRING_
+#endif
+#ifdef __APPLE__
#define Point NSPOINT
#define Size NSSIZE
+#endif
#ifdef _MSC_VER
__declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char* lpMultiByteStr, int cbMultiByte, wchar_t* lpWideCharStr, int cchWideChar);
#endif
#include "../external/RGFW.h"
+
+#if defined(__WIN32) || defined(__WIN64)
#undef DrawText
#undef ShowCursor
#undef CloseWindow
+#undef Rectangle
+#endif
+
+#ifdef __APPLE__
#undef Point
#undef Size
-
-#define Rectangle struct Rectangle
-void CloseWindow(void);
-void ShowCursor(void);
-
+#endif
#include <stdbool.h>