Merge branch 'test_fullscreen3'

This commit is contained in:
kanjitalk755 2021-02-25 14:50:54 +09:00
commit 2f1f196251
5 changed files with 32 additions and 5 deletions

View File

@ -94,6 +94,7 @@
E416BEE82410AA4E00751E6D /* runtool.c in Sources */ = {isa = PBXBuildFile; fileRef = E416BEE72410AA4E00751E6D /* runtool.c */; };
E416BEEA2410AA9800751E6D /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E416BEE92410AA9800751E6D /* Security.framework */; };
E416BEED2410AE0900751E6D /* etherhelpertool in Resources */ = {isa = PBXBuildFile; fileRef = E416BEEC2410AE0000751E6D /* etherhelpertool */; };
E447066D25D8FCB400EA2C14 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E447066C25D8FCB400EA2C14 /* Metal.framework */; };
E4555EED2354434B00139FCE /* Credits.html in Resources */ = {isa = PBXBuildFile; fileRef = 7539E00A1F23B25A006B2DF2 /* Credits.html */; };
E490334E20D3A5890012DD5F /* clip_macosx64.mm in Sources */ = {isa = PBXBuildFile; fileRef = E490334D20D3A5890012DD5F /* clip_macosx64.mm */; };
E4D8245323543D9800849B78 /* fpu_ieee.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D8245223543D9700849B78 /* fpu_ieee.cpp */; };
@ -339,6 +340,7 @@
E416BEEB2410AB0E00751E6D /* etherhelpertool.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = etherhelpertool.c; sourceTree = "<group>"; };
E416BEEC2410AE0000751E6D /* etherhelpertool */ = {isa = PBXFileReference; lastKnownFileType = text; path = etherhelpertool; sourceTree = BUILT_PRODUCTS_DIR; };
E417913123D7D67C0009AD63 /* defs68k.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = defs68k.c; path = gencpu_output/defs68k.c; sourceTree = BUILT_PRODUCTS_DIR; };
E447066C25D8FCB400EA2C14 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
E490334D20D3A5890012DD5F /* clip_macosx64.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = clip_macosx64.mm; sourceTree = "<group>"; };
E4D8245223543D9700849B78 /* fpu_ieee.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fpu_ieee.cpp; sourceTree = "<group>"; };
E4ED8EDD24E39AFE00843219 /* compemu_support.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = compemu_support.cpp; sourceTree = "<group>"; };
@ -357,6 +359,7 @@
E416BEEA2410AA9800751E6D /* Security.framework in Frameworks */,
756C1B391F25306A00620917 /* AppKit.framework in Frameworks */,
752F26FB1F240E69001032B4 /* IOKit.framework in Frameworks */,
E447066D25D8FCB400EA2C14 /* Metal.framework in Frameworks */,
752F26F91F240E51001032B4 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -416,6 +419,7 @@
752F26F71F240E51001032B4 /* Frameworks */ = {
isa = PBXGroup;
children = (
E447066C25D8FCB400EA2C14 /* Metal.framework */,
E416BEE92410AA9800751E6D /* Security.framework */,
E413D93520D260DA00E437D8 /* SDL2.framework */,
756C1B381F25306A00620917 /* AppKit.framework */,

View File

@ -24,4 +24,6 @@
// Invokes the specified function with an NSAutoReleasePool in place.
void NSAutoReleasePool_wrap(void (*fn)(void));
bool MetalIsAvailable();
#endif

View File

@ -27,6 +27,9 @@
#include <SDL_syswm.h>
#endif
#include <sys/sysctl.h>
#include <Metal/Metal.h>
// This is used from video_sdl.cpp.
void NSAutoReleasePool_wrap(void (*fn)(void))
{
@ -81,3 +84,14 @@ void set_current_directory()
[pool release];
}
bool MetalIsAvailable() {
const int EL_CAPITAN = 15; // Darwin major version of El Capitan
char s[16];
size_t size = sizeof(s);
int v;
if (sysctlbyname("kern.osrelease", s, &size, NULL, 0) || sscanf(s, "%d", &v) != 1 || v < EL_CAPITAN) return false;
id<MTLDevice> dev = MTLCreateSystemDefaultDevice();
bool r = dev != nil;
[dev release];
return r;
}

View File

@ -50,6 +50,10 @@
#include <vector>
#include <string>
#ifdef __MACOSX__
#include "utils_macosx.h"
#endif
#ifdef WIN32
#include <malloc.h> /* alloca() */
#endif
@ -760,11 +764,10 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, PrefsFindBool("scale_nearest") ? "nearest" : "linear");
/*
// Always use a resize-able window. This helps allow SDL to manage
// transitions involving fullscreen to or from windowed-mode.
window_flags |= SDL_WINDOW_RESIZABLE;
*/
#if defined(__MACOSX__) && SDL_VERSION_ATLEAST(2,0,14)
if (MetalIsAvailable()) window_flags |= SDL_WINDOW_METAL;
#endif
if (!sdl_window) {
int m = get_mag_rate();
sdl_window = SDL_CreateWindow(

View File

@ -90,6 +90,7 @@
E420260B24125442000508DF /* etherhelpertool in Resources */ = {isa = PBXBuildFile; fileRef = E420260A2412540D000508DF /* etherhelpertool */; };
E420910120D0C4FA0094654F /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E420910020D0C4FA0094654F /* SDL2.framework */; };
E444DC1520C8F06700DD29C9 /* pict.c in Sources */ = {isa = PBXBuildFile; fileRef = E444DC1420C8F06700DD29C9 /* pict.c */; };
E447067025D904D500EA2C14 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E447066F25D904D500EA2C14 /* Metal.framework */; };
E44C460520D262B0000583AE /* tftp.c in Sources */ = {isa = PBXBuildFile; fileRef = E44C45DC20D262AD000583AE /* tftp.c */; };
E44C460620D262B0000583AE /* mbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = E44C45DD20D262AD000583AE /* mbuf.c */; };
E44C460720D262B0000583AE /* ip_icmp.c in Sources */ = {isa = PBXBuildFile; fileRef = E44C45DF20D262AD000583AE /* ip_icmp.c */; };
@ -348,6 +349,7 @@
E420910020D0C4FA0094654F /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = /Library/Frameworks/SDL2.framework; sourceTree = "<group>"; };
E4302EE21FBFE7FA00A5B500 /* lowmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lowmem.c; path = Darwin/lowmem.c; sourceTree = "<group>"; };
E444DC1420C8F06700DD29C9 /* pict.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pict.c; path = ../pict.c; sourceTree = "<group>"; };
E447066F25D904D500EA2C14 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
E44C45DC20D262AD000583AE /* tftp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tftp.c; path = ../../../BasiliskII/src/slirp/tftp.c; sourceTree = "<group>"; };
E44C45DD20D262AD000583AE /* mbuf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mbuf.c; path = ../../../BasiliskII/src/slirp/mbuf.c; sourceTree = "<group>"; };
E44C45DE20D262AD000583AE /* tftp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tftp.h; path = ../../../BasiliskII/src/slirp/tftp.h; sourceTree = "<group>"; };
@ -412,6 +414,7 @@
E420260524125182000508DF /* Security.framework in Frameworks */,
0856D21514A9A6C6000B1711 /* IOKit.framework in Frameworks */,
08CD42DC14B7B85B009CA2A2 /* Cocoa.framework in Frameworks */,
E447067025D904D500EA2C14 /* Metal.framework in Frameworks */,
08CD42E814B7B8AA009CA2A2 /* Carbon.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -892,6 +895,7 @@
08CD42DF14B7B865009CA2A2 /* Frameworks */ = {
isa = PBXGroup;
children = (
E447066F25D904D500EA2C14 /* Metal.framework */,
E420260424125182000508DF /* Security.framework */,
E420910020D0C4FA0094654F /* SDL2.framework */,
08CD42E714B7B8AA009CA2A2 /* Carbon.framework */,