#pragma once #include #include #include #include #include #include "Theme.h" namespace XCEngine { namespace Editor { class EditorLayer; class Application { public: static Application& Get(); bool Initialize(HWND hwnd); void Shutdown(); void Render(); void OnResize(int width, int height); private: Application() = default; ~Application() = default; bool CreateDevice(); bool CreateRenderTarget(); void CleanupRenderTarget(); HWND m_hwnd = nullptr; int m_width = 1280; int m_height = 720; ID3D12Device* m_device = nullptr; ID3D12CommandQueue* m_commandQueue = nullptr; ID3D12CommandAllocator* m_commandAllocator = nullptr; ID3D12GraphicsCommandList* m_commandList = nullptr; IDXGISwapChain3* m_swapChain = nullptr; ID3D12DescriptorHeap* m_rtvHeap = nullptr; ID3D12DescriptorHeap* m_srvHeap = nullptr; ID3D12Resource* m_renderTargets[3] = {}; ID3D12Fence* m_fence = nullptr; UINT64 m_fenceValue = 0; UINT m_rtvDescriptorSize = 0; UINT m_frameIndex = 0; Core::LayerStack m_layerStack; EditorLayer* m_editorLayer = nullptr; }; } }