summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/simple.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/simple.nim b/examples/simple.nim
index d76c716..e3e1e2f 100644
--- a/examples/simple.nim
+++ b/examples/simple.nim
@@ -1,3 +1,19 @@
+# Hack to make the example compile when --app:gui option is given to nim
+when defined(windows):
+ {.emit:"""/*INCLUDESECTION*/
+#include <raylib.h>
+#undef ShowWindow
+#define CloseWindow WINDOWS_CloseWindow
+#define ShowCursor WINDOWS_ShowCursor
+#define ShowWindow WINDOWS_ShowWindow
+#define Rectangle WINDOWS_Rectangle
+#include <windows.h>
+#undef CloseWindow
+#undef ShowCursor
+#undef ShowWindow
+#undef Rectangle
+""".}
+
import foolib/[raylib, imgui]
InitWindow(1024, 768, "hello")