for backing

main
xszAzy 3 months ago
parent 678cef95c4
commit fbe6e20802

4
.gitignore vendored

@ -0,0 +1,4 @@
#dirs
bin/
bin-int/

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "MetalLearning/src/vendor"]
path = MetalLearning/src/vendor
url = https://github.com/gabime/spdlog.git

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:MetalLearning/MetalLearning.xcodeproj">
</FileRef>
<Group
location = "group:MetalLearning/src/MEL/Events"
name = "Events">
</Group>
</Workspace>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "DF66116D-CBEC-417A-B438-C6E6BCF5D426"
type = "0"
version = "2.0">
</Bucket>

@ -1,11 +0,0 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -1,85 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -1,6 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -1,24 +0,0 @@
//
// ContentView.swift
// MetalLearning
//
// Created by 殿 on 9/25/25.
//
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
}
.padding()
}
}
#Preview {
ContentView()
}

@ -0,0 +1,4 @@
#pragma once
#define BIT(x)(1<<x)
#define MEL_BIND_EVENT_FN(fn) std::bind(&fn, this, std::placeholders::_1)

@ -0,0 +1,4 @@
#pragma once
#include "MEL/Application.h"
#include "Log.h"

@ -0,0 +1,742 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
030AAB3B742D4C2D29F3F97B /* Log.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABD76E03D41226B5BBADB443 /* Log.mm */; };
1817955824A247CA9F871398 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA5C1300C9792D32A5828940 /* CoreFoundation.framework */; };
470B56372E897D33001040D0 /* Sandbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = 470B56362E897D33001040D0 /* Sandbox.mm */; };
470B563A2E8988BF001040D0 /* Entrypoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 470B56392E8988BF001040D0 /* Entrypoint.mm */; };
47FF21F62E8A056A004D6F5D /* Window.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47FF21F52E8A056A004D6F5D /* Window.mm */; };
47FF21F92E8A07BE004D6F5D /* WindowManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47FF21F82E8A07BE004D6F5D /* WindowManager.mm */; };
4B007C2E118E73A07F909A6E /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0271576359DD4A8A43A2BB6 /* MetalKit.framework */; };
755C09380F7FFE6ABFA5DF78 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC2A80804084C572BE684EC0 /* ViewController.mm */; };
9130093853F069AAB1254778 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B91C4E06FD8CD12F3C5FB20 /* QuartzCore.framework */; };
95EFFE0C89EF477E0EDA5C4C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 74A9A874B8BD79A6AC8EFEB4 /* CoreGraphics.framework */; };
B24E4279E3323A6BF64A70B9 /* melpch.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0EB1E78134D817339BDF0DC1 /* melpch.mm */; };
C39B3D3E56290730BF01AB7E /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EF28886D25E4A381101EEC6 /* Metal.framework */; };
CE38F4BC94C6EC2E02C912FC /* Application.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6038CC64F5AF8B96644BE2A4 /* Application.mm */; };
D73895124B210CC46D6EBB52 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6188BCBA2816B42C9618DAFA /* AppDelegate.mm */; };
E7B2A65E3F181950F126349E /* Shader.metal in Resources */ = {isa = PBXBuildFile; fileRef = 0EC3D68640BD2138BA9C5CC6 /* Shader.metal */; };
EC4D1F2E8A2E1FE061AC656E /* MetalRenderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4ADA29160D9A89886ACF6756 /* MetalRenderer.mm */; };
F8E8DBA28B76A594F44F49E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D6BC6AA50D7885C8F7B2CEA /* Cocoa.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
E7F7B1F70E1DE1A97524D837 /* Embed Libraries */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Libraries";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
0BCE199D22E0B4CF12FCAFDD /* melpch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = melpch.h; path = src/melpch.h; sourceTree = "<group>"; };
0EB1E78134D817339BDF0DC1 /* melpch.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = melpch.mm; path = src/melpch.mm; sourceTree = "<group>"; };
0EC3D68640BD2138BA9C5CC6 /* Shader.metal */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.metal; name = Shader.metal; path = ShaderSrc/Shader.metal; sourceTree = "<group>"; };
0EF28886D25E4A381101EEC6 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
13E796BCD6A7F72E33DCD4FC /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ViewController.h; path = src/MEL/Renderer/ViewController.h; sourceTree = "<group>"; };
333B5CED59618C9FC068832D /* Log.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Log.h; path = src/MEL/Log/Log.h; sourceTree = "<group>"; };
38BBC2DB812CA70DC5CB791B /* MetalLearning.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MetalLearning.app; sourceTree = BUILT_PRODUCTS_DIR; };
470B56362E897D33001040D0 /* Sandbox.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Sandbox.mm; sourceTree = "<group>"; };
470B56382E8986D5001040D0 /* MEL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MEL.h; sourceTree = "<group>"; };
470B56392E8988BF001040D0 /* Entrypoint.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = Entrypoint.mm; path = src/MEL/Entrypoint.mm; sourceTree = "<group>"; };
470B563F2E898C34001040D0 /* ApplicationEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplicationEvent.h; sourceTree = "<group>"; };
470B56402E898C34001040D0 /* Event.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Event.h; sourceTree = "<group>"; };
470B56412E898C34001040D0 /* KeyEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeyEvent.h; sourceTree = "<group>"; };
470B56422E898C34001040D0 /* MouseEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MouseEvent.h; sourceTree = "<group>"; };
470B56432E898D43001040D0 /* Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = "<group>"; };
47FF21F42E8A056A004D6F5D /* Window.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Window.h; sourceTree = "<group>"; };
47FF21F52E8A056A004D6F5D /* Window.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Window.mm; sourceTree = "<group>"; };
47FF21F72E8A07BE004D6F5D /* WindowManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WindowManager.h; sourceTree = "<group>"; };
47FF21F82E8A07BE004D6F5D /* WindowManager.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowManager.mm; sourceTree = "<group>"; };
4ADA29160D9A89886ACF6756 /* MetalRenderer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = MetalRenderer.mm; path = src/MEL/Renderer/MetalRenderer.mm; sourceTree = "<group>"; };
6038CC64F5AF8B96644BE2A4 /* Application.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = Application.mm; path = src/MEL/Application.mm; sourceTree = "<group>"; };
6188BCBA2816B42C9618DAFA /* AppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = src/MEL/Renderer/AppDelegate.mm; sourceTree = "<group>"; };
74A9A874B8BD79A6AC8EFEB4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
7B436A80AD3CB532271BF0C0 /* Application.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Application.h; path = src/MEL/Application.h; sourceTree = "<group>"; };
8B91C4E06FD8CD12F3C5FB20 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
8D6BC6AA50D7885C8F7B2CEA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
A0271576359DD4A8A43A2BB6 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
ABD76E03D41226B5BBADB443 /* Log.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = Log.mm; path = src/MEL/Log/Log.mm; sourceTree = "<group>"; };
C635BED61D9B31C8CFA94D16 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = src/MEL/Renderer/AppDelegate.h; sourceTree = "<group>"; };
CC2A80804084C572BE684EC0 /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = ViewController.mm; path = src/MEL/Renderer/ViewController.mm; sourceTree = "<group>"; };
DE5E49728047E564776EF7B2 /* MetalRenderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MetalRenderer.h; path = src/MEL/Renderer/MetalRenderer.h; sourceTree = "<group>"; };
EA5C1300C9792D32A5828940 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
100082CB27131DFD172F190B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C39B3D3E56290730BF01AB7E /* Metal.framework in Frameworks */,
F8E8DBA28B76A594F44F49E2 /* Cocoa.framework in Frameworks */,
9130093853F069AAB1254778 /* QuartzCore.framework in Frameworks */,
1817955824A247CA9F871398 /* CoreFoundation.framework in Frameworks */,
95EFFE0C89EF477E0EDA5C4C /* CoreGraphics.framework in Frameworks */,
4B007C2E118E73A07F909A6E /* MetalKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
15A91B70B9FBB922CC3401B0 /* Log */ = {
isa = PBXGroup;
children = (
ABD76E03D41226B5BBADB443 /* Log.mm */,
333B5CED59618C9FC068832D /* Log.h */,
);
name = Log;
sourceTree = "<group>";
};
2C8FAEDB7CA3438DFF21751B /* MEL */ = {
isa = PBXGroup;
children = (
47FF21F32E8A0556004D6F5D /* Window */,
470B56392E8988BF001040D0 /* Entrypoint.mm */,
7B436A80AD3CB532271BF0C0 /* Application.h */,
6038CC64F5AF8B96644BE2A4 /* Application.mm */,
15A91B70B9FBB922CC3401B0 /* Log */,
B69F209AFF1004CC43AED6DA /* Renderer */,
470B563D2E898A81001040D0 /* Events */,
470B56432E898D43001040D0 /* Core.h */,
);
name = MEL;
sourceTree = "<group>";
};
470B56352E897CFD001040D0 /* Sandbox */ = {
isa = PBXGroup;
children = (
470B56362E897D33001040D0 /* Sandbox.mm */,
);
name = Sandbox;
path = src/Sandbox;
sourceTree = "<group>";
};
470B563D2E898A81001040D0 /* Events */ = {
isa = PBXGroup;
children = (
470B563F2E898C34001040D0 /* ApplicationEvent.h */,
470B56402E898C34001040D0 /* Event.h */,
470B56412E898C34001040D0 /* KeyEvent.h */,
470B56422E898C34001040D0 /* MouseEvent.h */,
);
name = Events;
path = src/MEL/Events;
sourceTree = "<group>";
};
47FF21F32E8A0556004D6F5D /* Window */ = {
isa = PBXGroup;
children = (
47FF21F42E8A056A004D6F5D /* Window.h */,
47FF21F52E8A056A004D6F5D /* Window.mm */,
47FF21F72E8A07BE004D6F5D /* WindowManager.h */,
47FF21F82E8A07BE004D6F5D /* WindowManager.mm */,
);
name = Window;
path = src/MEL/Window;
sourceTree = "<group>";
};
5775D4184366DFCA959E7A58 /* src */ = {
isa = PBXGroup;
children = (
470B56352E897CFD001040D0 /* Sandbox */,
470B56382E8986D5001040D0 /* MEL.h */,
2C8FAEDB7CA3438DFF21751B /* MEL */,
0BCE199D22E0B4CF12FCAFDD /* melpch.h */,
0EB1E78134D817339BDF0DC1 /* melpch.mm */,
);
name = src;
sourceTree = "<group>";
};
A6C936B49B3FADE6EA134CF4 /* Products */ = {
isa = PBXGroup;
children = (
38BBC2DB812CA70DC5CB791B /* MetalLearning.app */,
);
name = Products;
sourceTree = "<group>";
};
B69F209AFF1004CC43AED6DA /* Renderer */ = {
isa = PBXGroup;
children = (
C635BED61D9B31C8CFA94D16 /* AppDelegate.h */,
6188BCBA2816B42C9618DAFA /* AppDelegate.mm */,
DE5E49728047E564776EF7B2 /* MetalRenderer.h */,
4ADA29160D9A89886ACF6756 /* MetalRenderer.mm */,
13E796BCD6A7F72E33DCD4FC /* ViewController.h */,
CC2A80804084C572BE684EC0 /* ViewController.mm */,
);
name = Renderer;
sourceTree = "<group>";
};
BBF76781A7E87333FA200DC1 /* Frameworks */ = {
isa = PBXGroup;
children = (
0EF28886D25E4A381101EEC6 /* Metal.framework */,
8D6BC6AA50D7885C8F7B2CEA /* Cocoa.framework */,
8B91C4E06FD8CD12F3C5FB20 /* QuartzCore.framework */,
EA5C1300C9792D32A5828940 /* CoreFoundation.framework */,
74A9A874B8BD79A6AC8EFEB4 /* CoreGraphics.framework */,
A0271576359DD4A8A43A2BB6 /* MetalKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
E0ED8EA319A85515A93F8CE3 /* MetalLearning */ = {
isa = PBXGroup;
children = (
EFA4B5E69292DC9821B8BC26 /* ShaderSrc */,
5775D4184366DFCA959E7A58 /* src */,
BBF76781A7E87333FA200DC1 /* Frameworks */,
A6C936B49B3FADE6EA134CF4 /* Products */,
);
name = MetalLearning;
sourceTree = "<group>";
};
EFA4B5E69292DC9821B8BC26 /* ShaderSrc */ = {
isa = PBXGroup;
children = (
0EC3D68640BD2138BA9C5CC6 /* Shader.metal */,
);
name = ShaderSrc;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
13592B61FE455153462B19A1 /* MetalLearning */ = {
isa = PBXNativeTarget;
buildConfigurationList = FE3BCB2A154E665C056A616A /* Build configuration list for PBXNativeTarget "MetalLearning" */;
buildPhases = (
7FE8036B96FA9E9D871699AB /* Resources */,
E9951CC200A7B7F4F0C3B302 /* Sources */,
100082CB27131DFD172F190B /* Frameworks */,
E7F7B1F70E1DE1A97524D837 /* Embed Libraries */,
);
buildRules = (
);
dependencies = (
);
name = MetalLearning;
productInstallPath = "$(HOME)/Applications";
productName = MetalLearning;
productReference = 38BBC2DB812CA70DC5CB791B /* MetalLearning.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1640;
};
buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MetalLearning" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 1;
knownRegions = (
en,
Base,
);
mainGroup = E0ED8EA319A85515A93F8CE3 /* MetalLearning */;
projectDirPath = "";
projectRoot = "";
targets = (
13592B61FE455153462B19A1 /* MetalLearning */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
7FE8036B96FA9E9D871699AB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E7B2A65E3F181950F126349E /* Shader.metal in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
E9951CC200A7B7F4F0C3B302 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CE38F4BC94C6EC2E02C912FC /* Application.mm in Sources */,
47FF21F62E8A056A004D6F5D /* Window.mm in Sources */,
47FF21F92E8A07BE004D6F5D /* WindowManager.mm in Sources */,
470B563A2E8988BF001040D0 /* Entrypoint.mm in Sources */,
030AAB3B742D4C2D29F3F97B /* Log.mm in Sources */,
D73895124B210CC46D6EBB52 /* AppDelegate.mm in Sources */,
470B56372E897D33001040D0 /* Sandbox.mm in Sources */,
EC4D1F2E8A2E1FE061AC656E /* MetalRenderer.mm in Sources */,
755C09380F7FFE6ABFA5DF78 /* ViewController.mm in Sources */,
B24E4279E3323A6BF64A70B9 /* melpch.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
61E5269204D34D4493F92CD2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
MEL_PLATFORM_MAC,
MEL_DEBUG,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(SRCROOT)/vendor/spdlog/include";
OBJROOT = "../bin-int/Debug-macosx-x86_64/MetalLearning";
ONLY_ACTIVE_ARCH = YES;
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
SYMROOT = "../bin/Debug-macosx-x86_64/MetalLearning";
USER_HEADER_SEARCH_PATHS = (
../bin,
.,
"../bin-int",
../.git,
../MEL.xcworkspace,
"../bin/Debug-macosx-x86_64",
"../bin/Debug-macosx-x86_64/MetalLearning",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app/Contents",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app/Contents/_CodeSignature",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app/Contents/MacOS",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app/Contents/Resources",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents/Resources",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents/Resources/Relocations",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents/Resources/DWARF",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents/Resources/Relocations/aarch64",
vendor,
src,
vendor/spdlog,
vendor/spdlog/bench,
vendor/spdlog/cmake,
vendor/spdlog/example,
vendor/spdlog/include,
vendor/spdlog/tests,
vendor/spdlog/logos,
vendor/spdlog/scripts,
vendor/spdlog/.github,
vendor/spdlog/src,
vendor/spdlog/include/spdlog,
vendor/spdlog/include/spdlog/fmt,
vendor/spdlog/include/spdlog/sinks,
vendor/spdlog/include/spdlog/details,
vendor/spdlog/include/spdlog/cfg,
vendor/spdlog/include/spdlog/fmt/bundled,
vendor/spdlog/.github/workflows,
src/Sandbox,
src/MEL,
src/MEL/Renderer,
src/MEL/Log,
"../bin-int/Debug-macosx-x86_64",
"../bin-int/Debug-macosx-x86_64/MetalLearning",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData",
"../bin-int/Debug-macosx-x86_64/MetalLearning/EagerLinkingTBDs",
"../bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build",
"../bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning-e033b179dceb315dcd5ecd602612986a-VFS",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/d85599197a3a4aca7ac6e87f545c7a9b.xcbuilddata",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/fb18ae1ea551295376d9abe4ea3d8d41.xcbuilddata",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/d141e9892080c178f4f5fbaba7b758b1.xcbuilddata",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/81650ab4220cca3995c175bed5cd3d62.xcbuilddata",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/d85599197a3a4aca7ac6e87f545c7a9b.xcbuilddata/attachments",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/fb18ae1ea551295376d9abe4ea3d8d41.xcbuilddata/attachments",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/d141e9892080c178f4f5fbaba7b758b1.xcbuilddata/attachments",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/81650ab4220cca3995c175bed5cd3d62.xcbuilddata/attachments",
"../bin-int/Debug-macosx-x86_64/MetalLearning/EagerLinkingTBDs/Debug",
"../bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal",
"../bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64",
../.git/objects,
../.git/info,
../.git/logs,
../.git/hooks,
../.git/refs,
../.git/modules,
../.git/objects/95,
../.git/objects/59,
../.git/objects/0c,
../.git/objects/57,
../.git/objects/6f,
../.git/objects/9b,
../.git/objects/9e,
../.git/objects/04,
../.git/objects/32,
../.git/objects/35,
../.git/objects/56,
../.git/objects/67,
../.git/objects/0b,
../.git/objects/b5,
../.git/objects/d9,
../.git/objects/d0,
../.git/objects/be,
../.git/objects/b3,
../.git/objects/a2,
../.git/objects/eb,
../.git/objects/c9,
../.git/objects/fd,
../.git/objects/f2,
../.git/objects/pack,
../.git/objects/45,
../.git/objects/73,
../.git/objects/7e,
../.git/objects/75,
../.git/objects/43,
../.git/objects/info,
../.git/objects/91,
../.git/objects/62,
../.git/objects/98,
../.git/objects/37,
../.git/objects/6d,
../.git/objects/0f,
../.git/objects/0a,
../.git/objects/a8,
../.git/objects/ea,
../.git/objects/cc,
../.git/objects/ff,
../.git/objects/e0,
../.git/objects/46,
../.git/objects/83,
../.git/objects/49,
../.git/objects/2b,
../.git/objects/7f,
../.git/objects/14,
../.git/objects/22,
../.git/logs/refs,
../.git/logs/refs/heads,
../.git/refs/heads,
../.git/refs/tags,
../.git/modules/MetalLearning,
../.git/modules/MetalLearning/src,
../.git/modules/MetalLearning/src/vendor,
../.git/modules/MetalLearning/src/vendor/objects,
../.git/modules/MetalLearning/src/vendor/info,
../.git/modules/MetalLearning/src/vendor/logs,
../.git/modules/MetalLearning/src/vendor/hooks,
../.git/modules/MetalLearning/src/vendor/refs,
../.git/modules/MetalLearning/src/vendor/objects/pack,
../.git/modules/MetalLearning/src/vendor/objects/info,
../.git/modules/MetalLearning/src/vendor/logs/refs,
../.git/modules/MetalLearning/src/vendor/logs/refs/heads,
../.git/modules/MetalLearning/src/vendor/logs/refs/remotes,
../.git/modules/MetalLearning/src/vendor/logs/refs/remotes/origin,
../.git/modules/MetalLearning/src/vendor/refs/heads,
../.git/modules/MetalLearning/src/vendor/refs/tags,
../.git/modules/MetalLearning/src/vendor/refs/remotes,
../.git/modules/MetalLearning/src/vendor/refs/remotes/origin,
../MEL.xcworkspace/xcshareddata,
../MEL.xcworkspace/xcshareddata/swiftpm,
../MEL.xcworkspace/xcshareddata/swiftpm/configuration,
ShaderSrc,
../MEL/vendor/spdlog/include,
);
};
name = Debug;
};
6430ED4C7B43887E6B5F838C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
DEAD_CODE_STRIPPING = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES;
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
MEL_PLATFORM_MAC,
MEL_RELEASE,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(SRCROOT)/vendor/spdlog/include";
MACOSX_DEPLOYMENT_TARGET = 10.15;
OBJROOT = "../bin-int/Release-macosx-x86_64/MetalLearning";
ONLY_ACTIVE_ARCH = NO;
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
SYMROOT = "../bin/Release-macosx-x86_64/MetalLearning";
USER_HEADER_SEARCH_PATHS = (
../bin,
.,
"../bin-int",
../.git,
../MEL.xcworkspace,
"../bin/Debug-macosx-x86_64",
"../bin/Debug-macosx-x86_64/MetalLearning",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app/Contents",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app/Contents/_CodeSignature",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app/Contents/MacOS",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app/Contents/Resources",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents/Resources",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents/Resources/Relocations",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents/Resources/DWARF",
"../bin/Debug-macosx-x86_64/MetalLearning/MetalLearning.app.dSYM/Contents/Resources/Relocations/aarch64",
vendor,
src,
vendor/spdlog,
vendor/spdlog/bench,
vendor/spdlog/cmake,
vendor/spdlog/example,
vendor/spdlog/include,
vendor/spdlog/tests,
vendor/spdlog/logos,
vendor/spdlog/scripts,
vendor/spdlog/.github,
vendor/spdlog/src,
vendor/spdlog/include/spdlog,
vendor/spdlog/include/spdlog/fmt,
vendor/spdlog/include/spdlog/sinks,
vendor/spdlog/include/spdlog/details,
vendor/spdlog/include/spdlog/cfg,
vendor/spdlog/include/spdlog/fmt/bundled,
vendor/spdlog/.github/workflows,
src/Sandbox,
src/MEL,
src/MEL/Renderer,
src/MEL/Log,
"../bin-int/Debug-macosx-x86_64",
"../bin-int/Debug-macosx-x86_64/MetalLearning",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData",
"../bin-int/Debug-macosx-x86_64/MetalLearning/EagerLinkingTBDs",
"../bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build",
"../bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning-e033b179dceb315dcd5ecd602612986a-VFS",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/d85599197a3a4aca7ac6e87f545c7a9b.xcbuilddata",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/fb18ae1ea551295376d9abe4ea3d8d41.xcbuilddata",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/d141e9892080c178f4f5fbaba7b758b1.xcbuilddata",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/81650ab4220cca3995c175bed5cd3d62.xcbuilddata",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/d85599197a3a4aca7ac6e87f545c7a9b.xcbuilddata/attachments",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/fb18ae1ea551295376d9abe4ea3d8d41.xcbuilddata/attachments",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/d141e9892080c178f4f5fbaba7b758b1.xcbuilddata/attachments",
"../bin-int/Debug-macosx-x86_64/MetalLearning/XCBuildData/81650ab4220cca3995c175bed5cd3d62.xcbuilddata/attachments",
"../bin-int/Debug-macosx-x86_64/MetalLearning/EagerLinkingTBDs/Debug",
"../bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal",
"../bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64",
../.git/objects,
../.git/info,
../.git/logs,
../.git/hooks,
../.git/refs,
../.git/modules,
../.git/objects/95,
../.git/objects/59,
../.git/objects/0c,
../.git/objects/57,
../.git/objects/6f,
../.git/objects/9b,
../.git/objects/9e,
../.git/objects/04,
../.git/objects/32,
../.git/objects/35,
../.git/objects/56,
../.git/objects/67,
../.git/objects/0b,
../.git/objects/b5,
../.git/objects/d9,
../.git/objects/d0,
../.git/objects/be,
../.git/objects/b3,
../.git/objects/a2,
../.git/objects/eb,
../.git/objects/c9,
../.git/objects/fd,
../.git/objects/f2,
../.git/objects/pack,
../.git/objects/45,
../.git/objects/73,
../.git/objects/7e,
../.git/objects/75,
../.git/objects/43,
../.git/objects/info,
../.git/objects/91,
../.git/objects/62,
../.git/objects/98,
../.git/objects/37,
../.git/objects/6d,
../.git/objects/0f,
../.git/objects/0a,
../.git/objects/a8,
../.git/objects/ea,
../.git/objects/cc,
../.git/objects/ff,
../.git/objects/e0,
../.git/objects/46,
../.git/objects/83,
../.git/objects/49,
../.git/objects/2b,
../.git/objects/7f,
../.git/objects/14,
../.git/objects/22,
../.git/logs/refs,
../.git/logs/refs/heads,
../.git/refs/heads,
../.git/refs/tags,
../.git/modules/MetalLearning,
../.git/modules/MetalLearning/src,
../.git/modules/MetalLearning/src/vendor,
../.git/modules/MetalLearning/src/vendor/objects,
../.git/modules/MetalLearning/src/vendor/info,
../.git/modules/MetalLearning/src/vendor/logs,
../.git/modules/MetalLearning/src/vendor/hooks,
../.git/modules/MetalLearning/src/vendor/refs,
../.git/modules/MetalLearning/src/vendor/objects/pack,
../.git/modules/MetalLearning/src/vendor/objects/info,
../.git/modules/MetalLearning/src/vendor/logs/refs,
../.git/modules/MetalLearning/src/vendor/logs/refs/heads,
../.git/modules/MetalLearning/src/vendor/logs/refs/remotes,
../.git/modules/MetalLearning/src/vendor/logs/refs/remotes/origin,
../.git/modules/MetalLearning/src/vendor/refs/heads,
../.git/modules/MetalLearning/src/vendor/refs/tags,
../.git/modules/MetalLearning/src/vendor/refs/remotes,
../.git/modules/MetalLearning/src/vendor/refs/remotes/origin,
../MEL.xcworkspace/xcshareddata,
../MEL.xcworkspace/xcshareddata/swiftpm,
../MEL.xcworkspace/xcshareddata/swiftpm/configuration,
ShaderSrc,
../MEL/vendor/spdlog/include,
);
};
name = Release;
};
C71A85EAF913D09C72F30C2A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CONFIGURATION_BUILD_DIR = "../bin/Release-macosx-x86_64/MetalLearning";
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES;
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(SRCROOT)/vendor/spdlog/include";
INSTALL_PATH = "\"$(HOME)/Applications\"";
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_NAME = MetalLearning;
};
name = Release;
};
D89FEEF02602E5229C21E530 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_WEAK = YES;
CONFIGURATION_BUILD_DIR = "../bin/Debug-macosx-x86_64/MetalLearning";
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "\"$(HOME)/Applications\"";
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_NAME = MetalLearning;
};
name = Debug;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MetalLearning" */ = {
isa = XCConfigurationList;
buildConfigurations = (
61E5269204D34D4493F92CD2 /* Debug */,
6430ED4C7B43887E6B5F838C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
FE3BCB2A154E665C056A616A /* Build configuration list for PBXNativeTarget "MetalLearning" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D89FEEF02602E5229C21E530 /* Debug */,
C71A85EAF913D09C72F30C2A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>MetalLearning.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

@ -1,17 +0,0 @@
//
// MetalLearningApp.swift
// MetalLearning
//
// Created by 殿 on 9/25/25.
//
import SwiftUI
@main
struct MetalLearningApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}

@ -0,0 +1,31 @@
#include <metal_stdlib>
using namespace metal;
struct VertexOut{
float4 position [[position]];
float4 color;
};
vertex VertexOut vertexShader(uint vertexID [[vertex_id]]){
float2 positions[3]={
float2(0.0,0.5),
float2(-0.5,-0.5),
float2(0.5,-0.5)
};
float4 colors[3]={
float4(1.0,0.0,0.0,1.0),
float4(0.0,1.0,0.0,1.0),
float4(0.0,0.0,1.0,1.0)
};
VertexOut out;
out.position=float4(positions[vertexID],0.0,1.0);
out.color=colors[vertexID];
return out;
}
fragment float4 fragmentShader(VertexOut in [[stage_in]]){
return in.color;
}

@ -0,0 +1,19 @@
#pragma once
#include "Events/Event.h"
#include "Events/KeyEvent.h"
#include "Events/MouseEvent.h"
#include "Events/ApplicationEvent.h"
namespace MEL {
class Application{
public:
Application();
virtual ~Application();
void OnEvent(MEL::Event& e);
void Run();
private:
bool OnWindowClose(WindowCloseEvent& event);
bool m_Running;
};
Application* CreateApplication();
}

@ -0,0 +1,38 @@
#import "melpch.h"
#import "Renderer/AppDelegate.h"
#include "Log.h"
#include "Application.h"
#include "Events/ApplicationEvent.h"
namespace MEL{
Application::Application(){
}
Application::~Application(){
}
void Application::OnEvent(MEL::Event& e){
}
void Application::Run() {
/*
NSApplication* application=[NSApplication sharedApplication];
AppDelegate* appDelegate=[[AppDelegate alloc] init];
[application setDelegate:appDelegate];
[application run];
*/
while (m_Running){
}
}
bool Application::OnWindowClose(WindowCloseEvent& event){
m_Running=false;
return true;
}
}

@ -0,0 +1,17 @@
#import "melpch.h"
#import "AppDelegate.h"
#include "Application.h"
#include "Log.h"
MEL::Application* MEL::CreateApplication();
int main(int argc,const char* argv[]){
MEL::Log::Init();
MEL_CORE_INFO("Testing");
auto app =MEL::CreateApplication();
app->Run();
delete app;
return 0;
}

@ -0,0 +1,67 @@
#pragma once
#include "Event.h"
namespace MEL {
class WindowResizeEvent : public Event
{
public:
WindowResizeEvent(unsigned int width, unsigned int height)
: m_Width(width), m_Height(height) {}
inline unsigned int GetWidth() const { return m_Width; }
inline unsigned int GetHeight() const { return m_Height; }
std::string ToString() const override
{
std::stringstream ss;
ss << "WindowResizeEvent:" << m_Width << "," << m_Height;
return ss.str();
}
EVENT_CLASS_TYPE(WindowResize)
EVENT_CLASS_CATEGORY(EventCategoryApplication)
private:
unsigned int m_Width, m_Height;
};
class WindowCloseEvent : public Event
{
public:
WindowCloseEvent() {
}
EVENT_CLASS_TYPE(WindowClose)
EVENT_CLASS_CATEGORY(EventCategoryApplication)
};
class AppTickEvent : public Event
{
public:
AppTickEvent() {
}
EVENT_CLASS_TYPE(AppTick)
EVENT_CLASS_CATEGORY(EventCategoryApplication)
};
class AppUpdateEvent : public Event
{
public:
AppUpdateEvent() {
}
EVENT_CLASS_TYPE(AppUpdate)
EVENT_CLASS_CATEGORY(EventCategoryApplication)
};
class AppRenderEvent : public Event
{
public:
AppRenderEvent() {
}
EVENT_CLASS_TYPE(AppRender)
EVENT_CLASS_CATEGORY(EventCategoryApplication)
};
}

@ -0,0 +1,75 @@
#pragma once
#include"Core.h"
#include"melpch.h"
namespace MEL {
enum class EventType {
None = 0,
WindowClose, WindowResize, WindowFocus, WindowLostFocus, WindowMoved,
AppTick, AppUpdate, AppRender,
KeyPressed, KeyReleased, KeyTyped,
MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseScrolled
};
enum EventCategory
{
None = 0,
EventCategoryApplication = BIT(0),
EventCategoryInput = BIT(1),
EventCategoryKeyboard = BIT(2),
EventCategoryMouse = BIT(3),
EventCategoryMouseButton = BIT(4)
};
#define EVENT_CLASS_TYPE(type) static EventType GetStaticType() { return EventType::type; }\
virtual EventType GetEventType() const override { return GetStaticType(); }\
virtual const char* GetName() const override { return #type; }
#define EVENT_CLASS_CATEGORY(category) virtual int GetCategoryFlags() const override { return category; }
class Event
{
friend class EventDispatcher;
public:
virtual EventType GetEventType() const = 0;
virtual const char* GetName() const = 0;
virtual int GetCategoryFlags() const = 0;
virtual std::string ToString() const { return GetName(); }
virtual ~Event() = default;
inline bool IsInCategory(EventCategory category) {
return GetCategoryFlags() & category;
}
//protected:
bool m_Handled = false;
};
class EventDispatcher
{
template<typename T>
using EventFn = std::function<bool(T&)>;
public:
EventDispatcher(Event& event)
:m_Event(event)
{
}
template<typename T,typename F>
bool Dispatch(EventFn<T> func)
{
if (m_Event.GetEventType() == T::GetStaticType())
{
m_Event.m_Handled = func(*(T*)&m_Event);
return true;
}
return false;
}
private:
Event& m_Event;
};
inline std::ostream& operator<<(std::ostream& os, const Event& e)
{
os << e.ToString();
return os;
}
}

@ -0,0 +1,68 @@
#pragma once
#include "Event.h"
namespace MEL {
class KeyEvent :public Event
{
public:
inline int GetKeyCode() const { return m_KeyCode; }
EVENT_CLASS_CATEGORY(EventCategoryKeyboard | EventCategoryInput)
protected:
KeyEvent(int keycode)
:m_KeyCode(keycode) {}
int m_KeyCode;
};
class KeyPressedEvent : public KeyEvent
{
public:
KeyPressedEvent(int keycode,int RepeatCount)
:KeyEvent(keycode),m_RepeatCount(RepeatCount){ }
inline int GetRepeatCount() const { return m_RepeatCount; }
std::string ToString() const override
{
std::stringstream ss;
ss << "KeyPressedEvent: " << m_KeyCode << "(" << m_RepeatCount << "repeats)";
return ss.str();
}
EVENT_CLASS_TYPE(KeyPressed)
private:
int m_RepeatCount;
};
class KeyReleasedEvent :public KeyEvent
{
public:
KeyReleasedEvent(int keycode)
:KeyEvent(keycode){ }
std::string ToString() const override
{
std::stringstream ss;
ss << "KeyReleasedEvent: " << m_KeyCode;
return ss.str();
}
EVENT_CLASS_TYPE(KeyReleased)
};
class KeyTypedEvent :public KeyEvent
{
public:
KeyTypedEvent(int keycode)
:KeyEvent(keycode){ }
std::string ToString() const override
{
std::stringstream ss;
ss << "KeyTypedEvent: " << m_KeyCode;
return ss.str();
}
EVENT_CLASS_TYPE(KeyTyped)
};
}

@ -0,0 +1,97 @@
#pragma once
#include "Event.h"
namespace MEL {
class MouseMovedEvent : public Event
{
public:
MouseMovedEvent(float x,float y)
:m_MouseX(x),m_MouseY(y){ }
inline float GetX() const { return m_MouseX; }
inline float GetY() const { return m_MouseY; }
std::string ToString() const override
{
std::stringstream ss;
ss << "MouseMovedEvent: " << m_MouseX << "," << m_MouseY;
return ss.str();
}
EVENT_CLASS_TYPE(MouseMoved)
EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)
private:
float m_MouseX, m_MouseY;
};
class MouseScrolledEvent : public Event
{
public:
MouseScrolledEvent(float xOffset,float yOffset)
:m_XOffset(xOffset),m_YOffset(yOffset){ }
inline float GetXOffset() const { return m_XOffset; }
inline float GetYOffset() const { return m_YOffset; }
std::string ToString() const override
{
std::stringstream ss;
ss << "MouseScrolledEvent: " << GetXOffset() << ", " << GetYOffset();
return ss.str();
}
EVENT_CLASS_TYPE(MouseScrolled)
EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)
private:
float m_XOffset, m_YOffset;
};
class MouseButtonEvent : public Event
{
public:
inline int GetMouseButton() const { return m_Button; }
EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)
protected:
MouseButtonEvent(int button)
:m_Button(button) {
}
int m_Button;
};
class MouseButtonPressedEvent : public MouseButtonEvent
{
public:
MouseButtonPressedEvent(int button)
:MouseButtonEvent(button) {
}
std::string ToString() const override
{
std::stringstream ss;
ss << "MouseButtonPressedEvent: " << m_Button;
return ss.str();
}
EVENT_CLASS_TYPE(MouseButtonPressed)
};
class MouseButtonReleasedEvent :public MouseButtonEvent
{
public:
MouseButtonReleasedEvent(int button)
:MouseButtonEvent(button) {
}
std::string ToString() const override
{
std::stringstream ss;
ss << "MouseButtonReleasedEvent: " << m_Button;
return ss.str();
}
EVENT_CLASS_TYPE(MouseButtonReleased)
};
}

@ -0,0 +1,34 @@
#pragma once
//I'm using Hazel's log system
#include <memory>
#include "Core.h"
#include "spdlog/spdlog.h"
#include "spdlog/sinks/stdout_color_sinks.h"
//if occurr "use quotes" error in spdlog source file,add "include" dir to "header search path" to solve it
namespace MEL {
class Log{
public:
static void Init();
inline static std::shared_ptr<spdlog::logger>& GetCoreLogger(){return s_CoreLogger;}
inline static std::shared_ptr<spdlog::logger>& GetClientLogger(){return s_ClientLogger;}
private:
static std::shared_ptr<spdlog::logger> s_CoreLogger;
static std::shared_ptr<spdlog::logger> s_ClientLogger;
};
}
//Core log macros
#define MEL_CORE_TRACE(...) ::MEL::Log::GetCoreLogger()->trace(__VA_ARGS__)
#define MEL_CORE_INFO(...) ::MEL::Log::GetCoreLogger()->info(__VA_ARGS__)
#define MEL_CORE_WARN(...) ::MEL::Log::GetCoreLogger()->warn(__VA_ARGS__)
#define MEL_CORE_ERROR(...) ::MEL::Log::GetCoreLogger()->error(__VA_ARGS__)
//Client log macros
#define MEL_TRACE(...) ::MEL::Log::GetClientLogger()->trace(__VA_ARGS__)
#define MEL_INFO(...) ::MEL::Log::GetClientLogger()->trace(__VA_ARGS__)
#define MEL_WARN(...) ::MEL::Log::GetClientLogger()->trace(__VA_ARGS__)
#define MEL_ERROR(...) ::MEL::Log::GetClientLogger()->trace(__VA_ARGS__)

@ -0,0 +1,15 @@
#include "Log.h"
namespace MEL {
std::shared_ptr<spdlog::logger> Log::s_CoreLogger;
std::shared_ptr<spdlog::logger> Log::s_ClientLogger;
void Log::Init(){
spdlog::set_pattern("%^[%T] %n: %v%$");
s_CoreLogger=spdlog::stdout_color_mt("MEL");
s_CoreLogger->set_level(spdlog::level::trace);
s_ClientLogger=spdlog::stdout_color_mt("APP");
s_ClientLogger->set_level(spdlog::level::trace);
}
}

@ -0,0 +1,7 @@
#import "melpch.h"
@interface AppDelegate : NSObject<NSApplicationDelegate>
@property(nonatomic,strong)NSWindow* window;
@end

@ -0,0 +1,18 @@
#import "AppDelegate.h"
#import "Window/WindowManager.h"
@implementation AppDelegate
-(void)applicationDidFinishLaunching:(NSNotification *)notification{
NSRect frame=NSMakeRect(0, 0, 1280, 720);
WindowManager* windowManager=[[WindowManager alloc] initWithFrame:frame title:@"Metal Learning - first triangle"];
[windowManager show];
}
-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender{
return YES;
}
@end

@ -0,0 +1,8 @@
#import "melpch.h"
@interface MetalRenderer:NSObject<MTKViewDelegate>
-(nonnull instancetype)initWithMetalKitView:
(nonnull MTKView*)mtkView;
@end

@ -0,0 +1,94 @@
#import "MetalRenderer.h"
@implementation MetalRenderer{
id<MTLDevice> _device;
id<MTLRenderPipelineState> _pipelineState;
id<MTLCommandQueue> _commandQueue;
vector_uint2 _viewportSize;
}
-(nonnull instancetype)initWithMetalKitView:(MTKView *)mtkView{
self=[super init];
if(self){
_device=mtkView.device;
[self _setupPipeline];
_commandQueue=[_device newCommandQueue];
_viewportSize=(vector_uint2)
{
(uint32_t)mtkView.drawableSize.width,
(uint32_t)mtkView.drawableSize.height
};
}
return self;
}
-(void)_setupPipeline{
id<MTLLibrary> defaultLibrary=[_device newDefaultLibrary];
NSError* error=nil;
if(!defaultLibrary){
NSBundle* mainBundle=[NSBundle mainBundle];
NSURL* metalLibraryURL=[mainBundle URLForResource:@"default" withExtension:@"metallib"];
defaultLibrary=[_device newLibraryWithURL:metalLibraryURL error:&error];
}
if(!defaultLibrary){
NSLog(@"Failed to load Metal library: %@",error);
}
error=nil;
id<MTLFunction> vertexFunction=[defaultLibrary newFunctionWithName:@"vertexShader"];
id<MTLFunction> fragmentFunction=[defaultLibrary newFunctionWithName:@"fragmentShader"];
MTLRenderPipelineDescriptor* pipeLineDescriptor=[[MTLRenderPipelineDescriptor alloc] init];
pipeLineDescriptor.label=@"Simple Pipeline";
pipeLineDescriptor.vertexFunction=vertexFunction;
pipeLineDescriptor.fragmentFunction=fragmentFunction;
pipeLineDescriptor.colorAttachments[0].pixelFormat=MTLPixelFormatBGRA8Unorm;
_pipelineState=[_device newRenderPipelineStateWithDescriptor:pipeLineDescriptor
error:&error];
if(!_pipelineState){
NSLog(@"create pipeline state failed:%@",error);
}
}
#pragma mark - MTKViewDelegate
-(void)drawInMTKView:(MTKView *)view{
id<MTLCommandBuffer> commandBuffer=[_commandQueue commandBuffer];
commandBuffer.label=@"MyCommandBuffer";
MTLRenderPassDescriptor* renderPassDescriptor=view.currentRenderPassDescriptor;
if(renderPassDescriptor==nil){
[commandBuffer commit];
return;
}
//renderPassDescriptor.colorAttachments[0].clearColor=MTLClearColorMake(0.1, 0.1, 0.1, 1.0);
id<MTLRenderCommandEncoder> renderEncoder=[commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
renderEncoder.label=@"MyRenderEncoder";
[renderEncoder setRenderPipelineState:_pipelineState];
[renderEncoder drawPrimitives:MTLPrimitiveTypeTriangle
vertexStart:0
vertexCount:3];
[renderEncoder endEncoding];
[commandBuffer presentDrawable:view.currentDrawable];
[commandBuffer commit];
}
-(void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size{
_viewportSize.x=(uint32_t)size.width;
_viewportSize.y=(uint32_t)size.height;
}
@end

@ -0,0 +1,6 @@
#import "MetalRenderer.h"
#import "melpch.h"
@interface ViewController : NSViewController
@end

@ -0,0 +1,32 @@
#import "ViewController.h"
#import "MetalRenderer.h"
@interface ViewController()
@property (nonatomic,strong)MTKView* metalView;
@property (nonatomic,strong)MetalRenderer* renderer;
@end;
@implementation ViewController
-(void)viewDidLoad{
[super viewDidLoad];
self.metalView=[[MTKView alloc] initWithFrame:self.view.bounds];
self.metalView.device=MTLCreateSystemDefaultDevice();
self.metalView.clearColor=MTLClearColorMake(0.1, 0.1, 0.1, 1.0);
self.metalView.colorPixelFormat=MTLPixelFormatBGRA8Unorm;
[self.view addSubview:self.metalView];
self.renderer=[[MetalRenderer alloc] initWithMetalKitView:self.metalView];
self.metalView.delegate=self.renderer;
}
-(void)viewDidLayout{
[super viewDidLayout];
self.metalView.frame=self.view.bounds;
}
@end

@ -0,0 +1,62 @@
#pragma once
#import <Cocoa/Cocoa.h>
namespace MEL {
class Event;
}
typedef void (*EventCallback)(MEL::Event& event);
@interface Window :NSWindow<NSWindowDelegate>
@property (nonatomic,assign)EventCallback eventCallback;
-(instancetype)initWithFrame:
(NSRect)frame styleMask:(NSWindowStyleMask)styleMask title:(NSString*)title;
-(void)dispatchEvent:
(MEL::Event&)event;
@end
#include "melpch.h"
#include "MEL.h"
namespace MEL {
struct WindowProps{
std::string Title;
unsigned int Width;
unsigned int Height;
WindowProps(const std::string &title="MEL Engine",unsigned int width=1280,unsigned int height=720)
:Title(title),Width(width),Height(height){}
};
class Window{
public:
using EventCallbackFN=std::function<void(Event&)>;
Window(const WindowProps& props);
~Window();
void OnUpdate();
unsigned int GetWidth();
unsigned int GetHeight();
void SetEventCallback(const EventCallback& callback);
void SetSync(bool enable);
bool IsVSync()const;
static Window* Create(const WindowProps& props=WindowProps());
private:
virtual void Init(const WindowProps& props);
virtual void ShutDown();
private:
NSWindow* m_Window;
struct WindowData{
std::string Title;
unsigned int Width,Height;
bool VSync;
EventCallbackFN EventCallback;
};
WindowData m_Data;
};
}

@ -0,0 +1,123 @@
#import "Window.h"
#import "Events/KeyEvent.h"
#import "Events/MouseEvent.h"
#import "Events/ApplicationEvent.h"
@implementation Window
- (instancetype)initWithFrame:(NSRect)frame styleMask:(NSWindowStyleMask)styleMask title:(NSString *)title {
self=[super initWithContentRect:frame
styleMask:styleMask
backing:NSBackingStoreBuffered
defer:NO];
if(self){
[self center];
[self setTitle:title];
[self setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
[self setDelegate:self];
}
return self;
}
//Key Events
-(void)keyDown:(NSEvent *)event{
int action;
action=[event isARepeat]?1:0;
MEL::KeyPressedEvent keyPressedEvent((int)[event keyCode],action);
[self dispatchEvent:keyPressedEvent];
MEL::KeyTypedEvent keyTyped((int)[event keyCode]);
[self dispatchEvent:keyTyped];
}
-(void)keyUp:(NSEvent *)event{
MEL::KeyReleasedEvent keyReleasedEvent((int)[event keyCode]);
[self dispatchEvent:keyReleasedEvent];
}
//Mouse Events
-(void)mouseDown:(NSEvent *)event{
MEL::MouseButtonPressedEvent mousePressed(1);
[self dispatchEvent:mousePressed];
}
-(void)mouseUp:(NSEvent *)event{
MEL::MouseButtonReleasedEvent mouseReleased(0);
[self dispatchEvent:mouseReleased];
}
-(void)mouseMoved:(NSEvent *)event{
NSPoint location=[event locationInWindow];
MEL::MouseMovedEvent mouseMovedEvent(location.x,location.y);
[self dispatchEvent:mouseMovedEvent];
}
-(void)scrollWheel:(NSEvent *)event{
float deltaX=[event scrollingDeltaX];
float deltaY=[event scrollingDeltaY];
if([event hasPreciseScrollingDeltas]){
deltaX*=0.1f;
deltaY*=0.1f;
}
MEL::MouseScrolledEvent mouseScrolled(deltaX,deltaY);
[self dispatchEvent:mouseScrolled];
}
//Window Events
-(void)windowDidResize:(NSNotification *)notification{
NSRect frame=[self contentRectForFrameRect:[self frame]];
MEL::WindowResizeEvent windowResize(frame.size.width,frame.size.height);
[self dispatchEvent:windowResize];
}
-(void)windowWillClose:(NSNotification *)notification{
MEL::WindowCloseEvent windowClosed;
[self dispatchEvent:windowClosed];
}
-(void)dispatchEvent:(MEL::Event &)event{
if(self.eventCallback){
self.eventCallback(event);
}
}
@end
namespace MEL {
Window* Window::Create(const WindowProps& props){
return new Window(props);
}
Window::Window(const WindowProps& props){
Init(props);
}
Window::~Window(){
ShutDown();
}
void Window::Init(const WindowProps &props){
m_Data.Title=props.Title;
m_Data.Width=props.Width;
m_Data.Height=props.Height;
MEL_CORE_INFO("Create Window: {0},{1},{2}",m_Data.Title,m_Data.Width,m_Data.Height);
}
void Window::ShutDown(){
}
void Window::OnUpdate(){
}
void Window::SetSync(bool enable){
m_Data.VSync=enable;
}
bool Window::IsVSync()const{
return m_Data.VSync;
}
}

@ -0,0 +1,14 @@
#import <Cocoa/Cocoa.h>
@class ViewController;
@interface WindowManager:NSObject
@property (nonatomic,strong,readonly)NSWindow* window;
@property (nonatomic,strong,readonly)ViewController* viewController;
-(instancetype)initWithFrame:
(NSRect)frame title:(NSString*)title;
-(void)show;
@end

@ -0,0 +1,37 @@
#import "WindowManager.h"
#import "Window.h"
#import "ViewController.h"
@implementation WindowManager
- (instancetype)initWithFrame:(NSRect)frame title:(NSString *)title {
self=[super init];
if(self){
NSWindowStyleMask style=
NSWindowStyleMaskTitled |
NSWindowStyleMaskClosable |
NSWindowStyleMaskResizable |
NSWindowStyleMaskMiniaturizable;
_window=[[Window alloc] initWithFrame:frame styleMask:style title:title];
_viewController=[[ViewController alloc] init];
NSView* contentView=[[NSView alloc] initWithFrame:frame];
[contentView addSubview:_viewController.view];
_viewController.view.frame=contentView.bounds;
_viewController.view.autoresizingMask=NSViewWidthSizable|NSViewHeightSizable;
_window.contentView=contentView;
_window.contentViewController=_viewController;
}
return self;
}
- (void)show {
[_window makeKeyAndOrderFront:nil];
}
@end

@ -0,0 +1,16 @@
#include "MEL.h"
class Sandbox:public MEL::Application{
public:
Sandbox(){
}
~Sandbox(){
}
private:
};
MEL::Application* MEL::CreateApplication(){
return new Sandbox();
}

@ -0,0 +1,12 @@
//c things
#import <Cocoa/Cocoa.h>
#import <Metal/Metal.h>
#import <MetalKit/MetalKit.h>
//c++ things
#include <functional>
#include <sstream>
#include <string>

@ -0,0 +1,2 @@
#include "melpch.h"

@ -0,0 +1 @@
Subproject commit f1d748e5e3edfa4b1778edea003bac94781bc7b7

@ -1,16 +0,0 @@
//
// MetalLearningTests.swift
// MetalLearningTests
//
// Created by 殿 on 9/25/25.
//
import Testing
struct MetalLearningTests {
@Test func example() async throws {
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
}
}

@ -1,41 +0,0 @@
//
// MetalLearningUITests.swift
// MetalLearningUITests
//
// Created by 殿 on 9/25/25.
//
import XCTest
final class MetalLearningUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// In UI tests its important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
@MainActor
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
@MainActor
func testLaunchPerformance() throws {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}

@ -1,33 +0,0 @@
//
// MetalLearningUITestsLaunchTests.swift
// MetalLearningUITests
//
// Created by 殿 on 9/25/25.
//
import XCTest
final class MetalLearningUITestsLaunchTests: XCTestCase {
override class var runsForEachTargetApplicationUIConfiguration: Bool {
true
}
override func setUpWithError() throws {
continueAfterFailure = false
}
@MainActor
func testLaunch() throws {
let app = XCUIApplication()
app.launch()
// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app
let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = "Launch Screen"
attachment.lifetime = .keepAlways
add(attachment)
}
}

@ -0,0 +1,31 @@
#include <metal_stdlib>
using namespace metal;
struct VertexOut{
float4 position [[position]];
float4 color;
};
vertex VertexOut vertexShader(uint vertexID [[vertex_id]]){
float2 positions[3]={
float2(0.0,0.5),
float2(-0.5,0.5),
float2(0.5,-0.5)
};
float4 colors[3]={
float4(1.0,0.0,0.0,1.0),
float4(0.0,1.0,0.0,1.0),
float4(0.0,0.0,1.0,1.0)
};
VertexOut out;
out.position=float4(positions[vertexID],0.0,1.0);
out.color=colors[vertexID];
return out;
}
fragment float4 fragmentShader(VertexOut in [[stage_in]]){
return in.color;
}

@ -0,0 +1 @@
-target arm64-apple-macos15.5 '-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG' -fpascal-strings -O0 -DMEL_PLATFORM_MAC -DMEL_DEBUG '-DOBJC_OLD_DISPATCH_PROTOTYPES=1' -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk -g -fvisibility-inlines-hidden -iquote /Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-generated-files.hmap -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-own-target-headers.hmap -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-all-target-headers.hmap -iquote /Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-project-headers.hmap -iquote ../src -iquote ShaderSrc -iquote ../MEL/vendor/spdlog/include -I/Users/xudianhuan/Documents/dev/MetalLearning/bin/Debug-macosx-x86_64/MetalLearning/include -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources-normal/arm64 -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources/arm64 -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources -F/Users/xudianhuan/Documents/dev/MetalLearning/bin/Debug-macosx-x86_64/MetalLearning

@ -2,9 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>

@ -0,0 +1,58 @@
{
"buildCommand" : {
"command" : "prepareForIndexing",
"enableIndexBuildArena" : false,
"targets" : null
},
"configuredTargets" : [
{
"guid" : "e033b179dceb315dcd5ecd602612986a70d00e290cc9c947a0a6ad4a3666580f"
}
],
"containerPath" : "/Users/xudianhuan/Documents/dev/MetalLearning/MetalLearning/MetalLearning.xcodeproj",
"continueBuildingAfterErrors" : true,
"dependencyScope" : "workspace",
"enableIndexBuildArena" : false,
"hideShellScriptEnvironment" : false,
"parameters" : {
"action" : "build",
"activeArchitecture" : "arm64",
"activeRunDestination" : {
"disableOnlyActiveArch" : false,
"platform" : "macosx",
"sdk" : "macosx15.5",
"sdkVariant" : "macos",
"supportedArchitectures" : [
"arm64e",
"arm64",
"x86_64"
],
"targetArchitecture" : "arm64"
},
"arenaInfo" : {
"buildIntermediatesPath" : "",
"buildProductsPath" : "",
"derivedDataPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData",
"indexDataStoreFolderPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData/MetalLearning-baphacvpjexerkbycoknmdfbyuet/Index.noindex/DataStore",
"indexEnableDataStore" : true,
"indexPCHPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData/MetalLearning-baphacvpjexerkbycoknmdfbyuet/Index.noindex/PrecompiledHeaders",
"pchPath" : ""
},
"configurationName" : "Debug",
"overrides" : {
"synthesized" : {
"table" : {
"ENABLE_PREVIEWS" : "NO",
"ENABLE_XOJIT_PREVIEWS" : "YES",
"ONLY_ACTIVE_ARCH" : "YES"
}
}
}
},
"schemeCommand" : "launch",
"showNonLoggedProgress" : true,
"useDryRun" : false,
"useImplicitDependencies" : true,
"useLegacyBuildLocations" : false,
"useParallelTargets" : true
}

@ -0,0 +1,2 @@
Target dependency graph (1 target)
Target 'MetalLearning' in project 'MetalLearning' (no dependencies)

@ -0,0 +1,4 @@
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/AppDelegate.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/MetalRenderer.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/ViewController.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/main.o

@ -0,0 +1 @@
-target arm64-apple-macos15.5 '-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG' -fpascal-strings -O0 -DMEL_PLATFORM_MAC -DMEL_DEBUG '-DOBJC_OLD_DISPATCH_PROTOTYPES=1' -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk -g -fvisibility-inlines-hidden -iquote /Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-generated-files.hmap -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-own-target-headers.hmap -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-all-target-headers.hmap -iquote /Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-project-headers.hmap -iquote ../src -iquote ShaderSrc -iquote ../MEL/vendor/spdlog/include -I/Users/xudianhuan/Documents/dev/MetalLearning/bin/Debug-macosx-x86_64/MetalLearning/include -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources-normal/arm64 -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources/arm64 -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources -F/Users/xudianhuan/Documents/dev/MetalLearning/bin/Debug-macosx-x86_64/MetalLearning

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>

@ -0,0 +1,58 @@
{
"buildCommand" : {
"command" : "prepareForIndexing",
"enableIndexBuildArena" : false,
"targets" : null
},
"configuredTargets" : [
{
"guid" : "e033b179dceb315dcd5ecd602612986a70d00e290cc9c947a0a6ad4a3666580f"
}
],
"containerPath" : "/Users/xudianhuan/Documents/dev/MetalLearning/MetalLearning/MetalLearning.xcodeproj",
"continueBuildingAfterErrors" : true,
"dependencyScope" : "workspace",
"enableIndexBuildArena" : false,
"hideShellScriptEnvironment" : false,
"parameters" : {
"action" : "build",
"activeArchitecture" : "arm64",
"activeRunDestination" : {
"disableOnlyActiveArch" : false,
"platform" : "macosx",
"sdk" : "macosx15.5",
"sdkVariant" : "macos",
"supportedArchitectures" : [
"arm64e",
"arm64",
"x86_64"
],
"targetArchitecture" : "arm64"
},
"arenaInfo" : {
"buildIntermediatesPath" : "",
"buildProductsPath" : "",
"derivedDataPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData",
"indexDataStoreFolderPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData/MetalLearning-baphacvpjexerkbycoknmdfbyuet/Index.noindex/DataStore",
"indexEnableDataStore" : true,
"indexPCHPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData/MetalLearning-baphacvpjexerkbycoknmdfbyuet/Index.noindex/PrecompiledHeaders",
"pchPath" : ""
},
"configurationName" : "Debug",
"overrides" : {
"synthesized" : {
"table" : {
"ENABLE_PREVIEWS" : "NO",
"ENABLE_XOJIT_PREVIEWS" : "YES",
"ONLY_ACTIVE_ARCH" : "YES"
}
}
}
},
"schemeCommand" : "launch",
"showNonLoggedProgress" : true,
"useDryRun" : false,
"useImplicitDependencies" : true,
"useLegacyBuildLocations" : false,
"useParallelTargets" : true
}

@ -0,0 +1,2 @@
Target dependency graph (1 target)
Target 'MetalLearning' in project 'MetalLearning' (no dependencies)

@ -0,0 +1 @@
-target arm64-apple-macos15.5 '-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG' -fpascal-strings -O0 -DMEL_PLATFORM_MAC -DMEL_DEBUG '-DOBJC_OLD_DISPATCH_PROTOTYPES=1' -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk -g -fvisibility-inlines-hidden -iquote /Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-generated-files.hmap -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-own-target-headers.hmap -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-all-target-headers.hmap -iquote /Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-project-headers.hmap -iquote MetalLearning.xcodeproj -iquote vendor -iquote src -iquote MetalLearning.xcodeproj/xcuserdata -iquote MetalLearning.xcodeproj/project.xcworkspace -iquote MetalLearning.xcodeproj/xcuserdata/xudianhuan.xcuserdatad -iquote MetalLearning.xcodeproj/xcuserdata/xudianhuan.xcuserdatad/xcschemes -iquote MetalLearning.xcodeproj/project.xcworkspace/xcuserdata -iquote MetalLearning.xcodeproj/project.xcworkspace/xcuserdata/xudianhuan.xcuserdatad -iquote vendor/spdlog -iquote vendor/spdlog/bench -iquote vendor/spdlog/cmake -iquote vendor/spdlog/example -iquote vendor/spdlog/include -iquote vendor/spdlog/tests -iquote vendor/spdlog/logos -iquote vendor/spdlog/scripts -iquote vendor/spdlog/.github -iquote vendor/spdlog/src -iquote vendor/spdlog/include/spdlog -iquote vendor/spdlog/include/spdlog/fmt -iquote vendor/spdlog/include/spdlog/sinks -iquote vendor/spdlog/include/spdlog/details -iquote vendor/spdlog/include/spdlog/cfg -iquote vendor/spdlog/include/spdlog/fmt/bundled -iquote vendor/spdlog/.github/workflows -iquote ShaderSrc -iquote ../MEL/vendor/spdlog/include -I/Users/xudianhuan/Documents/dev/MetalLearning/bin/Debug-macosx-x86_64/MetalLearning/include -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources-normal/arm64 -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources/arm64 -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources -F/Users/xudianhuan/Documents/dev/MetalLearning/bin/Debug-macosx-x86_64/MetalLearning

@ -0,0 +1,4 @@
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/AppDelegate.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/MetalRenderer.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/ViewController.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/main.o

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>

@ -0,0 +1,58 @@
{
"buildCommand" : {
"command" : "prepareForIndexing",
"enableIndexBuildArena" : false,
"targets" : null
},
"configuredTargets" : [
{
"guid" : "e033b179dceb315dcd5ecd602612986a70d00e290cc9c947a0a6ad4a3666580f"
}
],
"containerPath" : "/Users/xudianhuan/Documents/dev/MetalLearning/MetalLearning/MetalLearning.xcodeproj",
"continueBuildingAfterErrors" : true,
"dependencyScope" : "workspace",
"enableIndexBuildArena" : false,
"hideShellScriptEnvironment" : false,
"parameters" : {
"action" : "build",
"activeArchitecture" : "arm64",
"activeRunDestination" : {
"disableOnlyActiveArch" : false,
"platform" : "macosx",
"sdk" : "macosx15.5",
"sdkVariant" : "macos",
"supportedArchitectures" : [
"arm64e",
"arm64",
"x86_64"
],
"targetArchitecture" : "arm64"
},
"arenaInfo" : {
"buildIntermediatesPath" : "",
"buildProductsPath" : "",
"derivedDataPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData",
"indexDataStoreFolderPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData/MetalLearning-baphacvpjexerkbycoknmdfbyuet/Index.noindex/DataStore",
"indexEnableDataStore" : true,
"indexPCHPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData/MetalLearning-baphacvpjexerkbycoknmdfbyuet/Index.noindex/PrecompiledHeaders",
"pchPath" : ""
},
"configurationName" : "Debug",
"overrides" : {
"synthesized" : {
"table" : {
"ENABLE_PREVIEWS" : "NO",
"ENABLE_XOJIT_PREVIEWS" : "YES",
"ONLY_ACTIVE_ARCH" : "YES"
}
}
}
},
"schemeCommand" : "launch",
"showNonLoggedProgress" : true,
"useDryRun" : false,
"useImplicitDependencies" : true,
"useLegacyBuildLocations" : false,
"useParallelTargets" : true
}

@ -0,0 +1,2 @@
Target dependency graph (1 target)
Target 'MetalLearning' in project 'MetalLearning' (no dependencies)

@ -0,0 +1 @@
-target arm64-apple-macos15.5 '-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG' -fpascal-strings -O0 -DMEL_PLATFORM_MAC -DMEL_DEBUG '-DOBJC_OLD_DISPATCH_PROTOTYPES=1' -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk -g -fvisibility-inlines-hidden -iquote /Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-generated-files.hmap -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-own-target-headers.hmap -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-all-target-headers.hmap -iquote /Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/MetalLearning-project-headers.hmap -iquote . -iquote ShaderSrc -iquote ../MEL/vendor/spdlog/include -I/Users/xudianhuan/Documents/dev/MetalLearning/bin/Debug-macosx-x86_64/MetalLearning/include -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources-normal/arm64 -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources/arm64 -I/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/DerivedSources -F/Users/xudianhuan/Documents/dev/MetalLearning/bin/Debug-macosx-x86_64/MetalLearning

@ -0,0 +1,4 @@
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/AppDelegate.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/MetalRenderer.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/ViewController.o
/Users/xudianhuan/Documents/dev/MetalLearning/bin-int/Debug-macosx-x86_64/MetalLearning/MetalLearning.build/Objects-normal/arm64/main.o

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>

@ -0,0 +1,58 @@
{
"buildCommand" : {
"command" : "prepareForIndexing",
"enableIndexBuildArena" : false,
"targets" : null
},
"configuredTargets" : [
{
"guid" : "e033b179dceb315dcd5ecd602612986a70d00e290cc9c947a0a6ad4a3666580f"
}
],
"containerPath" : "/Users/xudianhuan/Documents/dev/MetalLearning/MetalLearning/MetalLearning.xcodeproj",
"continueBuildingAfterErrors" : true,
"dependencyScope" : "workspace",
"enableIndexBuildArena" : false,
"hideShellScriptEnvironment" : false,
"parameters" : {
"action" : "build",
"activeArchitecture" : "arm64",
"activeRunDestination" : {
"disableOnlyActiveArch" : false,
"platform" : "macosx",
"sdk" : "macosx15.5",
"sdkVariant" : "macos",
"supportedArchitectures" : [
"arm64e",
"arm64",
"x86_64"
],
"targetArchitecture" : "arm64"
},
"arenaInfo" : {
"buildIntermediatesPath" : "",
"buildProductsPath" : "",
"derivedDataPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData",
"indexDataStoreFolderPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData/MetalLearning-baphacvpjexerkbycoknmdfbyuet/Index.noindex/DataStore",
"indexEnableDataStore" : true,
"indexPCHPath" : "/Users/xudianhuan/Library/Developer/Xcode/DerivedData/MetalLearning-baphacvpjexerkbycoknmdfbyuet/Index.noindex/PrecompiledHeaders",
"pchPath" : ""
},
"configurationName" : "Debug",
"overrides" : {
"synthesized" : {
"table" : {
"ENABLE_PREVIEWS" : "NO",
"ENABLE_XOJIT_PREVIEWS" : "YES",
"ONLY_ACTIVE_ARCH" : "YES"
}
}
}
},
"schemeCommand" : "launch",
"showNonLoggedProgress" : true,
"useDryRun" : false,
"useImplicitDependencies" : true,
"useLegacyBuildLocations" : false,
"useParallelTargets" : true
}

@ -0,0 +1,2 @@
Target dependency graph (1 target)
Target 'MetalLearning' in project 'MetalLearning' (no dependencies)

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.MetalLearning.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save