mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-11 10:30:09 +00:00
Update for SDL3
This commit is contained in:
parent
19308135c3
commit
3d49e9790b
@ -61,19 +61,16 @@ bool is_fullscreen_osx(SDL_Window * window)
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_SysWMinfo wmInfo;
|
||||
#if SDL_VERSION_ATLEAST(3, 0, 0)
|
||||
if (!SDL_GetWindowWMInfo(window, &wmInfo, SDL_SYSWM_CURRENT_VERSION)) {
|
||||
return false;
|
||||
}
|
||||
SDL_PropertiesID props = SDL_GetWindowProperties(window);
|
||||
NSWindow *nswindow = (NSWindow *)SDL_GetProperty(props, "SDL.window.cocoa.window", NULL);
|
||||
#else
|
||||
SDL_SysWMinfo wmInfo;
|
||||
SDL_VERSION(&wmInfo.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &wmInfo)) {
|
||||
return false;
|
||||
}
|
||||
NSWindow *nswindow = SDL_GetWindowWMInfo(window, &wmInfo) ? wmInfo.info.cocoa.window : nil;
|
||||
#endif
|
||||
|
||||
const NSWindowStyleMask styleMask = [wmInfo.info.cocoa.window styleMask];
|
||||
const NSWindowStyleMask styleMask = [nswindow styleMask];
|
||||
return (styleMask & NSWindowStyleMaskFullScreen) != 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -2394,8 +2394,7 @@ static void handle_events(void)
|
||||
break;
|
||||
|
||||
case SDL_EVENT_DROP_FILE:
|
||||
CDROMDrop(event.drop.file);
|
||||
SDL_free(event.drop.file);
|
||||
CDROMDrop(event.drop.data);
|
||||
break;
|
||||
|
||||
// Window "close" widget clicked
|
||||
|
@ -719,17 +719,21 @@ static bool init_sdl()
|
||||
atexit(SDL_Quit);
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
#if !SDL_VERSION_ATLEAST(3, 0, 0)
|
||||
#define SDL_EVENT_DROP_FILE SDL_DROPFILE
|
||||
#endif
|
||||
const int SDL_EVENT_TIMEOUT = 100;
|
||||
for (int i = 0; i < SDL_EVENT_TIMEOUT; i++) {
|
||||
SDL_Event event;
|
||||
SDL_PollEvent(&event);
|
||||
#if SDL_VERSION_ATLEAST(3, 0, 0)
|
||||
if (event.type == SDL_EVENT_DROP_FILE) {
|
||||
sdl_vmdir = event.drop.data;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
if (event.type == SDL_DROPFILE) {
|
||||
sdl_vmdir = event.drop.file;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
SDL_Delay(1);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user