mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-03-04 10:17:25 +00:00

All games use mailbox/triple buffering. Except when you enable sync to host refresh, in which case FIFO/double buffering is used. This means vsync enabled will ever tear, but at the same time, never drop to 30fps on a missed frame due to frame rate differences. To have the "best of both worlds", you should enable vsync and sync to host refresh. Previously, this resulted in additional input lag, since the host vsync would drive the EE frame timing. Now, this behaviour is disabled by default, unless you enable "Use Host VSync Timing".
48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
// SPDX-FileCopyrightText: 2002-2023 PCSX2 Dev Team
|
|
// SPDX-License-Identifier: LGPL-3.0+
|
|
|
|
#pragma once
|
|
#include "Pcsx2Defs.h"
|
|
|
|
#include <optional>
|
|
|
|
/// Contains the information required to create a graphics context in a window.
|
|
struct WindowInfo
|
|
{
|
|
enum class Type
|
|
{
|
|
Surfaceless,
|
|
Win32,
|
|
X11,
|
|
Wayland,
|
|
MacOS
|
|
};
|
|
|
|
/// The type of the surface. Surfaceless indicates it will not be displayed on screen at all.
|
|
Type type = Type::Surfaceless;
|
|
|
|
/// Connection to the display server. On most platforms except X11/Wayland, this is implicit and null.
|
|
void* display_connection = nullptr;
|
|
|
|
/// Abstract handle to the window. This depends on the surface type.
|
|
void* window_handle = nullptr;
|
|
|
|
/// For platforms where a separate surface/layer handle is needed, it is stored here (e.g. MacOS).
|
|
void* surface_handle = nullptr;
|
|
|
|
/// Width of the surface in pixels.
|
|
u32 surface_width = 0;
|
|
|
|
/// Height of the surface in pixels.
|
|
u32 surface_height = 0;
|
|
|
|
/// DPI scale for the surface.
|
|
float surface_scale = 1.0f;
|
|
|
|
/// Refresh rate of the surface, if available.
|
|
float surface_refresh_rate = 0.0f;
|
|
|
|
/// Returns the host's refresh rate for the given window, if available.
|
|
static std::optional<float> QueryRefreshRateForWindow(const WindowInfo& wi);
|
|
};
|