#ifndef EMULATOR_SRC_GRAPHICS_PRESENTATION_WINDOW_WINDOWINTERNAL_H_ #define EMULATOR_SRC_GRAPHICS_PRESENTATION_WINDOW_WINDOWINTERNAL_H_ #include #include "common/threads.h" #include "graphics/host_gpu/graphicContext.h" #include "graphics/host_gpu/vulkanCommon.h" #include #include #include #include namespace Libs::Graphics { class Presenter; class RenderContext; struct SurfaceCapabilities { vk::SurfaceCapabilitiesKHR capabilities {}; std::vector formats; std::vector present_modes; }; struct WindowLoopState { SDL_Event event {}; bool need_exit = false; std::atomic_bool paused = false; }; struct WindowContext { WindowContext(); ~WindowContext(); KYTY_CLASS_NO_COPY(WindowContext); [[nodiscard]] static vk::PhysicalDeviceVulkan12Features RequiredVulkan12Features() noexcept; [[nodiscard]] static vk::PhysicalDeviceVulkan13Features RequiredVulkan13Features() noexcept; [[nodiscard]] static uint32_t InitialWindowFlags(bool fullscreen) noexcept; void CreateVulkan(); void RecreateSurface(); void RefreshSurfaceCapabilities(); void UpdateIcon(); void UpdateTitle(); void Resize(uint32_t width, uint32_t height); void ProcessWindowEvent(const SDL_WindowEvent& event); void ProcessDisplayEvent(const SDL_DisplayEvent& event); void ProcessEvent(double time_seconds); void Run(); GraphicContext graphic_ctx; SDL_Window* window = nullptr; vk::SurfaceKHR surface = nullptr; SurfaceCapabilities surface_capabilities; std::unique_ptr render_context; std::unique_ptr presenter; WindowLoopState loop; Common::Mutex mutex; }; } // namespace Libs::Graphics #endif // EMULATOR_SRC_GRAPHICS_PRESENTATION_WINDOW_WINDOWINTERNAL_H_