mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-23 04:16:57 +02:00
f68c77d785
* Update to SDL3 * Add XTest development dependency for SDL3 * Preserve native entry points with SDL3 * Document SDL3 XTest dependency
65 lines
2.2 KiB
C++
65 lines
2.2 KiB
C++
#ifndef EMULATOR_SRC_GRAPHICS_PRESENTATION_WINDOW_WINDOWINTERNAL_H_
|
|
#define EMULATOR_SRC_GRAPHICS_PRESENTATION_WINDOW_WINDOWINTERNAL_H_
|
|
|
|
#include <SDL3/SDL.h>
|
|
|
|
#include "common/threads.h"
|
|
#include "graphics/host_gpu/graphicContext.h"
|
|
#include "graphics/host_gpu/vulkanCommon.h"
|
|
|
|
#include <atomic>
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace Libs::Graphics {
|
|
|
|
class Presenter;
|
|
class RenderContext;
|
|
|
|
struct SurfaceCapabilities {
|
|
vk::SurfaceCapabilitiesKHR capabilities {};
|
|
std::vector<vk::SurfaceFormatKHR> formats;
|
|
std::vector<vk::PresentModeKHR> 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<RenderContext> render_context;
|
|
std::unique_ptr<Presenter> presenter;
|
|
WindowLoopState loop;
|
|
|
|
Common::Mutex mutex;
|
|
};
|
|
|
|
} // namespace Libs::Graphics
|
|
|
|
#endif // EMULATOR_SRC_GRAPHICS_PRESENTATION_WINDOW_WINDOWINTERNAL_H_
|