From a8d33279b883d8df994a05050671c62e73f962f3 Mon Sep 17 00:00:00 2001 From: arbee Date: Sun, 9 Jul 2023 18:44:28 -0400 Subject: osd/mac: Make compile again. Does not yet start up because BGFX tries to force OpenGL. [R. Belmont] --- scripts/src/osd/mac.lua | 1 + src/osd/mac/macmain.cpp | 12 +++++------- src/osd/mac/osdmac.h | 5 ++++- src/osd/mac/video.cpp | 3 --- src/osd/mac/window.cpp | 47 +++++++++-------------------------------------- src/osd/mac/window.h | 2 +- 6 files changed, 20 insertions(+), 50 deletions(-) diff --git a/scripts/src/osd/mac.lua b/scripts/src/osd/mac.lua index 4b3967b8c3d..4ac915a645f 100644 --- a/scripts/src/osd/mac.lua +++ b/scripts/src/osd/mac.lua @@ -23,6 +23,7 @@ BASE_TARGETOS = "unix" local os_version = str_to_version(backtick("sw_vers -productVersion")) links { "Cocoa.framework", + "IOKit.framework" } linkoptions { "-framework QuartzCore", diff --git a/src/osd/mac/macmain.cpp b/src/osd/mac/macmain.cpp index 6a99d0c582f..170b5839f64 100644 --- a/src/osd/mac/macmain.cpp +++ b/src/osd/mac/macmain.cpp @@ -20,6 +20,7 @@ #include "corestr.h" #include "osdepend.h" #include "emu.h" +#include "main.h" #include "emuopts.h" #include "strconv.h" @@ -42,12 +43,11 @@ //============================================================ const options_entry mac_options::s_option_entries[] = -{ - { MACOPTION_INIPATH, INI_PATH, OPTION_STRING, "path to ini files" }, + { + {MACOPTION_INIPATH, INI_PATH, core_options::option_type::STRING, "path to ini files"}, - // End of list - { nullptr } -}; + // End of list + {nullptr}}; //============================================================ // mac_options @@ -193,8 +193,6 @@ static void osd_mac_info(void) void mac_osd_interface::video_register() { - video_options_add("opengl", nullptr); - video_options_add("bgfx", nullptr); } //============================================================ diff --git a/src/osd/mac/osdmac.h b/src/osd/mac/osdmac.h index 1b8fc86f393..04d5a0e1b2c 100644 --- a/src/osd/mac/osdmac.h +++ b/src/osd/mac/osdmac.h @@ -50,7 +50,7 @@ public: // input overridables virtual void customize_input_type_list(std::vector &typelist) override; - virtual void video_register() override; + virtual void video_register(); virtual bool video_init() override; virtual bool window_init() override; @@ -58,6 +58,9 @@ public: virtual void video_exit() override; virtual void window_exit() override; + virtual void process_events() override; + virtual bool has_focus() const override; + // sdl specific void release_keys(); bool should_hide_mouse(); diff --git a/src/osd/mac/video.cpp b/src/osd/mac/video.cpp index 1dab5f5782e..d441b5f07f3 100644 --- a/src/osd/mac/video.cpp +++ b/src/osd/mac/video.cpp @@ -44,9 +44,6 @@ osd_video_config video_config; //============================================================ // PROTOTYPES //============================================================ - -static void check_osd_inputs(running_machine &machine); - static void get_resolution(const char *defdata, const char *data, osd_window_config *config, int report_error); diff --git a/src/osd/mac/window.cpp b/src/osd/mac/window.cpp index 02fecce8986..b3ab9083a90 100644 --- a/src/osd/mac/window.cpp +++ b/src/osd/mac/window.cpp @@ -67,44 +67,6 @@ bool mac_osd_interface::window_init() { osd_printf_verbose("Enter macwindow_init\n"); - // initialize the renderer - const int fallbacks[VIDEO_MODE_COUNT] = { - -1, // NONE -> no fallback - -1, // No GDI on macOS - VIDEO_MODE_OPENGL, // BGFX -> OpenGL - -1, // OpenGL -> no fallback - -1, // No SDL2ACCEL on macOS - -1, // No D3D on macOS - -1 // No SOFT on macOS - }; - - int current_mode = video_config.mode; - while (current_mode != VIDEO_MODE_NONE) - { - bool error = false; - switch(current_mode) - { - case VIDEO_MODE_BGFX: - error = renderer_bgfx::init(machine()); - break; - case VIDEO_MODE_OPENGL: - renderer_ogl::init(machine()); - break; - default: - fatalerror("Unknown video mode."); - break; - } - if (error) - { - current_mode = fallbacks[current_mode]; - } - else - { - break; - } - } - video_config.mode = current_mode; - // set up the window list osd_printf_verbose("Leave macwindow_init\n"); return true; @@ -135,6 +97,15 @@ void mac_osd_interface::build_slider_list() } } +void mac_osd_interface::process_events() +{ +} + +bool mac_osd_interface::has_focus() const +{ + return true; +} + //============================================================ // macwindow_exit // (main thread) diff --git a/src/osd/mac/window.h b/src/osd/mac/window.h index 0c08784667d..fce0b5f54bf 100644 --- a/src/osd/mac/window.h +++ b/src/osd/mac/window.h @@ -35,7 +35,7 @@ typedef uintptr_t HashT; class mac_window_info : public osd_window_t { public: - mac_window_info(running_machine &a_machine, int index, std::shared_ptr a_monitor, + mac_window_info(running_machine &a_machine, render_module &renderprovider, int index, std::shared_ptr a_monitor, const osd_window_config *config); ~mac_window_info(); -- cgit v1.2.3