From d90a0bdf8310d47da7caca6f8d48d9b326f456e0 Mon Sep 17 00:00:00 2001 From: Patedam Date: Sun, 9 Feb 2025 22:19:17 -0500 Subject: [PATCH] Added first pass on swap chain. Still needs Render Target View and various stuff. + Reformat all files --- Game/Entity/Entity.h | 3 +- Game/Entity/EntityManager.h | 6 +- Game/Game.vcxproj | 216 +++---- Game/dllmain.cpp | 2 +- Juliet/Juliet.vcxproj | 600 +++++++++--------- Juliet/include/Core/Common/CRC32.h | 2 +- Juliet/include/Core/Common/CoreUtils.h | 2 +- Juliet/include/Core/Container/Vector.h | 3 +- Juliet/include/Core/DynLib/DynamicLibrary.h | 2 +- Juliet/include/Core/HAL/Display/Display.h | 4 +- Juliet/include/Engine/Class.h | 2 +- Juliet/include/Graphics/Graphics.h | 10 +- Juliet/include/pch.h | 2 +- Juliet/src/Core/Common/CoreUtils.cpp | 2 +- Juliet/src/Core/HAL/Display/Display.cpp | 3 +- .../HAL/Display/Win32/Win32DisplayDevice.cpp | 1 - .../HAL/Display/Win32/Win32DisplayDevice.h | 6 - .../Core/HAL/Display/Win32/Win32Window.cpp | 1 - .../src/Core/HAL/Display/Win32/Win32Window.h | 1 + Juliet/src/Core/Networking/Socket.cpp | 6 +- Juliet/src/Core/Networking/TcpListener.cpp | 5 +- Juliet/src/Core/Networking/TcpSocket.cpp | 5 +- .../Win32/Win32SocketPlatformImpl.cpp | 123 ++-- Juliet/src/Graphics/D3D12/DX12CommandList.cpp | 15 +- Juliet/src/Graphics/D3D12/DX12CommandList.h | 2 +- .../src/Graphics/D3D12/DX12GraphicsDevice.cpp | 56 +- .../src/Graphics/D3D12/DX12GraphicsDevice.h | 24 +- Juliet/src/Graphics/D3D12/DX12Includes.h | 4 +- Juliet/src/Graphics/D3D12/DX12SwapChain.cpp | 104 +++ Juliet/src/Graphics/D3D12/DX12SwapChain.h | 11 + Juliet/src/Graphics/D3D12/DX12Utils.cpp | 61 ++ Juliet/src/Graphics/D3D12/DX12Utils.h | 14 +- Juliet/src/Graphics/Graphics.cpp | 14 + Juliet/src/Graphics/GraphicsDevice.h | 12 +- JulietApp/Editor/EditorMain_win32.cpp | 18 +- JulietApp/Editor/EditorMain_win32.h | 8 +- JulietApp/JulietApp.vcxproj | 230 +++---- 37 files changed, 944 insertions(+), 636 deletions(-) delete mode 100644 Juliet/src/Core/HAL/Display/Win32/Win32DisplayDevice.h create mode 100644 Juliet/src/Graphics/D3D12/DX12SwapChain.cpp create mode 100644 Juliet/src/Graphics/D3D12/DX12SwapChain.h create mode 100644 Juliet/src/Graphics/D3D12/DX12Utils.cpp diff --git a/Game/Entity/Entity.h b/Game/Entity/Entity.h index 30ff11f..4e1db31 100644 --- a/Game/Entity/Entity.h +++ b/Game/Entity/Entity.h @@ -30,8 +30,7 @@ namespace Game }; template - concept EntityConcept = requires(EntityType entity) - { + concept EntityConcept = requires(EntityType entity) { requires std::same_as; requires std::same_as; }; diff --git a/Game/Entity/EntityManager.h b/Game/Entity/EntityManager.h index 10455ef..e2e0d42 100644 --- a/Game/Entity/EntityManager.h +++ b/Game/Entity/EntityManager.h @@ -13,7 +13,7 @@ namespace Game // May be this should contains the allocator for each entity types }; - void InitEntityManager();\ + void InitEntityManager(); EntityManager& GetEntityManager(); - void RegisterEntity(EntityManager& manager, Entity* entity); -} + void RegisterEntity(EntityManager& manager, Entity* entity); +} // namespace Game diff --git a/Game/Game.vcxproj b/Game/Game.vcxproj index 7d7fd0a..f112a2b 100644 --- a/Game/Game.vcxproj +++ b/Game/Game.vcxproj @@ -1,111 +1,111 @@ - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {B7B12DCC-1A69-4371-A9FE-D6E7671497B0} - Win32Proj - Game - 10.0.26100.0 - - - - x64 - - - DynamicLibrary - true - ClangCL - Unicode - - - DynamicLibrary - false - ClangCL - true - Unicode - - - - - - - - - - - - - - - true - $(SolutionDir)Juliet\include\;$(SolutionDir)Game;$(IncludePath) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\;$(LibraryPath) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ - - - false - - - - NotUsing - Level3 - Disabled - true - _DEBUG;CPPDYNAMICLIBRARYTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - pch.h - stdcpp20 - - - Windows - true - - - - - NotUsing - Level3 - MaxSpeed - true - true - true - NDEBUG;CPPDYNAMICLIBRARYTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - pch.h - - - Windows - true - true - true - - - - - - - - - {1bbc0b92-e4d8-4838-974b-439c5c501e82} - Juliet - - - - - - - - - + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {B7B12DCC-1A69-4371-A9FE-D6E7671497B0} + Win32Proj + Game + 10.0.26100.0 + + + + x64 + + + DynamicLibrary + true + ClangCL + Unicode + + + DynamicLibrary + false + ClangCL + true + Unicode + + + + + + + + + + + + + + + true + $(SolutionDir)Juliet\include\;$(SolutionDir)Game;$(IncludePath) + $(SolutionDir)\bin\$(Platform)\$(Configuration)\;$(LibraryPath) + $(SolutionDir)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ + + + false + + + + NotUsing + Level3 + Disabled + true + _DEBUG;CPPDYNAMICLIBRARYTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + stdcpp20 + + + Windows + true + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + NDEBUG;CPPDYNAMICLIBRARYTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + true + true + + + + + + + + + {1bbc0b92-e4d8-4838-974b-439c5c501e82} + Juliet + + + + + + + + + \ No newline at end of file diff --git a/Game/dllmain.cpp b/Game/dllmain.cpp index ac4b1ff..97e8886 100644 --- a/Game/dllmain.cpp +++ b/Game/dllmain.cpp @@ -37,7 +37,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv Door* door = MakeEntity(manager, 10.0f, 2.0f); door->IsOpened = true; - Entity* ent = door->Base; + Entity* ent = door->Base; Door* stillDoor = DownCast(ent); Assert(door == stillDoor); diff --git a/Juliet/Juliet.vcxproj b/Juliet/Juliet.vcxproj index 354d512..7ca703f 100644 --- a/Juliet/Juliet.vcxproj +++ b/Juliet/Juliet.vcxproj @@ -1,302 +1,304 @@ - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {1bbc0b92-e4d8-4838-974b-439c5c501e82} - Juliet - 10.0.26100.0 - - - - DynamicLibrary - true - ClangCL - Unicode - - - DynamicLibrary - false - ClangCL - true - Unicode - - - - - - - - - - - - - - - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ - $(SolutionDir)Juliet\include\;$(SolutionDir)Juliet\src\;$(SolutionDir)Juliet\src\Graphics\D3D12\;$(IncludePath) - - - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ - $(SolutionDir)Juliet\include\;$(SolutionDir)Juliet\src\;$(SolutionDir)Juliet\src\Graphics\D3D12\;$(IncludePath) - - - - Level3 - true - _DEBUG;JULIET_EXPORT;JULIET_WIN32;%(PreprocessorDefinitions) - true - Use - pch.h - stdcpp20 - Fast - false - false - - - - - true - ws2_32.lib;dxgi.lib;dxguid.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) - - - - - - - - - Level3 - true - true - true - NDEBUG;JULIET_EXPORT;JULIET_WIN32;%(PreprocessorDefinitions) - true - Use - pch.h - stdcpp20 - Fast - false - false - - - - - true - true - true - ws2_32.lib;d3d12.lib;dxgi.lib;dxguid.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MultiThreadedDebugDll - Disabled - true - NoListing - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - false - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - Default - Default - Column - false - false - false - NotSet - Fast - Default - false - stdcpp20 - Default - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - false - Neither - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - Cdecl - Use - pch.h - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\Juliet.pch - false - false - false - false - false - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - true - true - false - Default - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\Juliet.tlog\ - true - false - Level3 - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - ProgramDatabase - false - false - true - _DEBUG;JULIET_EXPORT;JULIET_WIN32;_WINDLL;_UNICODE;UNICODE; - false - true - true - Default - --target=amd64-pc-windows-msvc - - - - - - - - - - - - - - - - - - - - - - - MultiThreadedDebugDll - Disabled - true - NoListing - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - false - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - Default - Default - Column - false - false - false - NotSet - Fast - Default - false - stdcpp20 - Default - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - false - Neither - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - Cdecl - Use - pch.h - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\Juliet.pch - false - false - false - false - false - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - true - true - false - Default - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\Juliet.tlog\ - true - false - Level3 - W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ - ProgramDatabase - false - false - true - _DEBUG;_LIB;JULIET_WIN32;_UNICODE;UNICODE; - false - true - true - Default - --target=amd64-pc-windows-msvc - - - Create - Create - - - - - - - - + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {1bbc0b92-e4d8-4838-974b-439c5c501e82} + Juliet + 10.0.26100.0 + + + + DynamicLibrary + true + ClangCL + Unicode + + + DynamicLibrary + false + ClangCL + true + Unicode + + + + + + + + + + + + + + + $(SolutionDir)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ + $(SolutionDir)Juliet\include\;$(SolutionDir)Juliet\src\;$(SolutionDir)Juliet\src\Graphics\D3D12\;$(IncludePath) + + + $(SolutionDir)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ + $(SolutionDir)Juliet\include\;$(SolutionDir)Juliet\src\;$(SolutionDir)Juliet\src\Graphics\D3D12\;$(IncludePath) + + + + Level3 + true + _DEBUG;JULIET_EXPORT;JULIET_WIN32;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + Fast + false + false + + + + + true + ws2_32.lib;dxgi.lib;dxguid.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + + + + + + + + + Level3 + true + true + true + NDEBUG;JULIET_EXPORT;JULIET_WIN32;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + Fast + false + false + + + + + true + true + true + ws2_32.lib;d3d12.lib;dxgi.lib;dxguid.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MultiThreadedDebugDll + Disabled + true + NoListing + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + false + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + Default + Default + Column + false + false + false + NotSet + Fast + Default + false + stdcpp20 + Default + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + false + Neither + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + Cdecl + Use + pch.h + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\Juliet.pch + false + false + false + false + false + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + true + true + false + Default + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\Juliet.tlog\ + true + false + Level3 + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + ProgramDatabase + false + false + true + _DEBUG;JULIET_EXPORT;JULIET_WIN32;_WINDLL;_UNICODE;UNICODE; + false + true + true + Default + --target=amd64-pc-windows-msvc + + + + + + + + + + + + + + + + + + + + + + + + + MultiThreadedDebugDll + Disabled + true + NoListing + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + false + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + Default + Default + Column + false + false + false + NotSet + Fast + Default + false + stdcpp20 + Default + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + false + Neither + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + Cdecl + Use + pch.h + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\Juliet.pch + false + false + false + false + false + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + true + true + false + Default + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\Juliet.tlog\ + true + false + Level3 + W:\Classified\Juliet\Intermediate\Juliet\x64\Debug\ + ProgramDatabase + false + false + true + _DEBUG;_LIB;JULIET_WIN32;_UNICODE;UNICODE; + false + true + true + Default + --target=amd64-pc-windows-msvc + + + Create + Create + + + + + + + + \ No newline at end of file diff --git a/Juliet/include/Core/Common/CRC32.h b/Juliet/include/Core/Common/CRC32.h index 10d8588..c2c0117 100644 --- a/Juliet/include/Core/Common/CRC32.h +++ b/Juliet/include/Core/Common/CRC32.h @@ -42,7 +42,7 @@ namespace Juliet consteval uint32 crc32(const char* str, size_t length) { const char* p = str; - uint32_t crc = ~0U; + uint32_t crc = ~0U; while (length--) { crc = details::crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); diff --git a/Juliet/include/Core/Common/CoreUtils.h b/Juliet/include/Core/Common/CoreUtils.h index 97e3262..f769282 100644 --- a/Juliet/include/Core/Common/CoreUtils.h +++ b/Juliet/include/Core/Common/CoreUtils.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include namespace Juliet { diff --git a/Juliet/include/Core/Container/Vector.h b/Juliet/include/Core/Container/Vector.h index abddf5a..de44b51 100644 --- a/Juliet/include/Core/Container/Vector.h +++ b/Juliet/include/Core/Container/Vector.h @@ -5,7 +5,8 @@ namespace Juliet { // TODO : Create my own Vector class based on https://github.com/niklas-ourmachinery/bitsquid-foundation/blob/master/collection_types.h - template class Vector : public std::vector + template + class Vector : public std::vector { }; } // namespace Juliet diff --git a/Juliet/include/Core/DynLib/DynamicLibrary.h b/Juliet/include/Core/DynLib/DynamicLibrary.h index aeeb0df..894fbc0 100644 --- a/Juliet/include/Core/DynLib/DynamicLibrary.h +++ b/Juliet/include/Core/DynLib/DynamicLibrary.h @@ -10,5 +10,5 @@ namespace Juliet extern JULIET_API DynamicLibrary* LoadDynamicLibrary(const char* filename); extern JULIET_API FunctionPtr LoadFunction(NonNullPtr lib, const char* functionName); - extern JULIET_API void UnloadDynamicLibrary(NonNullPtr lib); + extern JULIET_API void UnloadDynamicLibrary(NonNullPtr lib); } // namespace Juliet diff --git a/Juliet/include/Core/HAL/Display/Display.h b/Juliet/include/Core/HAL/Display/Display.h index 070359e..0c80edc 100644 --- a/Juliet/include/Core/HAL/Display/Display.h +++ b/Juliet/include/Core/HAL/Display/Display.h @@ -1,8 +1,8 @@ #pragma once -#include #include #include +#include namespace Juliet { @@ -10,7 +10,7 @@ namespace Juliet using WindowID = uint8; extern JULIET_API Window* CreatePlatformWindow(const char* title, uint16 width, uint16 height, int flags = 0 /* unused */); - extern JULIET_API void DestroyPlatformWindow(NonNullPtr window); + extern JULIET_API void DestroyPlatformWindow(NonNullPtr window); extern JULIET_API void ShowWindow(NonNullPtr window); extern JULIET_API void HideWindow(NonNullPtr window); diff --git a/Juliet/include/Engine/Class.h b/Juliet/include/Engine/Class.h index 84c1b37..2b90b63 100644 --- a/Juliet/include/Engine/Class.h +++ b/Juliet/include/Engine/Class.h @@ -19,7 +19,7 @@ namespace Juliet CRC = crc32(className, name_length); #if JULIET_DEBUG // TODO: string struct may be - Name = className; + Name = className; Name_Length = name_length; #endif } diff --git a/Juliet/include/Graphics/Graphics.h b/Juliet/include/Graphics/Graphics.h index 48ab593..28b3c0c 100644 --- a/Juliet/include/Graphics/Graphics.h +++ b/Juliet/include/Graphics/Graphics.h @@ -7,6 +7,7 @@ // Graphics Interface namespace Juliet { + struct Window; struct GraphicsDevice; // Parameters of an indirect draw command @@ -45,11 +46,16 @@ namespace Juliet }; // Opaque types - struct CommandList {}; + struct CommandList; extern JULIET_API GraphicsDevice* CreateGraphicsDevice(GraphicsConfig config); extern JULIET_API void DestroyGraphicsDevice(NonNullPtr device); + // Attach To Window + extern JULIET_API bool AttachToWindow(NonNullPtr device, NonNullPtr window); + extern JULIET_API void DetachFromWindow(NonNullPtr device, NonNullPtr window); + + // Command List extern JULIET_API CommandList* AcquireCommandList(NonNullPtr device, QueueType queueType = QueueType::Graphics); - extern JULIET_API void SubmitCommandLists(NonNullPtr device); + extern JULIET_API void SubmitCommandLists(NonNullPtr device); } // namespace Juliet diff --git a/Juliet/include/pch.h b/Juliet/include/pch.h index f32bbc8..ef6a37c 100644 --- a/Juliet/include/pch.h +++ b/Juliet/include/pch.h @@ -7,10 +7,10 @@ #ifndef PCH_H #define PCH_H -#include #include #include #include #include +#include #endif // PCH_H diff --git a/Juliet/src/Core/Common/CoreUtils.cpp b/Juliet/src/Core/Common/CoreUtils.cpp index d07a605..46659d4 100644 --- a/Juliet/src/Core/Common/CoreUtils.cpp +++ b/Juliet/src/Core/Common/CoreUtils.cpp @@ -7,4 +7,4 @@ namespace Juliet Juliet::Log(Juliet::LogLevel::Error, Juliet::LogCategory::Core, expression); __debugbreak(); } -} \ No newline at end of file +} // namespace Juliet diff --git a/Juliet/src/Core/HAL/Display/Display.cpp b/Juliet/src/Core/HAL/Display/Display.cpp index 32542fb..16a96cb 100644 --- a/Juliet/src/Core/HAL/Display/Display.cpp +++ b/Juliet/src/Core/HAL/Display/Display.cpp @@ -21,8 +21,7 @@ namespace Juliet Assert(!CurrentDisplayDevice); DisplayDevice* candidateDevice = nullptr; - DisplayDeviceFactory* - candidateFactory = nullptr; + DisplayDeviceFactory* candidateFactory = nullptr; for (DisplayDeviceFactory* factory : Factories) { if (factory) diff --git a/Juliet/src/Core/HAL/Display/Win32/Win32DisplayDevice.cpp b/Juliet/src/Core/HAL/Display/Win32/Win32DisplayDevice.cpp index 7618b36..7c5f91a 100644 --- a/Juliet/src/Core/HAL/Display/Win32/Win32DisplayDevice.cpp +++ b/Juliet/src/Core/HAL/Display/Win32/Win32DisplayDevice.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include #include diff --git a/Juliet/src/Core/HAL/Display/Win32/Win32DisplayDevice.h b/Juliet/src/Core/HAL/Display/Win32/Win32DisplayDevice.h deleted file mode 100644 index 46ac501..0000000 --- a/Juliet/src/Core/HAL/Display/Win32/Win32DisplayDevice.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -namespace Juliet::Win32 -{ - -} diff --git a/Juliet/src/Core/HAL/Display/Win32/Win32Window.cpp b/Juliet/src/Core/HAL/Display/Win32/Win32Window.cpp index 0f86baf..590ce9b 100644 --- a/Juliet/src/Core/HAL/Display/Win32/Win32Window.cpp +++ b/Juliet/src/Core/HAL/Display/Win32/Win32Window.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include namespace Juliet::Win32 diff --git a/Juliet/src/Core/HAL/Display/Win32/Win32Window.h b/Juliet/src/Core/HAL/Display/Win32/Win32Window.h index 036cfb3..7d19ba6 100644 --- a/Juliet/src/Core/HAL/Display/Win32/Win32Window.h +++ b/Juliet/src/Core/HAL/Display/Win32/Win32Window.h @@ -2,6 +2,7 @@ #include #include +#include namespace Juliet { diff --git a/Juliet/src/Core/Networking/Socket.cpp b/Juliet/src/Core/Networking/Socket.cpp index 295dc6e..22c3a14 100644 --- a/Juliet/src/Core/Networking/Socket.cpp +++ b/Juliet/src/Core/Networking/Socket.cpp @@ -7,7 +7,11 @@ namespace Juliet { - Socket::Socket(Protocol protocol) : Handle(SocketImpl::GetInvalidSocketHandle()), ProtocolType(protocol) {} + Socket::Socket(Protocol protocol) + : Handle(SocketImpl::GetInvalidSocketHandle()) + , ProtocolType(protocol) + { + } Socket::~Socket() { diff --git a/Juliet/src/Core/Networking/TcpListener.cpp b/Juliet/src/Core/Networking/TcpListener.cpp index 089619b..f009127 100644 --- a/Juliet/src/Core/Networking/TcpListener.cpp +++ b/Juliet/src/Core/Networking/TcpListener.cpp @@ -7,7 +7,10 @@ namespace Juliet { - TcpListener::TcpListener() : Socket(Protocol::TCP) {} + TcpListener::TcpListener() + : Socket(Protocol::TCP) + { + } Socket::Status TcpListener::Listen(uint16 port, uint32 address) { diff --git a/Juliet/src/Core/Networking/TcpSocket.cpp b/Juliet/src/Core/Networking/TcpSocket.cpp index 7e84adf..87a8ea9 100644 --- a/Juliet/src/Core/Networking/TcpSocket.cpp +++ b/Juliet/src/Core/Networking/TcpSocket.cpp @@ -8,7 +8,10 @@ namespace Juliet { - TcpSocket::TcpSocket() : Socket(Protocol::TCP) {} + TcpSocket::TcpSocket() + : Socket(Protocol::TCP) + { + } Socket::RequestStatus TcpSocket::Send(NetworkPacket& packet) { diff --git a/Juliet/src/Core/Networking/Win32/Win32SocketPlatformImpl.cpp b/Juliet/src/Core/Networking/Win32/Win32SocketPlatformImpl.cpp index 4bcb867..297e92b 100644 --- a/Juliet/src/Core/Networking/Win32/Win32SocketPlatformImpl.cpp +++ b/Juliet/src/Core/Networking/Win32/Win32SocketPlatformImpl.cpp @@ -7,79 +7,78 @@ namespace Juliet::SocketImpl { -sockaddr_in CreateAddress(uint32 address, uint16 port) -{ - auto addr = sockaddr_in(); - addr.sin_addr.s_addr = htonl(address); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - - return addr; -} - -SOCKET GetInvalidSocketHandle() -{ - return INVALID_SOCKET; -} - -void Close(SOCKET socketHandle) -{ - ::closesocket(socketHandle); -} - -const char* GetErrorString() -{ - switch (WSAGetLastError()) + sockaddr_in CreateAddress(uint32 address, uint16 port) { - case WSAEWOULDBLOCK: return "WSAEWOULDBLOCK"; - case WSAEALREADY: return "WSAEALREADY"; - case WSAECONNABORTED: return "WSAECONNABORTED"; - case WSAECONNRESET: return "WSAECONNRESET"; - case WSAETIMEDOUT: return "WSAETIMEDOUT"; - case WSAENETRESET: return "WSAENETRESET"; - case WSAENOTCONN: return "WSAENOTCONN"; - case WSAEISCONN: return "WSAEISCONN"; - default: return "Other"; // TODO: Include the error number inside the string - } -} + auto addr = sockaddr_in(); + addr.sin_addr.s_addr = htonl(address); + addr.sin_family = AF_INET; + addr.sin_port = htons(port); -Socket::Status GetErrorStatus() -{ - switch (WSAGetLastError()) - { - case WSAEWOULDBLOCK: return Socket::Status::NotReady; - case WSAEALREADY: return Socket::Status::NotReady; - case WSAECONNABORTED: return Socket::Status::Disconnected; - case WSAECONNRESET: return Socket::Status::Disconnected; - case WSAETIMEDOUT: return Socket::Status::Disconnected; - case WSAENETRESET: return Socket::Status::Disconnected; - case WSAENOTCONN: return Socket::Status::Disconnected; - case WSAEISCONN: - return Socket::Status::Done; // when connecting a non-blocking socket - default: return Socket::Status::Error; + return addr; + } + + SOCKET GetInvalidSocketHandle() + { + return INVALID_SOCKET; + } + + void Close(SOCKET socketHandle) + { + ::closesocket(socketHandle); + } + + const char* GetErrorString() + { + switch (WSAGetLastError()) + { + case WSAEWOULDBLOCK: return "WSAEWOULDBLOCK"; + case WSAEALREADY: return "WSAEALREADY"; + case WSAECONNABORTED: return "WSAECONNABORTED"; + case WSAECONNRESET: return "WSAECONNRESET"; + case WSAETIMEDOUT: return "WSAETIMEDOUT"; + case WSAENETRESET: return "WSAENETRESET"; + case WSAENOTCONN: return "WSAENOTCONN"; + case WSAEISCONN: return "WSAEISCONN"; + default: return "Other"; // TODO: Include the error number inside the string + } + } + + Socket::Status GetErrorStatus() + { + switch (WSAGetLastError()) + { + case WSAEWOULDBLOCK: return Socket::Status::NotReady; + case WSAEALREADY: return Socket::Status::NotReady; + case WSAECONNABORTED: return Socket::Status::Disconnected; + case WSAECONNRESET: return Socket::Status::Disconnected; + case WSAETIMEDOUT: return Socket::Status::Disconnected; + case WSAENETRESET: return Socket::Status::Disconnected; + case WSAENOTCONN: return Socket::Status::Disconnected; + case WSAEISCONN: return Socket::Status::Done; // when connecting a non-blocking socket + default: return Socket::Status::Error; + } } -} } // namespace Juliet::SocketImpl namespace Juliet { -// Windows needs its socket dll to be initialized for the whole process -struct WSAAutoRelease -{ - WSAAutoRelease() + // Windows needs its socket dll to be initialized for the whole process + struct WSAAutoRelease { - WORD wVersionRequested = MAKEWORD(2, 2); - WSADATA wsaData; - if (WSAStartup(wVersionRequested, &wsaData) != 0) + WSAAutoRelease() { - Log(LogLevel::Error, LogCategory::Core, "Failed to startup WinSock2"); - return; + WORD wVersionRequested = MAKEWORD(2, 2); + WSADATA wsaData; + if (WSAStartup(wVersionRequested, &wsaData) != 0) + { + Log(LogLevel::Error, LogCategory::Core, "Failed to startup WinSock2"); + return; + } } - } - ~WSAAutoRelease() { WSACleanup(); } -}; + ~WSAAutoRelease() { WSACleanup(); } + }; -WSAAutoRelease gWSAautoRelease; + WSAAutoRelease gWSAautoRelease; } // namespace Juliet diff --git a/Juliet/src/Graphics/D3D12/DX12CommandList.cpp b/Juliet/src/Graphics/D3D12/DX12CommandList.cpp index 4653ccd..4d117cf 100644 --- a/Juliet/src/Graphics/D3D12/DX12CommandList.cpp +++ b/Juliet/src/Graphics/D3D12/DX12CommandList.cpp @@ -120,10 +120,21 @@ namespace Juliet::D3D12 return reinterpret_cast(commandList); } - void SubmitCommandLists(NonNullPtr driver) + bool SubmitCommandLists(NonNullPtr driver) { - auto* d3d12Driver = static_cast(driver.Get()); + auto* d3d12Driver = static_cast(driver.Get()); + bool success = true; + uint8 commandLastIndex = d3d12Driver->CommandListCount; + + // TODO : Get window data from the command list: We associate the swapchain texture to a window with a missing function + HRESULT result = IDXGISwapChain_Present(d3d12Driver->WindowData->SwapChain, 0, 1); + if (FAILED(result)) + { + success = false; + } + + return success; } } // namespace Juliet::D3D12 diff --git a/Juliet/src/Graphics/D3D12/DX12CommandList.h b/Juliet/src/Graphics/D3D12/DX12CommandList.h index 7d227c4..fb13f31 100644 --- a/Juliet/src/Graphics/D3D12/DX12CommandList.h +++ b/Juliet/src/Graphics/D3D12/DX12CommandList.h @@ -21,5 +21,5 @@ namespace Juliet::D3D12 }; extern CommandList* AcquireCommandList(NonNullPtr driver, QueueType queueType); - extern void SubmitCommandLists(NonNullPtr driver); + extern bool SubmitCommandLists(NonNullPtr driver); } // namespace Juliet::D3D12 diff --git a/Juliet/src/Graphics/D3D12/DX12GraphicsDevice.cpp b/Juliet/src/Graphics/D3D12/DX12GraphicsDevice.cpp index 887e911..d484939 100644 --- a/Juliet/src/Graphics/D3D12/DX12GraphicsDevice.cpp +++ b/Juliet/src/Graphics/D3D12/DX12GraphicsDevice.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -219,6 +220,53 @@ namespace Juliet::D3D12 Free(driver.Get()); } + bool AttachToWindow(NonNullPtr driver, NonNullPtr window) + { + auto* d3d12Driver = static_cast(driver.Get()); + + // TODO : Support more than one window + if (d3d12Driver->WindowData) + { + Assert(false && "D3D12 renderer already attached to the window. Right now we handle only one Window."); + return false; + } + + auto* windowData = static_cast(Calloc(1, sizeof(D3D12WindowData))); + if (!windowData) + { + Log(LogLevel::Error, LogCategory::Graphics, "OOM: D3D12WindowData"); + return false; + } + + windowData->Window = window; + + if (!CreateSwapChain(d3d12Driver, windowData)) + { + Log(LogLevel::Error, LogCategory::Graphics, "AttachToWindow failure: Cannot create Swap Chain."); + Free(windowData); + return false; + } + + d3d12Driver->WindowData = windowData; + // TODO : React to resize. Need event system. + + return true; + } + + void DetachFromWindow(NonNullPtr driver, NonNullPtr window) + { + auto* d3d12Driver = static_cast(driver.Get()); + + Assert(d3d12Driver->WindowData && "Trying to destroy a swapchain but no Window Data exists"); + + // TODO : Wait for any remaining work and release the fences. + + DestroySwapChain(d3d12Driver, d3d12Driver->WindowData); + + Free(d3d12Driver->WindowData); + d3d12Driver->WindowData = nullptr; + } + void DestroyGraphicsDevice(NonNullPtr device) { // Note: Its a down cast so clang suggest not to do it but we are totally sure about it. @@ -468,13 +516,19 @@ namespace Juliet::D3D12 } // Assign Functions to the device - device->DestroyDevice = DestroyGraphicsDevice; + device->DestroyDevice = DestroyGraphicsDevice; + + device->AttachToWindow = AttachToWindow; + device->DetachFromWindow = DetachFromWindow; + device->AcquireCommandList = AcquireCommandList; device->SubmitCommandLists = SubmitCommandLists; device->Driver = driver; driver->GraphicsDevice = device; + driver->FramesInFlight = 2; + return device; } } // namespace diff --git a/Juliet/src/Graphics/D3D12/DX12GraphicsDevice.h b/Juliet/src/Graphics/D3D12/DX12GraphicsDevice.h index 3644c65..2e0cc09 100644 --- a/Juliet/src/Graphics/D3D12/DX12GraphicsDevice.h +++ b/Juliet/src/Graphics/D3D12/DX12GraphicsDevice.h @@ -1,6 +1,7 @@ #pragma once -#include +#include +#include #include namespace Juliet @@ -10,6 +11,18 @@ namespace Juliet namespace Juliet::D3D12 { + struct D3D12CommandList; + + struct D3D12WindowData + { + Window* Window; + + IDXGISwapChain3* SwapChain; + uint8 SwapChainTextureCount; + + uint32 FrameCounter; + }; + struct D3D12Driver : GPUDriver { GraphicsDevice* GraphicsDevice; @@ -35,16 +48,19 @@ namespace Juliet::D3D12 IDXGIInfoQueue* DXGIInfoQueue; #endif + // Windows + // TODO: Support more than one window + D3D12WindowData* WindowData; + // Resources D3D12CommandList** AvailableCommandLists; uint8 AvailableCommandListCapacity; - bool IsTearingSupported : 1; + uint8 FramesInFlight; - // UMA + bool IsTearingSupported : 1; bool IsUMAAvailable : 1; bool IsUMACacheCoherent : 1; - bool GPUUploadHeapSupported : 1; }; } // namespace Juliet::D3D12 diff --git a/Juliet/src/Graphics/D3D12/DX12Includes.h b/Juliet/src/Graphics/D3D12/DX12Includes.h index 99d2398..8902c69 100644 --- a/Juliet/src/Graphics/D3D12/DX12Includes.h +++ b/Juliet/src/Graphics/D3D12/DX12Includes.h @@ -9,13 +9,13 @@ // Those define disable the C++ API. // It also prevents using d3dx12 because it only supports C++ :( #define COBJMACROS -#define CINTERFACE; +#define CINTERFACE ; #include -#include "d3d12.h" #include #include #include +#include "d3d12.h" #ifdef _DEBUG #include diff --git a/Juliet/src/Graphics/D3D12/DX12SwapChain.cpp b/Juliet/src/Graphics/D3D12/DX12SwapChain.cpp new file mode 100644 index 0000000..ed9e53b --- /dev/null +++ b/Juliet/src/Graphics/D3D12/DX12SwapChain.cpp @@ -0,0 +1,104 @@ +#include + +#include +#include +#include + +#include + +namespace Juliet::D3D12 +{ + bool CreateSwapChain(NonNullPtr driver, NonNullPtr windowData) + { + auto windowWin32State = static_cast(windowData->Window->State); + HWND windowHandle = windowWin32State->Handle; + if (!IsWindow(windowHandle)) + { + Assert(false && "windowWin32State->Handle is not a window handle ???"); + return false; + } + + // SDR. + // TODO: Not enough for HDR. but i have no way to test HDR easily except the steamdeck + DXGI_FORMAT swapChainFormat = DXGI_FORMAT_B8G8R8A8_UNORM; + + windowData->SwapChainTextureCount = std::clamp(driver->FramesInFlight, 2, 3); + + DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {}; + swapChainDesc.Width = 0; // Use the whole width + swapChainDesc.Height = 0; // Use the whole height + swapChainDesc.Format = swapChainFormat; + swapChainDesc.Stereo = 0; + swapChainDesc.SampleDesc.Count = 1; + swapChainDesc.SampleDesc.Quality = 0; + swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + swapChainDesc.BufferCount = windowData->SwapChainTextureCount; + swapChainDesc.Scaling = DXGI_SCALING_STRETCH; + swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; + swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_UNSPECIFIED; + if (driver->IsTearingSupported) + { + swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; + } + else + { + swapChainDesc.Flags = 0; + } + + DXGI_SWAP_CHAIN_FULLSCREEN_DESC swapChainFullscreenDesc = {}; + swapChainFullscreenDesc.RefreshRate.Numerator = 0; + swapChainFullscreenDesc.RefreshRate.Denominator = 0; + swapChainFullscreenDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; + swapChainFullscreenDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; + swapChainFullscreenDesc.Windowed = true; + + IDXGISwapChain1* swapChain = nullptr; + HRESULT result = + IDXGIFactory4_CreateSwapChainForHwnd(driver->DXGIFactory, reinterpret_cast(driver->GraphicsQueue), + windowHandle, &swapChainDesc, &swapChainFullscreenDesc, nullptr, &swapChain); + if (FAILED(result)) + { + LogError(driver, "Failed to create SwapChain", result); + return false; + } + + IDXGISwapChain3* swapChain3 = nullptr; + result = IDXGISwapChain1_QueryInterface(swapChain, IID_IDXGISwapChain3, reinterpret_cast(&swapChain3)); + IDXGISwapChain1_Release(swapChain); + if (FAILED(result)) + { + LogError(driver, "Could not query IDXGISwapChain3 interface", result); + return false; + } + + IDXGIFactory1* parentFactory = nullptr; + result = IDXGISwapChain3_GetParent(swapChain3, IID_IDXGIFactory1, reinterpret_cast(&parentFactory)); + if (FAILED(result)) + { + Log(LogLevel::Warning, LogCategory::Graphics, "Cannot get SwapChain Parent! Error Code: " HRESULT_FMT, result); + } + else + { + // Disable DXGI window crap + result = IDXGIFactory1_MakeWindowAssociation(parentFactory, windowHandle, DXGI_MWA_NO_WINDOW_CHANGES); + if (FAILED(result)) + { + Log(LogLevel::Warning, LogCategory::Graphics, "MakeWindowAssociation failed! Error Code: " HRESULT_FMT, result); + } + IDXGIFactory1_Release(parentFactory); + } + + IDXGISwapChain3_GetDesc1(swapChain3, &swapChainDesc); + if (FAILED(result)) + { + LogError(driver, "Failed to retrieve SwapChain descriptor", result); + return false; + } + windowData->SwapChain = swapChain3; + windowData->FrameCounter = 0; + + return true; + } + + void DestroySwapChain(NonNullPtr driver, NonNullPtr windowData) {} +} // namespace Juliet::D3D12 diff --git a/Juliet/src/Graphics/D3D12/DX12SwapChain.h b/Juliet/src/Graphics/D3D12/DX12SwapChain.h new file mode 100644 index 0000000..34b6e0e --- /dev/null +++ b/Juliet/src/Graphics/D3D12/DX12SwapChain.h @@ -0,0 +1,11 @@ +#pragma once +#include + +namespace Juliet::D3D12 +{ + struct D3D12Driver; + struct D3D12WindowData; + + extern bool CreateSwapChain(NonNullPtr driver, NonNullPtr windowData); + extern void DestroySwapChain(NonNullPtr driver, NonNullPtr windowData); +} diff --git a/Juliet/src/Graphics/D3D12/DX12Utils.cpp b/Juliet/src/Graphics/D3D12/DX12Utils.cpp new file mode 100644 index 0000000..b6e4380 --- /dev/null +++ b/Juliet/src/Graphics/D3D12/DX12Utils.cpp @@ -0,0 +1,61 @@ +#include + +#include +#include +#include + +#include + +namespace Juliet::D3D12 +{ + // From SDLGPU + // TODO Do my own version. + extern void LogError(NonNullPtr driver, const char* errorMessage, HRESULT result) + { +#define MAX_ERROR_LEN 1024 // FIXME: Arbitrary! + + // Buffer for text, ensure space for \0 terminator after buffer + char wszMsgBuff[MAX_ERROR_LEN + 1]; + DWORD dwChars; // Number of chars returned. + + if (result == DXGI_ERROR_DEVICE_REMOVED) + { + if (driver->D3D12Device) + { + result = ID3D12Device_GetDeviceRemovedReason(driver->D3D12Device); + } + } + + // Try to get the message from the system errors. + dwChars = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, result, 0, + wszMsgBuff, MAX_ERROR_LEN, NULL); + + // No message? Screw it, just post the code. + if (dwChars == 0) + { + Log(LogLevel::Error, LogCategory::Graphics, "%s! Error: " HRESULT_FMT, errorMessage, result); + return; + } + + // Ensure valid range + dwChars = std::min(dwChars, MAX_ERROR_LEN); + + // Trim whitespace from tail of message + while (dwChars > 0) + { + if (wszMsgBuff[dwChars - 1] <= ' ') + { + dwChars--; + } + else + { + break; + } + } + + // Ensure null-terminated string + wszMsgBuff[dwChars] = '\0'; + + Log(LogLevel::Error, LogCategory::Graphics, "%s! Error: %s" HRESULT_FMT, errorMessage, wszMsgBuff, result); + } +} // namespace Juliet::D3D12 diff --git a/Juliet/src/Graphics/D3D12/DX12Utils.h b/Juliet/src/Graphics/D3D12/DX12Utils.h index 493f748..c458fdc 100644 --- a/Juliet/src/Graphics/D3D12/DX12Utils.h +++ b/Juliet/src/Graphics/D3D12/DX12Utils.h @@ -2,8 +2,16 @@ #include -namespace Juliet +#ifdef _WIN32 +#define HRESULT_FMT "(0x%08lX)" +#else +#define HRESULT_FMT "(0x%08X)" +#endif + +namespace Juliet::D3D12 { + struct D3D12Driver; + inline void AssertOnFailure(HRESULT hr) { Assert(!!FAILED(hr)); @@ -16,4 +24,6 @@ namespace Juliet case E_POINTER: Assert(false && "Invalid Pointer"); } } -} // namespace Juliet::RHI::DX12 + + extern void LogError(NonNullPtr driver, const char* errorMessage, HRESULT result); +} // namespace Juliet::D3D12 diff --git a/Juliet/src/Graphics/Graphics.cpp b/Juliet/src/Graphics/Graphics.cpp index c02df20..1650f99 100644 --- a/Juliet/src/Graphics/Graphics.cpp +++ b/Juliet/src/Graphics/Graphics.cpp @@ -63,6 +63,20 @@ namespace Juliet device->DestroyDevice(device); } + bool AttachToWindow(NonNullPtr device, NonNullPtr window) + { + GPUDriver* driver = device->Driver; + bool result = device->AttachToWindow(driver, window); + + return result; + } + + void DetachFromWindow(NonNullPtr device, NonNullPtr window) + { + GPUDriver* driver = device->Driver; + device->DetachFromWindow(driver, window); + } + CommandList* AcquireCommandList(NonNullPtr device, QueueType queueType /* = QueueType::Graphics */) { GPUDriver* driver = device->Driver; diff --git a/Juliet/src/Graphics/GraphicsDevice.h b/Juliet/src/Graphics/GraphicsDevice.h index 5d55146..e68fb25 100644 --- a/Juliet/src/Graphics/GraphicsDevice.h +++ b/Juliet/src/Graphics/GraphicsDevice.h @@ -6,9 +6,11 @@ namespace Juliet { + struct Window; + struct GPUDriver { - uint8 CommandListCount; + uint8 CommandListCount; static constexpr uint8 kResourceBufferCount = 2; }; @@ -16,8 +18,14 @@ namespace Juliet struct GraphicsDevice { void (*DestroyDevice)(NonNullPtr self); + + // Attach to window + bool (*AttachToWindow)(NonNullPtr driver, NonNullPtr window); + void (*DetachFromWindow)(NonNullPtr driver, NonNullPtr window); + + // CommandLists CommandList* (*AcquireCommandList)(NonNullPtr driver, QueueType queueType); - void (*SubmitCommandLists)(NonNullPtr driver); + bool (*SubmitCommandLists)(NonNullPtr driver); const char* Name = "Unknown"; GPUDriver* Driver = nullptr; diff --git a/JulietApp/Editor/EditorMain_win32.cpp b/JulietApp/Editor/EditorMain_win32.cpp index 5181b25..f31cb36 100644 --- a/JulietApp/Editor/EditorMain_win32.cpp +++ b/JulietApp/Editor/EditorMain_win32.cpp @@ -31,18 +31,28 @@ void Win32EditorApplication::Init() MainWindow = CreatePlatformWindow("Juliet Editor", 1280, 720); - // TODO : Assign the graphics device to the main window (and detach) - Running = MainWindow != nullptr && GraphicsDevice != nullptr; - DynamicLibrary = LoadDynamicLibrary("Game.dll"); + if (Running) + { + AttachToWindow(GraphicsDevice, MainWindow); + Game = LoadDynamicLibrary("Game.dll"); + } } void Win32EditorApplication::Shutdown() { Log(LogLevel::Message, LogCategory::Editor, "Shutdown Editor Application..."); - UnloadDynamicLibrary(DynamicLibrary); + if (Game) + { + UnloadDynamicLibrary(Game); + } + + if (MainWindow && GraphicsDevice) + { + DetachFromWindow(GraphicsDevice, MainWindow); + } if (MainWindow) { diff --git a/JulietApp/Editor/EditorMain_win32.h b/JulietApp/Editor/EditorMain_win32.h index 86c8d9a..7a8c8a6 100644 --- a/JulietApp/Editor/EditorMain_win32.h +++ b/JulietApp/Editor/EditorMain_win32.h @@ -8,7 +8,7 @@ namespace Juliet { struct GraphicsDevice; struct Window; -} +} // namespace Juliet class Win32EditorApplication : public Juliet::IApplication { @@ -19,11 +19,11 @@ class Win32EditorApplication : public Juliet::IApplication bool IsRunning() override; private: - Juliet::Window* MainWindow = {}; + Juliet::Window* MainWindow = {}; Juliet::GraphicsDevice* GraphicsDevice = {}; - Juliet::DynamicLibrary* DynamicLibrary = {}; + Juliet::DynamicLibrary* Game = {}; - bool Running = false; + bool Running = false; }; Win32EditorApplication& GetEditorApplication(); diff --git a/JulietApp/JulietApp.vcxproj b/JulietApp/JulietApp.vcxproj index 02e542a..9c2aff7 100644 --- a/JulietApp/JulietApp.vcxproj +++ b/JulietApp/JulietApp.vcxproj @@ -1,118 +1,118 @@ - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - {b7b12dcc-1a69-4371-a9fe-d6e7671497b0} - Game - - - {1bbc0b92-e4d8-4838-974b-439c5c501e82} - Juliet - - - - 17.0 - Win32Proj - {4b2a0f9c-5f78-4bc9-bee9-1e58bb85fa79} - JulietApp - 10.0 - - - - Application - true - ClangCL - Unicode - - - Application - false - ClangCL - true - Unicode - - - - - - - - - - - - - - - $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)Juliet\include\;$(SolutionDir)JulietApp;$(IncludePath) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\;$(LibraryPath) - - - $(SolutionDir)Juliet\include\;$(SolutionDir)JulietApp;$(IncludePath) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\;$(LibraryPath) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ - - - - Level3 - true - _DEBUG;JULIET_WIN32;%(PreprocessorDefinitions) - true - stdcpp20 - false - Fast - false - - - Console - true - Juliet.lib;%(AdditionalDependencies) - - - - - - - - Level3 - true - true - true - NDEBUG;JULIET_WIN32;%(PreprocessorDefinitions) - true - stdcpp20 - false - Fast - false - - - Console - true - true - true - Juliet.lib;%(AdditionalDependencies) - - - - - + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + {b7b12dcc-1a69-4371-a9fe-d6e7671497b0} + Game + + + {1bbc0b92-e4d8-4838-974b-439c5c501e82} + Juliet + + + + 17.0 + Win32Proj + {4b2a0f9c-5f78-4bc9-bee9-1e58bb85fa79} + JulietApp + 10.0 + + + + Application + true + ClangCL + Unicode + + + Application + false + ClangCL + true + Unicode + + + + + + + + + + + + + + + $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ + $(SolutionDir)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Juliet\include\;$(SolutionDir)JulietApp;$(IncludePath) + $(SolutionDir)\bin\$(Platform)\$(Configuration)\;$(LibraryPath) + + + $(SolutionDir)Juliet\include\;$(SolutionDir)JulietApp;$(IncludePath) + $(SolutionDir)\bin\$(Platform)\$(Configuration)\;$(LibraryPath) + $(SolutionDir)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ + + + + Level3 + true + _DEBUG;JULIET_WIN32;%(PreprocessorDefinitions) + true + stdcpp20 + false + Fast + false + + + Console + true + Juliet.lib;%(AdditionalDependencies) + + + + + + + + Level3 + true + true + true + NDEBUG;JULIET_WIN32;%(PreprocessorDefinitions) + true + stdcpp20 + false + Fast + false + + + Console + true + true + true + Juliet.lib;%(AdditionalDependencies) + + + + + \ No newline at end of file