Add macOS Support (#537)

This commit is contained in:
David Chavez
2025-03-14 21:07:07 +01:00
committed by GitHub
parent 91db87632c
commit 25e7b31228
21 changed files with 594 additions and 65 deletions

View File

@@ -1,7 +1,7 @@
#ifndef __ZELDA_RENDER_H__
#define __ZELDA_RENDER_H__
#include <unordered_set>
#include <set>
#include <filesystem>
#include "common/rt64_user_configuration.h"
@@ -32,7 +32,7 @@ namespace zelda64 {
protected:
std::unique_ptr<RT64::Application> app;
std::unordered_set<std::filesystem::path> enabled_texture_packs;
std::set<std::filesystem::path> enabled_texture_packs;
};
std::unique_ptr<ultramodern::renderer::RendererContext> create_render_context(uint8_t *rdram, ultramodern::renderer::WindowHandle window_handle, bool developer_mode);

19
include/zelda_support.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef __ZELDA_SUPPORT_H__
#define __ZELDA_SUPPORT_H__
#include <functional>
#include <filesystem>
namespace zelda64 {
std::filesystem::path get_asset_path(const char* asset);
void open_file_dialog(std::function<void(bool success, const std::filesystem::path& path)> callback);
void show_error_message_box(const char *title, const char *message);
// Apple specific methods that usually require Objective-C. Implemented in support_apple.mm.
#ifdef __APPLE__
void dispatch_on_ui_thread(std::function<void()> func);
const char* get_bundle_resource_directory();
#endif
}
#endif