diff options
author | Slendi <slendi@socopon.com> | 2024-03-08 15:21:25 +0200 |
---|---|---|
committer | Slendi <slendi@socopon.com> | 2024-03-08 19:25:43 +0200 |
commit | 8182a2592705b972eea3dfab202f951ea00e6048 (patch) | |
tree | fae14fade659515c04f8581693e405c14258af10 | |
parent | 32be283591d23b2b071b75961201119808fe067f (diff) |
Add support for MacOS
Signed-off-by: Slendi <slendi@socopon.com>
-rwxr-xr-x | build.mac.sh | 4 | ||||
-rw-r--r-- | config.h | 8 | ||||
-rw-r--r-- | main.cpp | 11 |
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 + @@ -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 @@ -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()); |