Merge branch 'main' of dev.v4.games:v4games/v4k

main
Dominik Madarász 2023-10-21 20:29:37 +02:00
commit f9d23b574f
4 changed files with 22 additions and 17 deletions

4
.gitignore vendored
View File

@ -16,3 +16,7 @@ engine/v4k.html
*.exe.manifest
v4k.osx
libv4k.*
editor
*.dSYM
.DS_store

27
MAKE.sh
View File

@ -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 &

View File

@ -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;

View File

@ -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;