feat!: reorganised stuff

This commit is contained in:
CT5
2026-01-26 12:05:08 +11:00
parent 838db80172
commit f0c790e775
59 changed files with 147 additions and 46 deletions

3
.gitignore vendored
View File

@@ -13,9 +13,6 @@ Generated Files
Packages
_deps
CMakeUserPresets.json
*.slnx
*.vcxproj
*.vcxproj.filters
*.dir
!projects/WinDurango.Testing/WinDurango.Testing.slnx
!projects/WinDurango.Testing/WinDurango.Testing.vcxproj

View File

@@ -3,21 +3,25 @@ project(WinDurango)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
set(CMAKE_PDB_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
add_subdirectory(projects/WinDurango.Common)
add_subdirectory(projects/WinDurango.Implementation.WinRT)
add_subdirectory(projects/WinDurango.Implementation.Native)
add_subdirectory(projects/WinDurango.WinRT)
add_subdirectory("etwplus")
add_subdirectory("d3d11.x")
add_subdirectory(projects/WinDurango.Kernel)
add_subdirectory(projects/WinDurango.etwplus)
add_subdirectory(projects/WinDurango.KernelX)
add_subdirectory(projects/WinDurango.D3D11X)
add_custom_target(WinDurango ALL DEPENDS
WinDurango.Common
WinDurango.Implementation.WinRT
WinDurango.Implementation.Native
WinDurango.WinRT
etwplus
WinDurango.Kernel
d3d11_x
WinDurango.etwplus
WinDurango.KernelX
WinDurango.D3D11X
)

View File

@@ -6,6 +6,7 @@
## Building
To build run
```
vcpkg install cppwinrt
cmake -S . -B build
cmake --build build
```

View File

@@ -1,6 +0,0 @@
add_library(d3d11_x SHARED "d3d11.x.cpp" "d3d11.x.h" "unknown.g.h" "IGraphicsUnknown.h" "IGraphicsUnknown.cpp" "IIDExports.h" "IIDExports.cpp" "Exports.def")
target_link_options(d3d11_x
PUBLIC
$<$<CXX_COMPILER_ID:MSVC>:/FORCE:MULTIPLE>
)

View File

@@ -1 +0,0 @@
add_library(etwplus SHARED "etwplus.cpp" "etwplus.h")

View File

@@ -0,0 +1,34 @@
cmake_minimum_required(VERSION 4.0)
project(WinDurango.D3D11X VERSION 1.0.0)
set(VERSION_SUFFIX "-dev.1") # used for non-stable versions, otherwise blank
set(CMAKE_CXX_STANDARD 20)
set(FILES
src/d3d11.x.cpp
src/IGraphicsUnknown.cpp
src/IIDExports.cpp
include/WinDurango.D3D11X/d3d11.x.h
include/WinDurango.D3D11X/unknown.g.h
include/WinDurango.D3D11X/IGraphicsUnknown.h
include/WinDurango.D3D11X/IIDExports.h
Exports.def
)
add_library(WinDurango.D3D11X SHARED ${FILES})
target_link_libraries(WinDurango.D3D11X PRIVATE WinDurango.Common)
target_include_directories(WinDurango.D3D11X PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.D3D11X/
../WinDurango.Common/include/
)
target_link_options(WinDurango.D3D11X
PUBLIC
$<$<CXX_COMPILER_ID:MSVC>:/FORCE:MULTIPLE>
)
set_target_properties(WinDurango.D3D11X PROPERTIES
OUTPUT_NAME "d3d11_x"
)

View File

@@ -4,6 +4,8 @@ project(WinDurango.Implementation.WinRT VERSION 1.0.0)
set(VERSION_SUFFIX "-dev.1") # used for non-stable versions, otherwise blank
set(CMAKE_CXX_STANDARD 20)
find_package(cppwinrt CONFIG REQUIRED)
set(FILES
include/WinDurango.Implementation.WinRT/Interfaces/Storage/Directory.h
include/WinDurango.Implementation.WinRT/Interfaces/Storage/File.h
@@ -18,7 +20,16 @@ target_include_directories(WinDurango.Implementation.WinRT PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
)
target_link_libraries(WinDurango.Implementation.WinRT PRIVATE WinDurango.Common)
set_property(
TARGET WinDurango.Implementation.WinRT
PROPERTY VS_PACKAGE_REFERENCES
"Microsoft.Windows.CppWinRT_2.0.230706.1"
"Microsoft.WindowsAppSDK_1.4.231115000"
"Microsoft.Windows.SDK.BuildTools_10.0.22621.756"
"Microsoft.Windows.ImplementationLibrary_1.0.230629.1"
)
target_link_libraries(WinDurango.Implementation.WinRT PRIVATE WinDurango.Common Microsoft::CppWinRT)
target_compile_definitions(WinDurango.Implementation.WinRT PUBLIC
WINDURANGO_IMPLEMENTATION_WINRT_COMPILER_NAME="${CMAKE_CXX_COMPILER_ID}"

View File

@@ -1,7 +1,13 @@
#pragma once
#include "WinDurango.Implementation.WinRT/WinDurangoWinRT.h"
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/base.h>
#include "WinDurango.h"
#include "WinDurango.Common/interfaces/Storage/Directory.h"
using namespace winrt::Windows::Storage;
/*
* I wonder if this is too confusing?
*/
@@ -22,5 +28,6 @@ namespace wd::impl::winrt::interfaces::storage {
virtual bool copy(std::filesystem::path path) override;
private:
std::filesystem::path path;
StorageFolder* dir = nullptr;
};
}

View File

@@ -1,35 +1,39 @@
#include "WinDurango.Implementation.WinRT/Interfaces/Storage/Directory.h"
namespace wd::impl::winrt::interfaces::storage {
bool WinRTDirectory::open() {
return false;
bool wd::impl::winrt::interfaces::storage::WinRTDirectory::open() {
StorageFolder sf = ApplicationData::Current().LocalFolder();
if (sf) {
dir = &sf;
return true;
}
return false;
}
wd::common::interfaces::storage::File* WinRTDirectory::CreateFile(std::filesystem::path path) {
return nullptr;
}
wd::common::interfaces::storage::File* wd::impl::winrt::interfaces::storage::WinRTDirectory::CreateFile(std::filesystem::path path) {
auto file = localFolder.CreateFileAsync(winrt::hstring(path.wstring()), winrt::Windows::Storage::CreationCollisionOption::FailIfExists).get();
return nullptr;
}
wd::common::interfaces::storage::Directory* WinRTDirectory::CreateDirectory(std::filesystem::path path) {
return nullptr;
}
wd::common::interfaces::storage::Directory* wd::impl::winrt::interfaces::storage::WinRTDirectory::CreateDirectory(std::filesystem::path path) {
return nullptr;
}
std::filesystem::path WinRTDirectory::dirpath() {
return path;
}
std::filesystem::path wd::impl::winrt::interfaces::storage::WinRTDirectory::dirpath() {
return path;
}
bool WinRTDirectory::rename(std::string) {
return false;
}
bool wd::impl::winrt::interfaces::storage::WinRTDirectory::rename(std::string) {
return false;
}
bool WinRTDirectory::remove() {
return false;
}
bool wd::impl::winrt::interfaces::storage::WinRTDirectory::remove() {
return false;
}
bool WinRTDirectory::move(std::filesystem::path path) {
return false;
}
bool wd::impl::winrt::interfaces::storage::WinRTDirectory::move(std::filesystem::path path) {
return false;
}
bool WinRTDirectory::copy(std::filesystem::path path) {
return false;
}
bool wd::impl::winrt::interfaces::storage::WinRTDirectory::copy(std::filesystem::path path) {
return false;
}

View File

@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 4.0)
project(WinDurango.KernelX VERSION 1.0.0)
set(VERSION_SUFFIX "-dev.1") # used for non-stable versions, otherwise blank
set(CMAKE_CXX_STANDARD 20)
set(FILES
src/kernelx.cpp
include/WinDurango.KernelX/kernelx.h
include/WinDurango.KernelX/Logan.h
)
add_library(WinDurango.KernelX SHARED ${FILES})
target_link_libraries(WinDurango.KernelX PRIVATE WinDurango.Common)
target_include_directories(WinDurango.KernelX PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.KernelX/
../WinDurango.Common/include/
)
set_target_properties(WinDurango.KernelX PROPERTIES
OUTPUT_NAME "kernelx"
)

View File

@@ -1,5 +1,5 @@
#include "WinDurango.Kernel/kernelx.h"
#include "WinDurango.Kernel/Logan.h"
#include "kernelx.h"
#include "Logan.h"
EXTERN_C CONSOLE_TYPE __stdcall GetConsoleType()
{
return CONSOLE_TYPE_XBOX_ONE;

View File

@@ -91,4 +91,7 @@ set_target_properties(WinDurango.WinRT PROPERTIES LINKER_LANGUAGE CXX)
#set_target_properties(WinDurango.WinRT PROPERTIES LIBRARY_OUTPUT_NAME "winrt")
#set_target_properties(${PROJECT_NAME} PROPERTIES VS_CPPWINRT true)
set_target_properties(${PROJECT_NAME} PROPERTIES VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION 10.0.18362.0)
target_compile_definitions(WinDurango.WinRT PRIVATE _WINRT_DLL WIN32_LEAN_AND_MEAN WINRT_LEAN_AND_MEAN)
target_compile_definitions(WinDurango.WinRT PRIVATE _WINRT_DLL WIN32_LEAN_AND_MEAN WINRT_LEAN_AND_MEAN)
set_target_properties(WinDurango.WinRT PROPERTIES
OUTPUT_NAME "winrt_x"
)

View File

@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 4.0)
project(WinDurango.etwplus VERSION 1.0.0)
set(VERSION_SUFFIX "-dev.1") # used for non-stable versions, otherwise blank
set(CMAKE_CXX_STANDARD 20)
set(FILES
src/etwplus.cpp
include/WinDurango.etwplus/etwplus.h
)
add_library(WinDurango.etwplus SHARED ${FILES})
target_link_libraries(WinDurango.etwplus PRIVATE WinDurango.Common)
target_include_directories(WinDurango.etwplus PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.etwplus/
../WinDurango.Common/include/
)
set_target_properties(WinDurango.etwplus PROPERTIES
OUTPUT_NAME "etwplus"
)