From 9c7c0fdb953243d163bccf53e0002cdcb2ebb102 Mon Sep 17 00:00:00 2001 From: Vladyslav Hrytsenko Date: Sat, 21 Oct 2023 16:47:14 +0300 Subject: [PATCH 1/4] disabled retina --- engine/split/v4k_window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/split/v4k_window.c b/engine/split/v4k_window.c index 70dc0c0..916bfea 100644 --- a/engine/split/v4k_window.c +++ b/engine/split/v4k_window.c @@ -168,7 +168,7 @@ void window_drop_callback(GLFWwindow* window, int count, const char** paths) { void window_hints(unsigned flags) { #ifdef __APPLE__ //glfwInitHint( GLFW_COCOA_CHDIR_RESOURCES, GLFW_FALSE ); - //glfwWindowHint( GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_FALSE ); + glfwWindowHint( GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_FALSE ); //glfwWindowHint( GLFW_COCOA_GRAPHICS_SWITCHING, GLFW_FALSE ); //glfwWindowHint( GLFW_COCOA_MENUBAR, GLFW_FALSE ); #endif @@ -1042,7 +1042,7 @@ int window_record(const char *outfile_mp4) { vec2 window_dpi() { vec2 dpi = vec2(1,1); -#ifndef __EMSCRIPTEN__ +#if !defined(__EMSCRIPTEN__) && !defined(__APPLE__) glfwGetMonitorContentScale(glfwGetPrimaryMonitor(), &dpi.x, &dpi.y); #endif return dpi; From 8528c3e38e698059129c201dad08757a152acfdf Mon Sep 17 00:00:00 2001 From: Vladyslav Hrytsenko Date: Sat, 21 Oct 2023 16:48:43 +0300 Subject: [PATCH 2/4] appl compile --- engine/v4k.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/v4k.c b/engine/v4k.c index 4060ac1..509fb09 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -23674,7 +23674,7 @@ void window_drop_callback(GLFWwindow* window, int count, const char** paths) { void window_hints(unsigned flags) { #ifdef __APPLE__ //glfwInitHint( GLFW_COCOA_CHDIR_RESOURCES, GLFW_FALSE ); - //glfwWindowHint( GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_FALSE ); + glfwWindowHint( GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_FALSE ); //glfwWindowHint( GLFW_COCOA_GRAPHICS_SWITCHING, GLFW_FALSE ); //glfwWindowHint( GLFW_COCOA_MENUBAR, GLFW_FALSE ); #endif @@ -24549,7 +24549,7 @@ int window_record(const char *outfile_mp4) { vec2 window_dpi() { vec2 dpi = vec2(1,1); -#ifndef __EMSCRIPTEN__ +#if !defined(__EMSCRIPTEN__) && !defined(__APPLE__) glfwGetMonitorContentScale(glfwGetPrimaryMonitor(), &dpi.x, &dpi.y); #endif return dpi; From de007125f2d304a6da9ef6b02dec41e85e3fd967 Mon Sep 17 00:00:00 2001 From: Vladyslav Hrytsenko Date: Sat, 21 Oct 2023 16:48:52 +0300 Subject: [PATCH 3/4] added mac make --- MAKE.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/MAKE.sh b/MAKE.sh index 1c9c983..33f36d5 100755 --- a/MAKE.sh +++ b/MAKE.sh @@ -215,12 +215,24 @@ if [ "$(uname)" = "Darwin" ]; then chmod +x tools/ninja.osx chmod +x demos/lua/luajit.osx - export args="-w -Iengine/ -framework cocoa -framework iokit -framework CoreFoundation -framework CoreAudio -framework AudioToolbox $args" + export args="-w -Iengine/ -framework cocoa -framework iokit -framework CoreFoundation -framework CoreAudio -framework AudioToolbox $args $flags" echo build=$build, type=$dll, cc=$cc, args=$args + # framework (as dynamic library) + if [ "$dll" = "dll" ]; then + echo libv4k && cc -ObjC -dynamiclib -o libv4k.dylib engine/v4k.c $flags $args + cp libv4k.dylib demos/lua + export import=libv4k.dylib + else + # framework + echo v4k && cc -c -ObjC engine/v4k.c $flags $args + export import=v4k.o + fi + # User-defined apps if [ -n "$app" ]; then - echo "$app" && $cc -ObjC "$app" engine/v4k.c $args -o "v4k.osx" || rc=1 + echo "$app" && $cc -ObjC "$app" libv4k.dylib $args -o "v4k.osx" || rc=1 + # echo "$app" && $cc -ObjC "$app" engine/v4k.c $args -o "v4k.osx" || rc=1 fi # if [ "$run" == "yes" ]; then @@ -233,17 +245,6 @@ if [ "$(uname)" = "Darwin" ]; then # fi - # # framework (as dynamic library) - # if [ "$dll" = "dll" ]; then - # echo libv4k && cc -ObjC -dynamiclib -o libv4k.dylib engine/v4k.c $flags $args - # cp libv4k.dylib demos/lua - # export import=libv4k.dylib - # else - # # framework - # echo v4k && cc -c -ObjC engine/v4k.c $flags $args - # export import=v4k.o - # fi - # # editor # echo editor && cc -o editor tools/editor/editor.c $import $flags $args & From 44a9eaff2b70eca795ed6cfb57b7931769cf7db2 Mon Sep 17 00:00:00 2001 From: Vladyslav Hrytsenko Date: Sat, 21 Oct 2023 16:49:01 +0300 Subject: [PATCH 4/4] updated gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 7e53789..2f6caed 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ engine/v4k.html *.exe.manifest v4k.osx +libv4k.* +editor +*.dSYM +.DS_store