Fix ios compile

This commit is contained in:
luboslenco
2025-03-11 21:08:02 +01:00
parent 0efb708957
commit c890bd69fe
3 changed files with 15 additions and 13 deletions
+2
View File
@@ -192,6 +192,7 @@ if (!flags.lite) {
add_gpu_backend("metal");
project.add_cfiles("sources/backends/data/ios.plist");
project.add_cfiles("sources/backends/data/LaunchScreen.storyboard");
project.add_cfiles("sources/backends/ios_file_dialog.m");
project.add_define("IRON_METAL");
project.add_lib("Metal");
project.add_lib("UIKit");
@@ -211,6 +212,7 @@ if (!flags.lite) {
add_net_backend("posix");
add_thread_backend("posix");
add_gpu_backend("vulkan");
project.add_cfiles("sources/backends/android_file_dialog.c");
project.add_define("IRON_ANDROID");
project.add_define("IRON_VULKAN");
project.add_define("IRON_ANDROID_API=24");
+10 -10
View File
@@ -69,7 +69,7 @@ int iron_window_height() {
float x = point.x * self.contentScaleFactor;
float y = point.y * self.contentScaleFactor;
// Pencil hover
iron_internal_pen_trigger_move(0, x, y, 0.0);
iron_internal_pen_trigger_move(x, y, 0.0);
}
- (id)initWithFrame:(CGRect)frame {
@@ -131,12 +131,12 @@ void iron_internal_call_resize_callback(int width, int height);
float x = point.x * self.contentScaleFactor;
float y = point.y * self.contentScaleFactor;
if (index == 0) {
iron_internal_mouse_trigger_press(0, event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y);
iron_internal_mouse_trigger_press(event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y);
}
iron_internal_surface_trigger_touch_start(index, x, y);
if (touch.type == UITouchTypePencil) {
iron_internal_pen_trigger_press(0, x, y, 0.0);
iron_internal_pen_trigger_press(x, y, 0.0);
}
}
}
@@ -150,7 +150,7 @@ void iron_internal_call_resize_callback(int width, int height);
float x = point.x * self.contentScaleFactor;
float y = point.y * self.contentScaleFactor;
if (index == 0) {
iron_internal_mouse_trigger_move(0, x, y);
iron_internal_mouse_trigger_move(x, y);
}
iron_internal_surface_trigger_move(index, x, y);
}
@@ -163,7 +163,7 @@ void iron_internal_call_resize_callback(int width, int height);
CGPoint point = [touch locationInView:self];
float x = point.x * self.contentScaleFactor;
float y = point.y * self.contentScaleFactor;
iron_internal_pen_trigger_move(0, x, y, touch.force);
iron_internal_pen_trigger_move(x, y, touch.force);
}
}
}
@@ -176,12 +176,12 @@ void iron_internal_call_resize_callback(int width, int height);
float x = point.x * self.contentScaleFactor;
float y = point.y * self.contentScaleFactor;
if (index == 0) {
iron_internal_mouse_trigger_release(0, event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y);
iron_internal_mouse_trigger_release(event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y);
}
iron_internal_surface_trigger_touch_end(index, x, y);
if (touch.type == UITouchTypePencil) {
iron_internal_pen_trigger_release(0, x, y, 0.0);
iron_internal_pen_trigger_release(x, y, 0.0);
}
}
}
@@ -195,12 +195,12 @@ void iron_internal_call_resize_callback(int width, int height);
float x = point.x * self.contentScaleFactor;
float y = point.y * self.contentScaleFactor;
if (index == 0) {
iron_internal_mouse_trigger_release(0, event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y);
iron_internal_mouse_trigger_release(event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y);
}
iron_internal_surface_trigger_touch_end(index, x, y);
if (touch.type == UITouchTypePencil) {
iron_internal_pen_trigger_release(0, x, y, 0.0);
iron_internal_pen_trigger_release(x, y, 0.0);
}
}
}
@@ -398,7 +398,7 @@ void importFile(NSURL *url) {
CGPoint point = [session locationInView:self.view];
float x = point.x * glView.contentScaleFactor;
float y = point.y * glView.contentScaleFactor;
iron_internal_mouse_trigger_move(0, x, y);
iron_internal_mouse_trigger_move(x, y);
iron_internal_surface_trigger_move(0, x, y);
for (UIDragItem *item in session.items) {
+3 -3
View File
@@ -334,11 +334,11 @@ extern bool waitAfterNextDraw;
#ifdef WITH_NFD
#include <nfd.h>
#elif defined(IRON_ANDROID)
#include "android_file_dialog.h"
#include "android_http_request.h"
#include "backends/android_file_dialog.h"
#include "backends/android_http_request.h"
#elif defined(IRON_IOS)
#include <wchar.h>
#include <ios_file_dialog.h>
#include "backends/ios_file_dialog.h"
#endif
#ifdef WITH_IMAGE_WRITE
#ifdef WITH_COMPRESS