diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6df771 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/ArtifactEngine.xcodeproj/ +/ArtifactEngine.xcodeproj diff --git a/ArtifactEngine.xcodeproj/project.pbxproj b/ArtifactEngine.xcodeproj/project.pbxproj deleted file mode 100644 index 74c9ffa..0000000 --- a/ArtifactEngine.xcodeproj/project.pbxproj +++ /dev/null @@ -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 = ""; }; - 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 = ""; }; - 9B20EE972F4BC6C600117DD8 /* libngtcp2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libngtcp2.a; path = "../../../eclipse-workspace/ArtifactEngine/deps/ngtcp2/build/lib/libngtcp2.a"; sourceTree = ""; }; - 9B20EE9B2F4BCF7D00117DD8 /* libglfw3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libglfw3.a; path = "../../../eclipse-workspace/ArtifactEngine/deps/glfw/install/lib/libglfw3.a"; sourceTree = ""; }; - 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 = ""; }; - 9B20EEC32F4D141600117DD8 /* libev.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libev.a; path = ../../../homebrew/Cellar/libev/4.33/lib/libev.a; sourceTree = ""; }; - 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 = ""; - }; - 9B20EE522F4BBF0A00117DD8 /* Server */ = { - isa = PBXFileSystemSynchronizedRootGroup; - exceptions = ( - 9B20EE7A2F4BC10500117DD8 /* Exceptions for "Server" folder in "Server" target */, - ); - path = Server; - sourceTree = ""; - }; - 9B20EE552F4BBF0D00117DD8 /* Shared */ = { - isa = PBXFileSystemSynchronizedRootGroup; - exceptions = ( - 9B20EE842F4BC11700117DD8 /* Exceptions for "Shared" folder in "Shared" target */, - ); - path = Shared; - sourceTree = ""; - }; - 9B20EE5B2F4BBF4800117DD8 /* TestGame */ = { - isa = PBXFileSystemSynchronizedRootGroup; - path = TestGame; - sourceTree = ""; - }; -/* 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 = ""; - }; - 9B20EE322F4BBE9600117DD8 /* Products */ = { - isa = PBXGroup; - children = ( - 9B20EE5A2F4BBF4800117DD8 /* TestGame */, - 9B20EE672F4BC09C00117DD8 /* libClient.a */, - 9B20EE752F4BC0FD00117DD8 /* libServer.a */, - 9B20EE7F2F4BC11100117DD8 /* libShared.a */, - ); - name = Products; - sourceTree = ""; - }; - 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 = ""; - }; -/* 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 */; -} diff --git a/ArtifactEngine.xcodeproj/xcuserdata/iboettcher.xcuserdatad/xcschemes/xcschememanagement.plist b/ArtifactEngine.xcodeproj/xcuserdata/iboettcher.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index b315a37..0000000 --- a/ArtifactEngine.xcodeproj/xcuserdata/iboettcher.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - SchemeUserState - - ArtifactEngine.xcscheme_^#shared#^_ - - orderHint - 0 - - Client.xcscheme_^#shared#^_ - - orderHint - 2 - - Server.xcscheme_^#shared#^_ - - orderHint - 3 - - Shared.xcscheme_^#shared#^_ - - orderHint - 4 - - TestGame.xcscheme_^#shared#^_ - - orderHint - 1 - - glfw3webgpu.xcscheme_^#shared#^_ - - orderHint - 5 - - - - diff --git a/Client/Client.cpp b/Client/Client.cpp index ad55db9..d21cb4e 100644 --- a/Client/Client.cpp +++ b/Client/Client.cpp @@ -1,6 +1,7 @@ #include #include "Client.h" +#include "Network.h" #include "Graphics/UIRenderer.h" #include "Graphics/Graphics.h" #include @@ -8,10 +9,10 @@ namespace Artifact { void Client::init() { - window = subsystem(); + window = subsystem(); for (auto & system : subsystems) { - system->engine = this; + system->client = this; system->init(); system->reload(); } @@ -45,7 +46,7 @@ void Client::tick() { void Client::addDefaultSubsystems() { addSubsystem(1080, 640, "Artifact Engine"); - addSubsystem(); + addSubsystem(); auto graphics = addSubsystem(); { graphics->addSubsystem(); diff --git a/Client/Client.h b/Client/Client.h index 6d760e5..4e328d6 100644 --- a/Client/Client.h +++ b/Client/Client.h @@ -3,14 +3,20 @@ #include #include "Shared.h" -#include "Platform/Window.h" +#include namespace Artifact { +class ClientSubsystem; +class WindowImpl; + /// The client class. -class Client: public Engine { +class Client: public Engine { public: - Window * window = nullptr; + WindowImpl * window = nullptr; + Settings settings; + + Client() : settings(getClientConfigPath()) {} void addDefaultSubsystems(); void initDefault(); @@ -24,4 +30,11 @@ public: void run(); }; +class ClientSubsystem: public BaseSubsystem { +public: + Client * client = nullptr; + virtual void render() {} + virtual void tick() {} +}; + } diff --git a/Client/Graphics/Camera.cpp b/Client/Graphics/Camera.cpp new file mode 100644 index 0000000..35d440d --- /dev/null +++ b/Client/Graphics/Camera.cpp @@ -0,0 +1,7 @@ +#include "Camera.h" + +namespace Artifact { + + + +} diff --git a/Client/Graphics/Camera.h b/Client/Graphics/Camera.h new file mode 100644 index 0000000..c0088cd --- /dev/null +++ b/Client/Graphics/Camera.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include + +#include +#include + +namespace Artifact { + +class Camera { +public: + glm::vec3 pos; + glm::quat rot; + double fov; + float near; + float far; + + std::vector renderPasses; + + Camera(glm::vec3 pos, double fov, float near, float far) : pos(pos), fov(fov), near(near), far(far) {} +}; + +} diff --git a/Client/Graphics/Graphics.cpp b/Client/Graphics/Graphics.cpp index e31ba21..589580b 100644 --- a/Client/Graphics/Graphics.cpp +++ b/Client/Graphics/Graphics.cpp @@ -8,7 +8,7 @@ namespace Artifact { void Graphics::init() { instance = wgpuCreateInstance(nullptr); - window = engine->subsystem(); + window = client->subsystem(); surface = window->createWGPUSurface(instance); diff --git a/Client/Graphics/Graphics.h b/Client/Graphics/Graphics.h index a607858..aa22c30 100644 --- a/Client/Graphics/Graphics.h +++ b/Client/Graphics/Graphics.h @@ -3,6 +3,7 @@ #include #include +#include "../Client.h" #include "../Platform/Window.h" namespace Artifact { @@ -18,7 +19,7 @@ public: virtual void render(WGPUTextureView nextTexture, WGPUCommandEncoder encoder) {} }; -class Graphics: public BaseSubsystem, public Engine { +class Graphics: public ClientSubsystem, public Engine { public: WGPUInstance instance = nullptr; WGPUSurface surface = nullptr; @@ -29,14 +30,11 @@ public: WGPUTextureView depthTextureView = nullptr; WGPUQueue queue = nullptr; - Window * window; + WindowImpl * window; void init() override; void deinit() override; void render() override; - void onSubsystemAdd(GraphicsSubsystem * system) { - system->graphics = this; - } WGPUTexture createTextureFromData(const void* data, uint32_t width, uint32_t height); WGPUTexture createTextureFromFile(const char* file); diff --git a/Client/Graphics/UIRenderer.cpp b/Client/Graphics/UIRenderer.cpp index 8213697..adae09e 100644 --- a/Client/Graphics/UIRenderer.cpp +++ b/Client/Graphics/UIRenderer.cpp @@ -14,14 +14,14 @@ struct DrawUI {}; } -static std::unordered_map ArtifactToNuklear {}; +static std::array(Key::Last) + 1> ArtifactToNuklear {}; namespace { static struct _nkInit { _nkInit() { // Populate the Artifact-to-Nuklear key map. -#define X(nuklear, artifact) ArtifactToNuklear[Key::artifact] = nuklear +#define X(nuklear, artifact) ArtifactToNuklear[static_cast(Key::artifact)] = nuklear X(NK_KEY_CTRL, ControlLeft); X(NK_KEY_CTRL, ControlRight); @@ -47,37 +47,36 @@ static struct _nkInit { void UIRenderer::init() { printf("UI: %p", graphics); - window = graphics->window; - window->listen([this](auto ev) { + graphics->window->listen([this](auto ev) { nk_input_begin(&ctx); }); - window->listen([this](auto ev) { + graphics->window->listen([this](auto ev) { nk_input_end(&ctx); }); - window->listen([this](auto ev) { + graphics->window->listen([this](auto ev) { nk_input_motion(&ctx, ev.x, ev.y); }); - window->listen([this](auto ev) { + graphics->window->listen([this](auto ev) { nk_input_scroll(&ctx, nk_vec2(ev.dx, ev.dy)); }); - window->listen([this](auto ev) { + graphics->window->listen([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); }); - window->listen([this](auto ev) { - nk_input_key(&ctx, ArtifactToNuklear[ev.key], true); + graphics->window->listen([this](auto ev) { + nk_input_key(&ctx, ArtifactToNuklear[static_cast(ev.key)], true); }); - window->listen([this](auto ev) { - nk_input_key(&ctx, ArtifactToNuklear[ev.key], false); + graphics->window->listen([this](auto ev) { + nk_input_key(&ctx, ArtifactToNuklear[static_cast(ev.key)], false); }); - window->listen([this](auto ev) { + graphics->window->listen([this](auto ev) { nk_input_char(&ctx, ev.codepoint); }); @@ -102,7 +101,6 @@ void UIRenderer::init() { fclose(fontFile); font = nk_font_atlas_add_from_memory(&atlas, fontData, fontSize, 13.0f, nullptr); } 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); } diff --git a/Client/Graphics/UIRenderer.h b/Client/Graphics/UIRenderer.h index 9e2c6e4..7c32f29 100644 --- a/Client/Graphics/UIRenderer.h +++ b/Client/Graphics/UIRenderer.h @@ -21,7 +21,6 @@ class UIRenderer: public GraphicsSubsystem, public EventTarget { nk_font_atlas atlas {}; WGPURenderPipeline pipeline = nullptr; - Window * window = nullptr; WGPUBuffer vertexBuffer = nullptr; WGPUBuffer indexBuffer = nullptr; diff --git a/Client/Graphics/WorldRenderer.h b/Client/Graphics/WorldRenderer.h index 45dcbb0..56c16d3 100644 --- a/Client/Graphics/WorldRenderer.h +++ b/Client/Graphics/WorldRenderer.h @@ -1,3 +1,11 @@ #pragma once +#include +namespace Artifact { + +class WorldRenderer { + +}; + +} diff --git a/Client/LocalPlayer.cpp b/Client/LocalPlayer.cpp new file mode 100644 index 0000000..3fbaba6 --- /dev/null +++ b/Client/LocalPlayer.cpp @@ -0,0 +1,17 @@ +#include "LocalPlayer.h" + +#include "Platform/Window.h" + +namespace Artifact { + +void LocalPlayer::init() { + window = client->subsystem(); +} + +void LocalPlayer::tick() { + if (window->isKeyDown(Key::W)) { + + } +} + +} diff --git a/Client/LocalPlayer.h b/Client/LocalPlayer.h new file mode 100644 index 0000000..395ac16 --- /dev/null +++ b/Client/LocalPlayer.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "Client.h" +#include "Graphics/Camera.h" + +namespace Artifact { + +class LocalPlayerImpl: public ClientSubsystem { +public: + std::unique_ptr camera = nullptr; +}; + +class LocalPlayer: public LocalPlayerImpl { + WindowImpl * window = nullptr; + +public: + LocalPlayer() { + //camera = std::make_unique(glm::vec3(0, 0, 0), 75); + } + + void init() override; + void tick() override; +}; + +} diff --git a/Client/Network.h b/Client/Network.h new file mode 100644 index 0000000..4340e6e --- /dev/null +++ b/Client/Network.h @@ -0,0 +1,11 @@ +#pragma once + +#include "Client.h" +#include + +namespace Artifact { + +class ClientNetwork: public NetworkClient, public ClientSubsystem {}; + +} + diff --git a/Client/Platform/Window.cpp b/Client/Platform/Window.cpp index 23f4d7a..e482e50 100644 --- a/Client/Platform/Window.cpp +++ b/Client/Platform/Window.cpp @@ -6,6 +6,7 @@ namespace Artifact { static std::array GLFWToArtifact {}; +static std::array(Key::Last) + 1> ArtifactToGLFW {}; namespace { // 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. GLFWToArtifact.fill(Key::Unknown); -#define X(glfw, artifact) GLFWToArtifact[glfw] = Key::artifact +#define X(glfw, artifact) GLFWToArtifact[glfw] = Key::artifact;\ + ArtifactToGLFW[static_cast(Key::artifact)] = glfw X(GLFW_KEY_A, A); X(GLFW_KEY_B, B); X(GLFW_KEY_C, C); @@ -160,4 +162,16 @@ bool Window::shouldClose() { 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(key)]) == GLFW_PRESS; +} + } diff --git a/Client/Platform/Window.h b/Client/Platform/Window.h index d3391d6..7349acf 100644 --- a/Client/Platform/Window.h +++ b/Client/Platform/Window.h @@ -4,8 +4,9 @@ #include #include -#include "Shared.h" +#include #include "Events.h" +#include "Client.h" namespace Artifact { @@ -23,6 +24,8 @@ enum class Key { DeleteForward, DeleteBackward, ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Tab, + + Last }; 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: GLFWwindow * window = nullptr; public: @@ -80,9 +92,12 @@ public: void render() override; - WGPUSurface createWGPUSurface(WGPUInstance instance); + WGPUSurface createWGPUSurface(WGPUInstance instance) override; void setTitle(std::string title); - bool shouldClose(); + bool shouldClose() override; + void setPointerLock() override; + void releasePointerLock() override; + bool isKeyDown(Key key) override; }; } diff --git a/Client/World/Player.cpp b/Client/World/Player.cpp deleted file mode 100644 index e02e7e5..0000000 --- a/Client/World/Player.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "Player.h" - - diff --git a/Client/World/Player.h b/Client/World/Player.h deleted file mode 100644 index 584846d..0000000 --- a/Client/World/Player.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include - -namespace Artifact { - -class Player: public BaseSubsystem { - -}; - -} diff --git a/Server/Network.h b/Server/Network.h new file mode 100644 index 0000000..45d27d3 --- /dev/null +++ b/Server/Network.h @@ -0,0 +1,10 @@ +#pragma once + +#include +#include "Server.h" + +namespace Artifact { + +class ServerNetwork: public NetworkServer, public ServerSubsystem {}; + +} diff --git a/Server/Player.cpp b/Server/Player.cpp new file mode 100644 index 0000000..94dcb6f --- /dev/null +++ b/Server/Player.cpp @@ -0,0 +1,7 @@ +#include "Player.h" + +namespace Artifact { + + + +} diff --git a/Server/Player.h b/Server/Player.h new file mode 100644 index 0000000..b3693af --- /dev/null +++ b/Server/Player.h @@ -0,0 +1,9 @@ +#pragma once + +namespace Artifact { + +class Player { + +}; + +} diff --git a/Server/Server.cpp b/Server/Server.cpp index 094bcae..5d77685 100644 --- a/Server/Server.cpp +++ b/Server/Server.cpp @@ -1,14 +1,37 @@ #include "Server.h" -#include "Network/Network.h" +#include "Network.h" +#include "World/WorldManager.h" namespace Artifact { +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() { - addSubsystem(); + addSubsystem(); + addSubsystem(); } } diff --git a/Server/Server.h b/Server/Server.h index da1dfee..3fd6cf7 100644 --- a/Server/Server.h +++ b/Server/Server.h @@ -1,13 +1,28 @@ #pragma once #include "Shared.h" +#include namespace Artifact { -class Server: public Engine { +class ServerSubsystem; + +class Server: public Engine { public: + Settings settings; + + Server() : settings(getServerConfigPath()) {} + + void init(); + void tick(); void run(); void addDefaultSubsystems(); }; +class ServerSubsystem: public BaseSubsystem { +public: + Server * server = nullptr; + virtual void tick() {} +}; + } diff --git a/Server/World/WorldBackend.cpp b/Server/World/WorldBackend.cpp new file mode 100644 index 0000000..611d601 --- /dev/null +++ b/Server/World/WorldBackend.cpp @@ -0,0 +1,7 @@ +// +// WorldBackend.cpp +// ArtifactEngine +// +// Created by Isaac Boettcher on 3/11/26. +// + diff --git a/Server/World/WorldBackend.h b/Server/World/WorldBackend.h new file mode 100644 index 0000000..7206be6 --- /dev/null +++ b/Server/World/WorldBackend.h @@ -0,0 +1,10 @@ +#pragma once + +namespace Artifact { + +class WorldBackend { + virtual void saveChunk(); + virtual void loadChukn(); +}; + +} diff --git a/Server/World/WorldManager.cpp b/Server/World/WorldManager.cpp new file mode 100644 index 0000000..e2e4e43 --- /dev/null +++ b/Server/World/WorldManager.cpp @@ -0,0 +1,11 @@ +#include "WorldManager.h" + +#include + +namespace Artifact { + +void WorldManager::tick() { + +} + +} diff --git a/Server/World/WorldManager.h b/Server/World/WorldManager.h new file mode 100644 index 0000000..9e58f4c --- /dev/null +++ b/Server/World/WorldManager.h @@ -0,0 +1,16 @@ +#pragma once + +#include +#include "../Server.h" + +namespace Artifact { + +class WorldManagerImpl: public ServerSubsystem { + +}; + +class WorldManager: public WorldManagerImpl { + void tick() override; +}; + +} diff --git a/Shared/Paths.cpp b/Shared/Paths.cpp new file mode 100644 index 0000000..9ae3359 --- /dev/null +++ b/Shared/Paths.cpp @@ -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"; +} + +} diff --git a/Shared/Paths.h b/Shared/Paths.h new file mode 100644 index 0000000..ebebed7 --- /dev/null +++ b/Shared/Paths.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include + +#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(); + +} diff --git a/Shared/Settings.cpp b/Shared/Settings.cpp new file mode 100644 index 0000000..4e6a84c --- /dev/null +++ b/Shared/Settings.cpp @@ -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'; + } +} + +} diff --git a/Shared/Settings.h b/Shared/Settings.h new file mode 100644 index 0000000..96c03ca --- /dev/null +++ b/Shared/Settings.h @@ -0,0 +1,85 @@ +#pragma once + +#include +#include +#include +#include + +#include "Paths.h" +#include "Events.h" + +namespace Artifact { + +namespace Events { + +struct SettingChanged { + std::string key; + std::optional value; +}; + +} + +class Settings: public EventTarget { + const Path path; + std::unordered_map data; +public: + Settings(); + Settings(Path path); + + void reload(); + void save(); + + template + 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) { + return str; + } + + if constexpr (std::is_same_v) { + std::string lower = str; + std::transform(lower.begin(), lower.end(), lower.begin(), + [](unsigned char c){ return static_cast(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 + 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(); + } +}; + +} diff --git a/Shared/Shared.cpp b/Shared/Shared.cpp index 12dcdeb..901b81b 100644 --- a/Shared/Shared.cpp +++ b/Shared/Shared.cpp @@ -1,7 +1,11 @@ +#include + #include "Shared.h" namespace Artifact { - +void log(std::string msg) { + std::cout << msg << std::endl; +} } diff --git a/Shared/Shared.h b/Shared/Shared.h index e5dc417..62d745d 100644 --- a/Shared/Shared.h +++ b/Shared/Shared.h @@ -75,12 +75,73 @@ public: class BaseSubsystem { public: - Engine * engine = nullptr; virtual void init() {} virtual void reload() {} virtual void deinit() {} - virtual void render() {} - virtual void tick() {} }; +template requires std::integral || std::floating_point +class Composed { + enum ModifierType { + Add, Multiply + }; + using Modifier = std::pair; + + uint64_t nextID = 0; + + std::vector 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); + } diff --git a/TestGame/main.cpp b/TestGame/main.cpp index 1d90a00..c503815 100644 --- a/TestGame/main.cpp +++ b/TestGame/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include using namespace Artifact; @@ -25,6 +26,8 @@ int main(int argc, const char * argv[]) { } } + getDataPath(); + Client client; client.addDefaultSubsystems();