aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlendi <slendi@socopon.com>2024-03-08 15:21:25 +0200
committerSlendi <slendi@socopon.com>2024-03-08 19:25:43 +0200
commit8182a2592705b972eea3dfab202f951ea00e6048 (patch)
treefae14fade659515c04f8581693e405c14258af10
parent32be283591d23b2b071b75961201119808fe067f (diff)
Add support for MacOS
Signed-off-by: Slendi <slendi@socopon.com>
-rwxr-xr-xbuild.mac.sh4
-rw-r--r--config.h8
-rw-r--r--main.cpp11
3 files changed, 23 insertions, 0 deletions
diff --git a/build.mac.sh b/build.mac.sh
new file mode 100755
index 0000000..12b9943
--- /dev/null
+++ b/build.mac.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+clang++ -O3 -std=c++20 main.cpp -o pres -I/opt/homebrew/include /opt/homebrew/lib/libraylib.a -lm -framework Cocoa -framework OpenGL -framework IOKit
+
diff --git a/config.h b/config.h
index 86358ae..9f89eac 100644
--- a/config.h
+++ b/config.h
@@ -1,5 +1,13 @@
#ifdef _WIN32
+<<<<<<< Updated upstream
static char const constexpr *const FONT_PATH = "C:\\Windows\\Fonts\\DejaVuSans.ttf";
+=======
+static char const constexpr *const FONT_PATH =
+ "C:\\Windows\\Fonts\\DejaVuSans.ttf";
+#elif __APPLE__
+static char const constexpr *const FONT_PATH =
+ "/Library/Fonts/Arial Unicode.ttf";
+>>>>>>> Stashed changes
#else
static char const constexpr *const FONT_PATH = "/usr/share/fonts/TTF/DejaVuSans.ttf";
#endif
diff --git a/main.cpp b/main.cpp
index 954e8a0..419396d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -49,8 +49,19 @@ public:
Application(Config config, Slides slides)
: m_config(config), m_slides(slides) {
+<<<<<<< Updated upstream
int w = m_config.width;
int h = m_config.height;
+=======
+#ifdef __APPLE__
+ SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_MSAA_4X_HINT |
+ FLAG_WINDOW_HIGHDPI);
+#else
+ SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_MSAA_4X_HINT);
+#endif
+ InitWindow(w, h, "Presentation");
+ SetTargetFPS(30);
+>>>>>>> Stashed changes
if (m_config.fullscreen) {
w = GetMonitorWidth(GetCurrentMonitor());