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 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 & diff --git a/engine/split/v4k_window.c b/engine/split/v4k_window.c index 8fb248c..d9d0aea 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 @@ -1043,7 +1043,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; diff --git a/engine/v4k.c b/engine/v4k.c index 58a0fb4..25f56cd 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;