Update some things.

This commit is contained in:
Signal 2026-04-06 18:30:52 -04:00
parent f215bc3742
commit f9d6e7a70a
35 changed files with 575 additions and 905 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/ArtifactEngine.xcodeproj/
/ArtifactEngine.xcodeproj

View file

@ -1,813 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 77;
objects = {
/* Begin PBXBuildFile section */
9B20EE962F4BC69100117DD8 /* libwgpu_native.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EE952F4BC69100117DD8 /* libwgpu_native.a */; };
9B20EE982F4BC6C600117DD8 /* libngtcp2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EE972F4BC6C600117DD8 /* libngtcp2.a */; };
9B20EE9C2F4BCF7D00117DD8 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EE9B2F4BCF7D00117DD8 /* libglfw3.a */; };
9B20EEAA2F4BD04000117DD8 /* libClient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EE672F4BC09C00117DD8 /* libClient.a */; };
9B20EEAB2F4BD04400117DD8 /* libServer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EE752F4BC0FD00117DD8 /* libServer.a */; };
9B20EEAC2F4BD04400117DD8 /* libShared.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EE7F2F4BC11100117DD8 /* libShared.a */; };
9B20EEAD2F4BD05300117DD8 /* libShared.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EE7F2F4BC11100117DD8 /* libShared.a */; };
9B20EEAE2F4BD05700117DD8 /* libShared.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EE7F2F4BC11100117DD8 /* libShared.a */; };
9B20EEC22F4D028400117DD8 /* libgnutls.30.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EEC12F4D028400117DD8 /* libgnutls.30.dylib */; };
9B20EEC42F4D141600117DD8 /* libev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EEC32F4D141600117DD8 /* libev.a */; };
9B20EEDA2F60D87E00117DD8 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EED92F60D87E00117DD8 /* IOKit.framework */; };
9B20EEDC2F60D88D00117DD8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EEDB2F60D88D00117DD8 /* QuartzCore.framework */; };
9B20EEE02F60D92300117DD8 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EEDF2F60D92300117DD8 /* Cocoa.framework */; };
9B20EF182F60F1DF00117DD8 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EF172F60F1DF00117DD8 /* CoreVideo.framework */; };
9B20EF192F60F1E500117DD8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EEDB2F60D88D00117DD8 /* QuartzCore.framework */; };
9B20EF1A2F60F1F000117DD8 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EEDF2F60D92300117DD8 /* Cocoa.framework */; };
9B20EF1C2F60F22500117DD8 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EED92F60D87E00117DD8 /* IOKit.framework */; };
9B20EF1D2F60F23C00117DD8 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20EF172F60F1DF00117DD8 /* CoreVideo.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
9B20EE8B2F4BC55500117DD8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9B20EE292F4BBE9600117DD8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9B20EE7E2F4BC11100117DD8;
remoteInfo = Shared;
};
9B20EE8D2F4BC55F00117DD8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9B20EE292F4BBE9600117DD8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9B20EE7E2F4BC11100117DD8;
remoteInfo = Shared;
};
9B20EE8F2F4BC56500117DD8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9B20EE292F4BBE9600117DD8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9B20EE662F4BC09C00117DD8;
remoteInfo = Client;
};
9B20EE912F4BC56500117DD8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9B20EE292F4BBE9600117DD8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9B20EE742F4BC0FD00117DD8;
remoteInfo = Server;
};
9B20EE932F4BC56500117DD8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9B20EE292F4BBE9600117DD8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9B20EE7E2F4BC11100117DD8;
remoteInfo = Shared;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
9B20EE582F4BBF4800117DD8 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
9B20EE3E2F4BBEEC00117DD8 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
9B20EE5A2F4BBF4800117DD8 /* TestGame */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestGame; sourceTree = BUILT_PRODUCTS_DIR; };
9B20EE672F4BC09C00117DD8 /* libClient.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libClient.a; sourceTree = BUILT_PRODUCTS_DIR; };
9B20EE752F4BC0FD00117DD8 /* libServer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libServer.a; sourceTree = BUILT_PRODUCTS_DIR; };
9B20EE7F2F4BC11100117DD8 /* libShared.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libShared.a; sourceTree = BUILT_PRODUCTS_DIR; };
9B20EE952F4BC69100117DD8 /* libwgpu_native.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwgpu_native.a; path = "../../../eclipse-workspace/ArtifactEngine/deps/webgpu/lib/libwgpu_native.a"; sourceTree = "<group>"; };
9B20EE972F4BC6C600117DD8 /* libngtcp2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libngtcp2.a; path = "../../../eclipse-workspace/ArtifactEngine/deps/ngtcp2/build/lib/libngtcp2.a"; sourceTree = "<group>"; };
9B20EE9B2F4BCF7D00117DD8 /* libglfw3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libglfw3.a; path = "../../../eclipse-workspace/ArtifactEngine/deps/glfw/install/lib/libglfw3.a"; sourceTree = "<group>"; };
9B20EEC12F4D028400117DD8 /* libgnutls.30.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libgnutls.30.dylib; path = ../../../homebrew/Cellar/gnutls/3.8.11/lib/libgnutls.30.dylib; sourceTree = "<group>"; };
9B20EEC32F4D141600117DD8 /* libev.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libev.a; path = ../../../homebrew/Cellar/libev/4.33/lib/libev.a; sourceTree = "<group>"; };
9B20EED42F60D84B00117DD8 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
9B20EED72F60D86C00117DD8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
9B20EED92F60D87E00117DD8 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
9B20EEDB2F60D88D00117DD8 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
9B20EEDD2F60D89F00117DD8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
9B20EEDF2F60D92300117DD8 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
9B20EEE12F60D93200117DD8 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
9B20EF172F60F1DF00117DD8 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
9B20EE6C2F4BC0C500117DD8 /* Exceptions for "Client" folder in "Client" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
additionalCompilerFlagsByRelativePath = {
glfw3webgpu/glfw3webgpu.c = "-x objective-c";
};
membershipExceptions = (
Client.cpp,
Client.h,
glfw3webgpu/glfw3webgpu.c,
glfw3webgpu/glfw3webgpu.h,
Graphics/ChunkRenderer.cpp,
Graphics/EntityRenderer.cpp,
Graphics/EntityRenderer.h,
Graphics/Graphics.cpp,
Graphics/Graphics.h,
Graphics/UIRenderer.cpp,
Graphics/UIRenderer.h,
Graphics/WorldRenderer.cpp,
Graphics/WorldRenderer.h,
Platform/Keybinds.cpp,
Platform/Keybinds.h,
Platform/Window.cpp,
Platform/Window.h,
World/Player.cpp,
);
target = 9B20EE662F4BC09C00117DD8 /* Client */;
};
9B20EE7A2F4BC10500117DD8 /* Exceptions for "Server" folder in "Server" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Server.cpp,
Server.h,
);
target = 9B20EE742F4BC0FD00117DD8 /* Server */;
};
9B20EE842F4BC11700117DD8 /* Exceptions for "Shared" folder in "Shared" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Events.h,
Network/Connection.cpp,
Network/Network.cpp,
Network/Network.h,
Shared.cpp,
Shared.h,
);
target = 9B20EE7E2F4BC11100117DD8 /* Shared */;
};
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
9B20EE4B2F4BBF0200117DD8 /* Client */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
9B20EE6C2F4BC0C500117DD8 /* Exceptions for "Client" folder in "Client" target */,
);
path = Client;
sourceTree = "<group>";
};
9B20EE522F4BBF0A00117DD8 /* Server */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
9B20EE7A2F4BC10500117DD8 /* Exceptions for "Server" folder in "Server" target */,
);
path = Server;
sourceTree = "<group>";
};
9B20EE552F4BBF0D00117DD8 /* Shared */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
9B20EE842F4BC11700117DD8 /* Exceptions for "Shared" folder in "Shared" target */,
);
path = Shared;
sourceTree = "<group>";
};
9B20EE5B2F4BBF4800117DD8 /* TestGame */ = {
isa = PBXFileSystemSynchronizedRootGroup;
path = TestGame;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
9B20EE572F4BBF4800117DD8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9B20EF1D2F60F23C00117DD8 /* CoreVideo.framework in Frameworks */,
9B20EEE02F60D92300117DD8 /* Cocoa.framework in Frameworks */,
9B20EEDC2F60D88D00117DD8 /* QuartzCore.framework in Frameworks */,
9B20EEDA2F60D87E00117DD8 /* IOKit.framework in Frameworks */,
9B20EEAB2F4BD04400117DD8 /* libServer.a in Frameworks */,
9B20EEAC2F4BD04400117DD8 /* libShared.a in Frameworks */,
9B20EEAA2F4BD04000117DD8 /* libClient.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9B20EE652F4BC09C00117DD8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9B20EF1C2F60F22500117DD8 /* IOKit.framework in Frameworks */,
9B20EF1A2F60F1F000117DD8 /* Cocoa.framework in Frameworks */,
9B20EF192F60F1E500117DD8 /* QuartzCore.framework in Frameworks */,
9B20EF182F60F1DF00117DD8 /* CoreVideo.framework in Frameworks */,
9B20EEAD2F4BD05300117DD8 /* libShared.a in Frameworks */,
9B20EE9C2F4BCF7D00117DD8 /* libglfw3.a in Frameworks */,
9B20EE962F4BC69100117DD8 /* libwgpu_native.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9B20EE732F4BC0FD00117DD8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9B20EEAE2F4BD05700117DD8 /* libShared.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9B20EE7D2F4BC11100117DD8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9B20EEC42F4D141600117DD8 /* libev.a in Frameworks */,
9B20EEC22F4D028400117DD8 /* libgnutls.30.dylib in Frameworks */,
9B20EE982F4BC6C600117DD8 /* libngtcp2.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9B20EE282F4BBE9600117DD8 = {
isa = PBXGroup;
children = (
9B20EE4B2F4BBF0200117DD8 /* Client */,
9B20EE3E2F4BBEEC00117DD8 /* CMakeLists.txt */,
9B20EE522F4BBF0A00117DD8 /* Server */,
9B20EE552F4BBF0D00117DD8 /* Shared */,
9B20EE5B2F4BBF4800117DD8 /* TestGame */,
9B20EE852F4BC12400117DD8 /* Frameworks */,
9B20EE322F4BBE9600117DD8 /* Products */,
);
sourceTree = "<group>";
};
9B20EE322F4BBE9600117DD8 /* Products */ = {
isa = PBXGroup;
children = (
9B20EE5A2F4BBF4800117DD8 /* TestGame */,
9B20EE672F4BC09C00117DD8 /* libClient.a */,
9B20EE752F4BC0FD00117DD8 /* libServer.a */,
9B20EE7F2F4BC11100117DD8 /* libShared.a */,
);
name = Products;
sourceTree = "<group>";
};
9B20EE852F4BC12400117DD8 /* Frameworks */ = {
isa = PBXGroup;
children = (
9B20EF172F60F1DF00117DD8 /* CoreVideo.framework */,
9B20EEE12F60D93200117DD8 /* Metal.framework */,
9B20EEDF2F60D92300117DD8 /* Cocoa.framework */,
9B20EEDD2F60D89F00117DD8 /* Foundation.framework */,
9B20EEDB2F60D88D00117DD8 /* QuartzCore.framework */,
9B20EED92F60D87E00117DD8 /* IOKit.framework */,
9B20EED72F60D86C00117DD8 /* CoreGraphics.framework */,
9B20EED42F60D84B00117DD8 /* CoreFoundation.framework */,
9B20EEC32F4D141600117DD8 /* libev.a */,
9B20EEC12F4D028400117DD8 /* libgnutls.30.dylib */,
9B20EE9B2F4BCF7D00117DD8 /* libglfw3.a */,
9B20EE972F4BC6C600117DD8 /* libngtcp2.a */,
9B20EE952F4BC69100117DD8 /* libwgpu_native.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
9B20EE632F4BC09C00117DD8 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9B20EE712F4BC0FD00117DD8 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9B20EE7B2F4BC11100117DD8 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
9B20EE592F4BBF4800117DD8 /* TestGame */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9B20EE5E2F4BBF4800117DD8 /* Build configuration list for PBXNativeTarget "TestGame" */;
buildPhases = (
9B20EE562F4BBF4800117DD8 /* Sources */,
9B20EE572F4BBF4800117DD8 /* Frameworks */,
9B20EE582F4BBF4800117DD8 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
9B20EE902F4BC56500117DD8 /* PBXTargetDependency */,
9B20EE922F4BC56500117DD8 /* PBXTargetDependency */,
9B20EE942F4BC56500117DD8 /* PBXTargetDependency */,
);
fileSystemSynchronizedGroups = (
9B20EE5B2F4BBF4800117DD8 /* TestGame */,
);
name = TestGame;
packageProductDependencies = (
);
productName = TestGame;
productReference = 9B20EE5A2F4BBF4800117DD8 /* TestGame */;
productType = "com.apple.product-type.tool";
};
9B20EE662F4BC09C00117DD8 /* Client */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9B20EE682F4BC09C00117DD8 /* Build configuration list for PBXNativeTarget "Client" */;
buildPhases = (
9B20EE632F4BC09C00117DD8 /* Headers */,
9B20EE642F4BC09C00117DD8 /* Sources */,
9B20EE652F4BC09C00117DD8 /* Frameworks */,
);
buildRules = (
);
dependencies = (
9B20EE8E2F4BC55F00117DD8 /* PBXTargetDependency */,
);
name = Client;
packageProductDependencies = (
);
productName = Client;
productReference = 9B20EE672F4BC09C00117DD8 /* libClient.a */;
productType = "com.apple.product-type.library.static";
};
9B20EE742F4BC0FD00117DD8 /* Server */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9B20EE762F4BC0FD00117DD8 /* Build configuration list for PBXNativeTarget "Server" */;
buildPhases = (
9B20EE712F4BC0FD00117DD8 /* Headers */,
9B20EE722F4BC0FD00117DD8 /* Sources */,
9B20EE732F4BC0FD00117DD8 /* Frameworks */,
);
buildRules = (
);
dependencies = (
9B20EE8C2F4BC55500117DD8 /* PBXTargetDependency */,
);
name = Server;
packageProductDependencies = (
);
productName = Server;
productReference = 9B20EE752F4BC0FD00117DD8 /* libServer.a */;
productType = "com.apple.product-type.library.static";
};
9B20EE7E2F4BC11100117DD8 /* Shared */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9B20EE802F4BC11100117DD8 /* Build configuration list for PBXNativeTarget "Shared" */;
buildPhases = (
9B20EE7B2F4BC11100117DD8 /* Headers */,
9B20EE7C2F4BC11100117DD8 /* Sources */,
9B20EE7D2F4BC11100117DD8 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Shared;
packageProductDependencies = (
);
productName = Shared;
productReference = 9B20EE7F2F4BC11100117DD8 /* libShared.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
9B20EE292F4BBE9600117DD8 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastUpgradeCheck = 1640;
TargetAttributes = {
9B20EE592F4BBF4800117DD8 = {
CreatedOnToolsVersion = 16.4;
};
9B20EE662F4BC09C00117DD8 = {
CreatedOnToolsVersion = 16.4;
};
9B20EE742F4BC0FD00117DD8 = {
CreatedOnToolsVersion = 16.4;
};
9B20EE7E2F4BC11100117DD8 = {
CreatedOnToolsVersion = 16.4;
};
};
};
buildConfigurationList = 9B20EE2C2F4BBE9600117DD8 /* Build configuration list for PBXProject "ArtifactEngine" */;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 9B20EE282F4BBE9600117DD8;
minimizedProjectReferenceProxies = 1;
preferredProjectObjectVersion = 77;
productRefGroup = 9B20EE322F4BBE9600117DD8 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
9B20EE592F4BBF4800117DD8 /* TestGame */,
9B20EE662F4BC09C00117DD8 /* Client */,
9B20EE742F4BC0FD00117DD8 /* Server */,
9B20EE7E2F4BC11100117DD8 /* Shared */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
9B20EE562F4BBF4800117DD8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9B20EE642F4BC09C00117DD8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9B20EE722F4BC0FD00117DD8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9B20EE7C2F4BC11100117DD8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
9B20EE8C2F4BC55500117DD8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9B20EE7E2F4BC11100117DD8 /* Shared */;
targetProxy = 9B20EE8B2F4BC55500117DD8 /* PBXContainerItemProxy */;
};
9B20EE8E2F4BC55F00117DD8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9B20EE7E2F4BC11100117DD8 /* Shared */;
targetProxy = 9B20EE8D2F4BC55F00117DD8 /* PBXContainerItemProxy */;
};
9B20EE902F4BC56500117DD8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9B20EE662F4BC09C00117DD8 /* Client */;
targetProxy = 9B20EE8F2F4BC56500117DD8 /* PBXContainerItemProxy */;
};
9B20EE922F4BC56500117DD8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9B20EE742F4BC0FD00117DD8 /* Server */;
targetProxy = 9B20EE912F4BC56500117DD8 /* PBXContainerItemProxy */;
};
9B20EE942F4BC56500117DD8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9B20EE7E2F4BC11100117DD8 /* Shared */;
targetProxy = 9B20EE932F4BC56500117DD8 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
9B20EE362F4BBE9600117DD8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = 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_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_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 15.5;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
9B20EE372F4BBE9600117DD8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = 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_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_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 15.5;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
};
name = Release;
};
9B20EE5F2F4BBF4800117DD8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
HEADER_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glfw/install/include",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glm",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/webgpu/include",
/Users/iboettcher/Desktop/misc/ArtifactEngine/Shared,
/Users/iboettcher/Desktop/misc/ArtifactEngine/Client,
/Users/iboettcher/Desktop/misc/ArtifactEngine/Server,
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/include",
/Users/iboettcher/homebrew/include,
);
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
9B20EE602F4BBF4800117DD8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
HEADER_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glfw/install/include",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glm",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/webgpu/include",
/Users/iboettcher/Desktop/misc/ArtifactEngine/Shared,
/Users/iboettcher/Desktop/misc/ArtifactEngine/Client,
/Users/iboettcher/Desktop/misc/ArtifactEngine/Server,
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/include",
/Users/iboettcher/homebrew/include,
);
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
9B20EE692F4BC09C00117DD8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/webgpu/include",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glfw/install/include",
/Users/iboettcher/Desktop/misc/ArtifactEngine/Shared,
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glm",
/Users/iboettcher/homebrew/include,
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/include",
);
LIBRARY_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glfw/install/lib",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/webgpu/lib",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
9B20EE6A2F4BC09C00117DD8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/webgpu/include",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glfw/install/include",
/Users/iboettcher/Desktop/misc/ArtifactEngine/Shared,
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glm",
/Users/iboettcher/homebrew/include,
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/include",
);
LIBRARY_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glfw/install/lib",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/webgpu/lib",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
9B20EE772F4BC0FD00117DD8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
/Users/iboettcher/Desktop/misc/ArtifactEngine/Shared,
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glm",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/include",
/Users/iboettcher/homebrew/include,
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
9B20EE782F4BC0FD00117DD8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
/Users/iboettcher/Desktop/misc/ArtifactEngine/Shared,
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glm",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/include",
/Users/iboettcher/homebrew/include,
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
9B20EE812F4BC11100117DD8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/include",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glm",
/Users/iboettcher/homebrew/include,
);
LIBRARY_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/lib",
/Users/iboettcher/homebrew/lib,
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
9B20EE822F4BC11100117DD8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/include",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps",
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/glm",
/Users/iboettcher/homebrew/include,
);
LIBRARY_SEARCH_PATHS = (
"/Users/iboettcher/eclipse-workspace/ArtifactEngine/deps/ngtcp2/install/lib",
/Users/iboettcher/homebrew/lib,
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
9B20EE2C2F4BBE9600117DD8 /* Build configuration list for PBXProject "ArtifactEngine" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9B20EE362F4BBE9600117DD8 /* Debug */,
9B20EE372F4BBE9600117DD8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9B20EE5E2F4BBF4800117DD8 /* Build configuration list for PBXNativeTarget "TestGame" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9B20EE5F2F4BBF4800117DD8 /* Debug */,
9B20EE602F4BBF4800117DD8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9B20EE682F4BC09C00117DD8 /* Build configuration list for PBXNativeTarget "Client" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9B20EE692F4BC09C00117DD8 /* Debug */,
9B20EE6A2F4BC09C00117DD8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9B20EE762F4BC0FD00117DD8 /* Build configuration list for PBXNativeTarget "Server" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9B20EE772F4BC0FD00117DD8 /* Debug */,
9B20EE782F4BC0FD00117DD8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9B20EE802F4BC11100117DD8 /* Build configuration list for PBXNativeTarget "Shared" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9B20EE812F4BC11100117DD8 /* Debug */,
9B20EE822F4BC11100117DD8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 9B20EE292F4BBE9600117DD8 /* Project object */;
}

View file

@ -1,39 +0,0 @@
<?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>ArtifactEngine.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>Client.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>Server.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>Shared.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>TestGame.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>glfw3webgpu.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
</dict>
</dict>
</dict>
</plist>

View file

@ -1,6 +1,7 @@
#include <chrono> #include <chrono>
#include "Client.h" #include "Client.h"
#include "Network.h"
#include "Graphics/UIRenderer.h" #include "Graphics/UIRenderer.h"
#include "Graphics/Graphics.h" #include "Graphics/Graphics.h"
#include <Network/Network.h> #include <Network/Network.h>
@ -8,10 +9,10 @@
namespace Artifact { namespace Artifact {
void Client::init() { void Client::init() {
window = subsystem<Window>(); window = subsystem<WindowImpl>();
for (auto & system : subsystems) { for (auto & system : subsystems) {
system->engine = this; system->client = this;
system->init(); system->init();
system->reload(); system->reload();
} }
@ -45,7 +46,7 @@ void Client::tick() {
void Client::addDefaultSubsystems() { void Client::addDefaultSubsystems() {
addSubsystem<Window>(1080, 640, "Artifact Engine"); addSubsystem<Window>(1080, 640, "Artifact Engine");
addSubsystem<NetworkClient>(); addSubsystem<ClientNetwork>();
auto graphics = addSubsystem<Graphics>(); auto graphics = addSubsystem<Graphics>();
{ {
graphics->addSubsystem<UIRenderer>(); graphics->addSubsystem<UIRenderer>();

View file

@ -3,14 +3,20 @@
#include <memory> #include <memory>
#include "Shared.h" #include "Shared.h"
#include "Platform/Window.h" #include <Settings.h>
namespace Artifact { namespace Artifact {
class ClientSubsystem;
class WindowImpl;
/// The client class. /// The client class.
class Client: public Engine<BaseSubsystem> { class Client: public Engine<ClientSubsystem> {
public: public:
Window * window = nullptr; WindowImpl * window = nullptr;
Settings settings;
Client() : settings(getClientConfigPath()) {}
void addDefaultSubsystems(); void addDefaultSubsystems();
void initDefault(); void initDefault();
@ -24,4 +30,11 @@ public:
void run(); void run();
}; };
class ClientSubsystem: public BaseSubsystem {
public:
Client * client = nullptr;
virtual void render() {}
virtual void tick() {}
};
} }

View file

@ -0,0 +1,7 @@
#include "Camera.h"
namespace Artifact {
}

24
Client/Graphics/Camera.h Normal file
View file

@ -0,0 +1,24 @@
#pragma once
#include <vector>
#include <typeindex>
#include <glm/glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
namespace Artifact {
class Camera {
public:
glm::vec3 pos;
glm::quat rot;
double fov;
float near;
float far;
std::vector<std::type_index> renderPasses;
Camera(glm::vec3 pos, double fov, float near, float far) : pos(pos), fov(fov), near(near), far(far) {}
};
}

View file

@ -8,7 +8,7 @@ namespace Artifact {
void Graphics::init() { void Graphics::init() {
instance = wgpuCreateInstance(nullptr); instance = wgpuCreateInstance(nullptr);
window = engine->subsystem<Window>(); window = client->subsystem<WindowImpl>();
surface = window->createWGPUSurface(instance); surface = window->createWGPUSurface(instance);

View file

@ -3,6 +3,7 @@
#include <webgpu/webgpu.h> #include <webgpu/webgpu.h>
#include <Shared.h> #include <Shared.h>
#include "../Client.h"
#include "../Platform/Window.h" #include "../Platform/Window.h"
namespace Artifact { namespace Artifact {
@ -18,7 +19,7 @@ public:
virtual void render(WGPUTextureView nextTexture, WGPUCommandEncoder encoder) {} virtual void render(WGPUTextureView nextTexture, WGPUCommandEncoder encoder) {}
}; };
class Graphics: public BaseSubsystem, public Engine<GraphicsSubsystem> { class Graphics: public ClientSubsystem, public Engine<GraphicsSubsystem> {
public: public:
WGPUInstance instance = nullptr; WGPUInstance instance = nullptr;
WGPUSurface surface = nullptr; WGPUSurface surface = nullptr;
@ -29,14 +30,11 @@ public:
WGPUTextureView depthTextureView = nullptr; WGPUTextureView depthTextureView = nullptr;
WGPUQueue queue = nullptr; WGPUQueue queue = nullptr;
Window * window; WindowImpl * window;
void init() override; void init() override;
void deinit() override; void deinit() override;
void render() override; void render() override;
void onSubsystemAdd(GraphicsSubsystem * system) {
system->graphics = this;
}
WGPUTexture createTextureFromData(const void* data, uint32_t width, uint32_t height); WGPUTexture createTextureFromData(const void* data, uint32_t width, uint32_t height);
WGPUTexture createTextureFromFile(const char* file); WGPUTexture createTextureFromFile(const char* file);

View file

@ -14,14 +14,14 @@ struct DrawUI {};
} }
static std::unordered_map<Key, nk_keys> ArtifactToNuklear {}; static std::array<nk_keys, static_cast<size_t>(Key::Last) + 1> ArtifactToNuklear {};
namespace { namespace {
static struct _nkInit { static struct _nkInit {
_nkInit() { _nkInit() {
// Populate the Artifact-to-Nuklear key map. // Populate the Artifact-to-Nuklear key map.
#define X(nuklear, artifact) ArtifactToNuklear[Key::artifact] = nuklear #define X(nuklear, artifact) ArtifactToNuklear[static_cast<int>(Key::artifact)] = nuklear
X(NK_KEY_CTRL, ControlLeft); X(NK_KEY_CTRL, ControlLeft);
X(NK_KEY_CTRL, ControlRight); X(NK_KEY_CTRL, ControlRight);
@ -47,37 +47,36 @@ static struct _nkInit {
void UIRenderer::init() { void UIRenderer::init() {
printf("UI: %p", graphics); printf("UI: %p", graphics);
window = graphics->window;
window->listen<Events::InputBegin>([this](auto ev) { graphics->window->listen<Events::InputBegin>([this](auto ev) {
nk_input_begin(&ctx); nk_input_begin(&ctx);
}); });
window->listen<Events::InputEnd>([this](auto ev) { graphics->window->listen<Events::InputEnd>([this](auto ev) {
nk_input_end(&ctx); nk_input_end(&ctx);
}); });
window->listen<Events::CursorPosEvent>([this](auto ev) { graphics->window->listen<Events::CursorPosEvent>([this](auto ev) {
nk_input_motion(&ctx, ev.x, ev.y); nk_input_motion(&ctx, ev.x, ev.y);
}); });
window->listen<Events::ScrollEvent>([this](auto ev) { graphics->window->listen<Events::ScrollEvent>([this](auto ev) {
nk_input_scroll(&ctx, nk_vec2(ev.dx, ev.dy)); nk_input_scroll(&ctx, nk_vec2(ev.dx, ev.dy));
}); });
window->listen<Events::MouseEvent>([this](auto ev) { graphics->window->listen<Events::MouseEvent>([this](auto ev) {
nk_input_button(&ctx, ev.button == Events::MOUSE_BUTTON_RIGHT ? NK_BUTTON_RIGHT : NK_BUTTON_LEFT, (int)ev.x, (int)ev.y, ev.state); nk_input_button(&ctx, ev.button == Events::MOUSE_BUTTON_RIGHT ? NK_BUTTON_RIGHT : NK_BUTTON_LEFT, (int)ev.x, (int)ev.y, ev.state);
}); });
window->listen<Events::KeyDownEvent>([this](auto ev) { graphics->window->listen<Events::KeyDownEvent>([this](auto ev) {
nk_input_key(&ctx, ArtifactToNuklear[ev.key], true); nk_input_key(&ctx, ArtifactToNuklear[static_cast<int>(ev.key)], true);
}); });
window->listen<Events::KeyUpEvent>([this](auto ev) { graphics->window->listen<Events::KeyUpEvent>([this](auto ev) {
nk_input_key(&ctx, ArtifactToNuklear[ev.key], false); nk_input_key(&ctx, ArtifactToNuklear[static_cast<int>(ev.key)], false);
}); });
window->listen<Events::CharInputEvent>([this](auto ev) { graphics->window->listen<Events::CharInputEvent>([this](auto ev) {
nk_input_char(&ctx, ev.codepoint); nk_input_char(&ctx, ev.codepoint);
}); });
@ -102,7 +101,6 @@ void UIRenderer::init() {
fclose(fontFile); fclose(fontFile);
font = nk_font_atlas_add_from_memory(&atlas, fontData, fontSize, 13.0f, nullptr); font = nk_font_atlas_add_from_memory(&atlas, fontData, fontSize, 13.0f, nullptr);
} else { } else {
fprintf(stderr, (std::string("Failed to load font: ") + assetPath + "/fonts/Arial.ttf\n").c_str());
font = nk_font_atlas_add_default(&atlas, 13.0f, nullptr); font = nk_font_atlas_add_default(&atlas, 13.0f, nullptr);
} }

View file

@ -21,7 +21,6 @@ class UIRenderer: public GraphicsSubsystem, public EventTarget {
nk_font_atlas atlas {}; nk_font_atlas atlas {};
WGPURenderPipeline pipeline = nullptr; WGPURenderPipeline pipeline = nullptr;
Window * window = nullptr;
WGPUBuffer vertexBuffer = nullptr; WGPUBuffer vertexBuffer = nullptr;
WGPUBuffer indexBuffer = nullptr; WGPUBuffer indexBuffer = nullptr;

View file

@ -1,3 +1,11 @@
#pragma once #pragma once
#include <Shared.h>
namespace Artifact {
class WorldRenderer {
};
}

17
Client/LocalPlayer.cpp Normal file
View file

@ -0,0 +1,17 @@
#include "LocalPlayer.h"
#include "Platform/Window.h"
namespace Artifact {
void LocalPlayer::init() {
window = client->subsystem<WindowImpl>();
}
void LocalPlayer::tick() {
if (window->isKeyDown(Key::W)) {
}
}
}

26
Client/LocalPlayer.h Normal file
View file

@ -0,0 +1,26 @@
#pragma once
#include <Shared.h>
#include "Client.h"
#include "Graphics/Camera.h"
namespace Artifact {
class LocalPlayerImpl: public ClientSubsystem {
public:
std::unique_ptr<Camera> camera = nullptr;
};
class LocalPlayer: public LocalPlayerImpl {
WindowImpl * window = nullptr;
public:
LocalPlayer() {
//camera = std::make_unique<Camera>(glm::vec3(0, 0, 0), 75);
}
void init() override;
void tick() override;
};
}

11
Client/Network.h Normal file
View file

@ -0,0 +1,11 @@
#pragma once
#include "Client.h"
#include <Network/Network.h>
namespace Artifact {
class ClientNetwork: public NetworkClient, public ClientSubsystem {};
}

View file

@ -6,6 +6,7 @@
namespace Artifact { namespace Artifact {
static std::array<Key, GLFW_KEY_LAST + 1> GLFWToArtifact {}; static std::array<Key, GLFW_KEY_LAST + 1> GLFWToArtifact {};
static std::array<int, static_cast<size_t>(Key::Last) + 1> ArtifactToGLFW {};
namespace { namespace {
// Ensure that GLFW is transparently initialized prior to window creation. // Ensure that GLFW is transparently initialized prior to window creation.
@ -15,7 +16,8 @@ static struct _glfwInit {
// Populate the global GLFW-to-Artifact keycode mapping. // Populate the global GLFW-to-Artifact keycode mapping.
GLFWToArtifact.fill(Key::Unknown); GLFWToArtifact.fill(Key::Unknown);
#define X(glfw, artifact) GLFWToArtifact[glfw] = Key::artifact #define X(glfw, artifact) GLFWToArtifact[glfw] = Key::artifact;\
ArtifactToGLFW[static_cast<int>(Key::artifact)] = glfw
X(GLFW_KEY_A, A); X(GLFW_KEY_A, A);
X(GLFW_KEY_B, B); X(GLFW_KEY_B, B);
X(GLFW_KEY_C, C); X(GLFW_KEY_C, C);
@ -160,4 +162,16 @@ bool Window::shouldClose() {
return glfwWindowShouldClose(window); return glfwWindowShouldClose(window);
} }
void Window::setPointerLock() {
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
}
void Window::releasePointerLock() {
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
}
bool Window::isKeyDown(Key key) {
return glfwGetKey(window, ArtifactToGLFW[static_cast<int>(key)]) == GLFW_PRESS;
}
} }

View file

@ -4,8 +4,9 @@
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#include <webgpu/webgpu.h> #include <webgpu/webgpu.h>
#include "Shared.h" #include <Shared.h>
#include "Events.h" #include "Events.h"
#include "Client.h"
namespace Artifact { namespace Artifact {
@ -23,6 +24,8 @@ enum class Key {
DeleteForward, DeleteBackward, DeleteForward, DeleteBackward,
ArrowLeft, ArrowRight, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowDown,
Tab, Tab,
Last
}; };
namespace Events { namespace Events {
@ -72,7 +75,16 @@ struct MouseEvent {
} }
class Window: public EventTarget, public BaseSubsystem { class WindowImpl: public EventTarget, public ClientSubsystem {
public:
virtual bool shouldClose() = 0;
virtual WGPUSurface createWGPUSurface(WGPUInstance instance) = 0;
virtual void setPointerLock() = 0;
virtual void releasePointerLock() = 0;
virtual bool isKeyDown(Key key) = 0;
};
class Window: public WindowImpl {
private: private:
GLFWwindow * window = nullptr; GLFWwindow * window = nullptr;
public: public:
@ -80,9 +92,12 @@ public:
void render() override; void render() override;
WGPUSurface createWGPUSurface(WGPUInstance instance); WGPUSurface createWGPUSurface(WGPUInstance instance) override;
void setTitle(std::string title); void setTitle(std::string title);
bool shouldClose(); bool shouldClose() override;
void setPointerLock() override;
void releasePointerLock() override;
bool isKeyDown(Key key) override;
}; };
} }

View file

@ -1,3 +0,0 @@
#include "Player.h"

View file

@ -1,11 +0,0 @@
#pragma once
#include <Shared.h>
namespace Artifact {
class Player: public BaseSubsystem {
};
}

10
Server/Network.h Normal file
View file

@ -0,0 +1,10 @@
#pragma once
#include <Network/Network.h>
#include "Server.h"
namespace Artifact {
class ServerNetwork: public NetworkServer, public ServerSubsystem {};
}

7
Server/Player.cpp Normal file
View file

@ -0,0 +1,7 @@
#include "Player.h"
namespace Artifact {
}

9
Server/Player.h Normal file
View file

@ -0,0 +1,9 @@
#pragma once
namespace Artifact {
class Player {
};
}

View file

@ -1,14 +1,37 @@
#include "Server.h" #include "Server.h"
#include "Network/Network.h" #include "Network.h"
#include "World/WorldManager.h"
namespace Artifact { namespace Artifact {
void Server::run() { void Server::init() {
for (auto & system : subsystems) {
system->init();
system->reload();
}
}
void Server::tick() {
for (auto & system : subsystems) {
system->tick();
}
}
void Server::run() {
init();
auto time = std::chrono::steady_clock::now();
while (true) {
auto now = std::chrono::steady_clock::now();
if (time - now > std::chrono::milliseconds(50)) {
tick();
}
}
} }
void Server::addDefaultSubsystems() { void Server::addDefaultSubsystems() {
addSubsystem<NetworkServer>(); addSubsystem<ServerNetwork>();
addSubsystem<WorldManager>();
} }
} }

View file

@ -1,13 +1,28 @@
#pragma once #pragma once
#include "Shared.h" #include "Shared.h"
#include <Settings.h>
namespace Artifact { namespace Artifact {
class Server: public Engine<BaseSubsystem> { class ServerSubsystem;
class Server: public Engine<ServerSubsystem> {
public: public:
Settings settings;
Server() : settings(getServerConfigPath()) {}
void init();
void tick();
void run(); void run();
void addDefaultSubsystems(); void addDefaultSubsystems();
}; };
class ServerSubsystem: public BaseSubsystem {
public:
Server * server = nullptr;
virtual void tick() {}
};
} }

View file

@ -0,0 +1,7 @@
//
// WorldBackend.cpp
// ArtifactEngine
//
// Created by Isaac Boettcher on 3/11/26.
//

View file

@ -0,0 +1,10 @@
#pragma once
namespace Artifact {
class WorldBackend {
virtual void saveChunk();
virtual void loadChukn();
};
}

View file

@ -0,0 +1,11 @@
#include "WorldManager.h"
#include <filesystem>
namespace Artifact {
void WorldManager::tick() {
}
}

View file

@ -0,0 +1,16 @@
#pragma once
#include <Shared.h>
#include "../Server.h"
namespace Artifact {
class WorldManagerImpl: public ServerSubsystem {
};
class WorldManager: public WorldManagerImpl {
void tick() override;
};
}

60
Shared/Paths.cpp Normal file
View file

@ -0,0 +1,60 @@
#include "Paths.h"
namespace Artifact {
Path getDataPath() {
Path base;
// ────────────────────────────────────────────────
// 1. Windows — AppData/Roaming (most common choice)
// ────────────────────────────────────────────────
#ifdef _WIN32
const char* appdata = std::getenv("APPDATA");
if (!appdata || !fs::exists(appdata)) {
throw std::runtime_error("Cannot find APPDATA environment variable");
}
base = Path(appdata) / organization / GAME;
#elif defined(__APPLE__)
// ────────────────────────────────────────────────
// 2. macOS — Application Support
// ────────────────────────────────────────────────
const char* home = std::getenv("HOME");
if (!home) throw std::runtime_error("Cannot find HOME");
base = Path(home) / "Library" / "Application Support" / GAME;
#else
// ────────────────────────────────────────────────
// 3. Linux / BSD / Steam Deck — XDG_DATA_HOME
// ────────────────────────────────────────────────
const char* xdg_data = std::getenv("XDG_DATA_HOME");
if (xdg_data && *xdg_data) {
base = fs::path(xdg_data) / game;
} else {
const char* home = std::getenv("HOME");
if (!home) throw std::runtime_error("Cannot find HOME");
base = Path(home) / ".local" / "share" / GAME;
}
#endif
// Create folder structure if it doesn't exist
std::error_code ec;
std::filesystem::create_directories(base, ec);
if (ec) {
throw std::runtime_error("Failed to create directory: " +
base.string() + "" + ec.message());
}
return base;
}
Path getClientConfigPath() {
return getDataPath() / "client.conf";
}
Path getServerConfigPath() {
return getDataPath() / "server.conf";
}
}

24
Shared/Paths.h Normal file
View file

@ -0,0 +1,24 @@
#pragma once
#include <filesystem>
#include <iostream>
#ifndef APP_NAME
# define APP_NAME ArtifactEngine
#endif
#define TOSTRING(x) #x
#define GAME TOSTRING(APP_NAME)
namespace Artifact {
using Path = std::filesystem::path;
Path getDataPath();
Path getClientConfigPath();
Path getServerConfigPath();
}

58
Shared/Settings.cpp Normal file
View file

@ -0,0 +1,58 @@
#include "Settings.h"
namespace Artifact {
Settings::Settings() : Settings(getDataPath() / "settings.conf") {}
Settings::Settings(Path path) : path(path) {
reload();
}
std::string trim(const std::string& str) {
size_t first = str.find_first_not_of(" \t\r\n");
if (first == std::string::npos) return "";
size_t last = str.find_last_not_of(" \t\r\n");
return str.substr(first, last - first + 1);
}
void Settings::reload() {
clear();
std::ifstream file(path);
if (!file.is_open()) {
// TODO: Log a warning
return;
}
std::string line;
while (std::getline(file, line)) {
line = trim(line);
if (line.empty() || line[0] == '#' || line[0] == ';') {
continue;
}
size_t eq_pos = line.find('=');
if (eq_pos == std::string::npos) {
continue;
}
std::string key = trim(line.substr(0, eq_pos));
std::string value = trim(line.substr(eq_pos + 1));
if (!key.empty()) {
data[key] = value;
}
}
}
void Settings::save() {
std::ofstream file(path);
if (!file.is_open()) {
return;
}
for (const auto & [key, value] : data) {
file << key << " = " << value << '\n';
}
}
}

85
Shared/Settings.h Normal file
View file

@ -0,0 +1,85 @@
#pragma once
#include <string>
#include <fstream>
#include <sstream>
#include <optional>
#include "Paths.h"
#include "Events.h"
namespace Artifact {
namespace Events {
struct SettingChanged {
std::string key;
std::optional<std::string> value;
};
}
class Settings: public EventTarget {
const Path path;
std::unordered_map<std::string, std::string> data;
public:
Settings();
Settings(Path path);
void reload();
void save();
template<typename T>
T get(std::string & key, const T & fallback = {}) {
auto it = data.find(key);
if (it == data.end()) {
return fallback;
}
const std::string & str = it->second;
if constexpr (std::is_same_v<T, std::string>) {
return str;
}
if constexpr (std::is_same_v<T, bool>) {
std::string lower = str;
std::transform(lower.begin(), lower.end(), lower.begin(),
[](unsigned char c){ return static_cast<char>(std::tolower(c)); });
if (lower == "true" || lower == "1" || lower == "yes" || lower == "on") {
return true;
}
if (lower == "false" || lower == "0" || lower == "no" || lower == "off") {
return false;
}
return fallback;
}
std::istringstream iss(str);
T value;
if (iss >> value) {
return value;
}
return fallback;
}
template<typename T>
void set(const std::string & key, const T & value) {
std::ostringstream oss;
oss << std::boolalpha << value;
data[key] = oss.str();
dispatch(Events::SettingChanged { .key = key, .value = value });
}
void reset(const std::string & key) {
data.erase(key);
dispatch(Events::SettingChanged { .key = key, .value = std::nullopt });
}
void clear() {
data.clear();
}
};
}

View file

@ -1,7 +1,11 @@
#include <iostream>
#include "Shared.h" #include "Shared.h"
namespace Artifact { namespace Artifact {
void log(std::string msg) {
std::cout << msg << std::endl;
}
} }

View file

@ -75,12 +75,73 @@ public:
class BaseSubsystem { class BaseSubsystem {
public: public:
Engine<BaseSubsystem> * engine = nullptr;
virtual void init() {} virtual void init() {}
virtual void reload() {} virtual void reload() {}
virtual void deinit() {} virtual void deinit() {}
virtual void render() {}
virtual void tick() {}
}; };
template<typename T> requires std::integral<T> || std::floating_point<T>
class Composed {
enum ModifierType {
Add, Multiply
};
using Modifier = std::pair<ModifierType, T>;
uint64_t nextID = 0;
std::vector<Modifier> modifiers;
T _value;
public:
Composed() : Composed(T{0}) {}
Composed(T base) {
add(Add, base);
}
T value() {
return _value;
}
void recompute() {
T sum;
T fac;
for (auto [type, value] : modifiers) {
if (type == Add) {
sum += value;
} else if (type == Multiply) {
fac *= value;
}
}
_value = sum * fac;
}
uint64_t add(ModifierType type, T value) {
modifiers.emplace_back(type, value);
recompute();
return nextID++;
}
bool remove(uint64_t id) {
auto it = std::find_if(modifiers.begin(), modifiers.end(),
[id](const Modifier & m) { return m.id == id; });
if (it == modifiers.end()) return false;
modifiers.erase(it);
recompute();
return true;
}
bool update(uint64_t id, T newValue) {
auto it = std::find_if(modifiers.begin(), modifiers.end(),
[id](const Modifier& m) { return m.id == id; });
if (it == modifiers.end()) return false;
it->value = newValue;
recompute();
return true;
}
};
void log(std::string msg);
} }

View file

@ -4,6 +4,7 @@
#include <Client.h> #include <Client.h>
#include <Server.h> #include <Server.h>
#include <Network/Network.h> #include <Network/Network.h>
#include <Paths.h>
using namespace Artifact; using namespace Artifact;
@ -25,6 +26,8 @@ int main(int argc, const char * argv[]) {
} }
} }
getDataPath();
Client client; Client client;
client.addDefaultSubsystems(); client.addDefaultSubsystems();