Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions ctf/macos/ctf.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -195,7 +195,8 @@
E29552A321F61D9600336DD3 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1240;
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 2600;
ORGANIZATIONNAME = Krzysztof;
TargetAttributes = {
E29552AA21F61D9600336DD3 = {
Expand Down Expand Up @@ -224,6 +225,7 @@
/* Begin PBXShellScriptBuildPhase section */
E296564721F8873000BEC8E0 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -306,13 +308,14 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -366,13 +369,14 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -395,9 +399,12 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
EXECUTABLE_PREFIX = "";
MACOSX_DEPLOYMENT_TARGET = 11.0;
ONLY_ACTIVE_ARCH = NO;
"OTHER_CFLAGS[arch=*]" = (
"-D_DEBUG",
"-Wno-dangling-else",
Expand All @@ -406,17 +413,19 @@
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALID_ARCHS = x86_64;
};
name = Debug;
};
E29552B121F61D9600336DD3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
EXECUTABLE_PREFIX = "";
MACOSX_DEPLOYMENT_TARGET = 11.0;
ONLY_ACTIVE_ARCH = NO;
"OTHER_CFLAGS[arch=*]" = (
"-DNDEBUG",
"-Wno-dangling-else",
Expand All @@ -425,7 +434,6 @@
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALID_ARCHS = x86_64;
};
name = Release;
};
Expand Down
20 changes: 14 additions & 6 deletions game/macos/game.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -341,7 +341,8 @@
E29551F921F618E100336DD3 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1240;
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 2600;
ORGANIZATIONNAME = Krzysztof;
TargetAttributes = {
E295520021F618E100336DD3 = {
Expand Down Expand Up @@ -370,6 +371,7 @@
/* Begin PBXShellScriptBuildPhase section */
E296564621F8869500BEC8E0 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -474,13 +476,14 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -534,13 +537,14 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -563,9 +567,12 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
EXECUTABLE_PREFIX = "";
MACOSX_DEPLOYMENT_TARGET = 11.0;
ONLY_ACTIVE_ARCH = NO;
"OTHER_CFLAGS[arch=*]" = (
"-D_DEBUG",
"-Wno-dangling-else",
Expand All @@ -574,17 +581,19 @@
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALID_ARCHS = x86_64;
};
name = Debug;
};
E295520721F618E100336DD3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
EXECUTABLE_PREFIX = "";
MACOSX_DEPLOYMENT_TARGET = 11.0;
ONLY_ACTIVE_ARCH = NO;
"OTHER_CFLAGS[arch=*]" = (
"-DNDEBUG",
"-Wno-dangling-else",
Expand All @@ -593,7 +602,6 @@
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALID_ARCHS = x86_64;
};
name = Release;
};
Expand Down
13 changes: 8 additions & 5 deletions macos/quake2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -303,6 +303,7 @@
/* Begin PBXShellScriptBuildPhase section */
E296564421F8853000BEC8E0 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -406,7 +407,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
Expand Down Expand Up @@ -466,7 +467,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
Expand Down Expand Up @@ -494,6 +495,7 @@
E295530521F620FB00336DD3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
"LD_RUNPATH_SEARCH_PATHS[arch=*]" = $VULKAN_SDK/lib;
Expand All @@ -505,14 +507,15 @@
"-Wno-shorten-64-to-32",
"-Wno-pointer-sign",
);
PRODUCT_BUNDLE_IDENTIFIER = com.kondrak.vkquake2;
PRODUCT_NAME = "$(TARGET_NAME)";
VALID_ARCHS = x86_64;
};
name = Debug;
};
E295530621F620FB00336DD3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
"LD_RUNPATH_SEARCH_PATHS[arch=*]" = $VULKAN_SDK/lib;
Expand All @@ -524,8 +527,8 @@
"-Wno-shorten-64-to-32",
"-Wno-pointer-sign",
);
PRODUCT_BUNDLE_IDENTIFIER = com.kondrak.vkquake2;
PRODUCT_NAME = "$(TARGET_NAME)";
VALID_ARCHS = x86_64;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
LastUpgradeVersion = "2600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -138,7 +138,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
14 changes: 8 additions & 6 deletions macos/vk_imp.m
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void Vkimp_GetInstanceExtensions(char **extensions, uint32_t *extCount)
if (extensions)
{
extensions[0] = VK_KHR_SURFACE_EXTENSION_NAME;
extensions[1] = VK_MVK_MACOS_SURFACE_EXTENSION_NAME;
extensions[1] = VK_EXT_METAL_SURFACE_EXTENSION_NAME;
// required by VK_EXT_full_screen_exclusive and VK_KHR_portability_subset
if (vk_config.vk_khr_get_physical_device_properties2_available)
extensions[numExts++] = VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME;
Expand All @@ -338,16 +338,18 @@ void Vkimp_GetInstanceExtensions(char **extensions, uint32_t *extCount)
}
}

VkResult Vkimp_CreateSurface()
VkResult Vkimp_CreateSurface(void)
{
VkMacOSSurfaceCreateInfoMVK surfaceCreateInfo = {
.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK,
CAMetalLayer* layer = (__bridge CAMetalLayer *)(CocoaAddMetalView());

VkMetalSurfaceCreateInfoEXT surfaceCreateInfo = {
.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT,
.pNext = NULL,
.flags = 0,
.pView = CocoaAddMetalView()
.pLayer = layer
};

return vkCreateMacOSSurfaceMVK(vk_instance, &surfaceCreateInfo, NULL, &vk_surface);
return vkCreateMetalSurfaceEXT(vk_instance, &surfaceCreateInfo, NULL, &vk_surface);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions macos/vk_macos.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef __VK_MACOS_H__
#define __VK_MACOS_H__

#include <vulkan/vulkan_metal.h>

typedef struct
{
FILE *log_fp;
Expand Down
15 changes: 9 additions & 6 deletions macos/win_macos.m
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static int translateKey(NSEvent *keyEvent)
}

// handle window and system events
void CocoaHandleEvents()
void CocoaHandleEvents(void)
{
@autoreleasepool {
if(window == nil) return;
Expand Down Expand Up @@ -389,16 +389,19 @@ void CocoaCreateWindow(int x, int y, int *w, int *h, qboolean fullscreen)
}

// destroy Cocoa window
void CocoaDestroyWindow()
void CocoaDestroyWindow(void)
{
[window close];
window = nil;
}

// attach Metal view to the window - return it so we can use it when creating Vulkan surface
const void *CocoaAddMetalView()
const void *CocoaAddMetalView(void)
{
MetalView *mv = [[MetalView alloc] initWithFrame:[[window contentView] frame]];
[[window contentView] addSubview:mv];
return (__bridge const void *)mv;
CAMetalLayer* layer = [CAMetalLayer layer];
[layer setContentsScale: [window backingScaleFactor] ];

window.contentView.layer = layer;
window.contentView.wantsLayer = YES;
return (__bridge const void *)(layer);
}
Loading