forked from Misaki/GhostEngine
Refactor and enhance rendering pipeline
- Added new C# formatting rules in .editorconfig. - Introduced `IKeyType`, `Key<T>`, and `Ptr<T>` structs. - Updated `Result` and `Result<T>` for implicit conversions. - Added AOT compatibility to project files. - Introduced a `Camera` class and refactored namespaces. - Enhanced rendering with bindless support and pipeline state management. - Refactored `D3D12CommandBuffer` for new rendering features. - Improved `D3D12PipelineLibrary` with disk caching methods. - Added support for UAVs and raw buffers in `D3D12ResourceAllocator`. - Improved shader compilation and reflection in `D3D12ShaderCompiler`. - Refactored descriptor heap and swap chain initialization. - Added enums and structs for rendering configurations. - Expanded `ICommandBuffer` and `IPipelineLibrary` interfaces. - Updated `MeshRenderPass` to align with the new pipeline. - Consolidated namespaces and improved code maintainability.
This commit is contained in:
55
Ghost.Graphics/Core/SwapChainPresenter.cs
Normal file
55
Ghost.Graphics/Core/SwapChainPresenter.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Ghost.Graphics.Contracts;
|
||||
using Ghost.Graphics.Core;
|
||||
|
||||
namespace Ghost.Graphics.Core;
|
||||
|
||||
internal readonly struct SwapChainPresenter
|
||||
{
|
||||
public enum TargetType
|
||||
{
|
||||
Composition,
|
||||
Hwnd
|
||||
}
|
||||
|
||||
public readonly TargetType Type
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public readonly ISwapChainPanelNative SwapChainPanelNative
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public readonly nint Hwnd
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public readonly uint Width
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public readonly uint Height
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public SwapChainPresenter(ISwapChainPanelNative swapChainPanelNative, uint width, uint height)
|
||||
{
|
||||
Type = TargetType.Composition;
|
||||
SwapChainPanelNative = swapChainPanelNative;
|
||||
Hwnd = nint.Zero;
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
|
||||
public SwapChainPresenter(nint hwnd, uint width, uint height)
|
||||
{
|
||||
Type = TargetType.Hwnd;
|
||||
Hwnd = hwnd;
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user