2018-10-03 07:03:22 -06:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-10-03 07:03:22 -06:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
enum class WindowSystemType
|
|
|
|
{
|
|
|
|
Headless,
|
|
|
|
Windows,
|
|
|
|
MacOS,
|
|
|
|
Android,
|
|
|
|
X11,
|
2019-04-10 08:44:21 -06:00
|
|
|
Wayland,
|
|
|
|
FBDev,
|
2020-12-12 13:25:51 -07:00
|
|
|
Haiku,
|
2018-10-03 07:03:22 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct WindowSystemInfo
|
|
|
|
{
|
|
|
|
WindowSystemInfo() = default;
|
2020-03-11 07:09:28 -06:00
|
|
|
WindowSystemInfo(WindowSystemType type_, void* display_connection_, void* render_window_,
|
|
|
|
void* render_surface_)
|
|
|
|
: type(type_), display_connection(display_connection_), render_window(render_window_),
|
|
|
|
render_surface(render_surface_)
|
2018-10-03 07:03:22 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Window system type. Determines which GL context or Vulkan WSI is used.
|
|
|
|
WindowSystemType type = WindowSystemType::Headless;
|
|
|
|
|
|
|
|
// Connection to a display server. This is used on X11 and Wayland platforms.
|
|
|
|
void* display_connection = nullptr;
|
|
|
|
|
2020-03-11 07:09:28 -06:00
|
|
|
// Render window. This is a pointer to the native window handle, which depends
|
2018-10-03 07:03:22 -06:00
|
|
|
// on the platform. e.g. HWND for Windows, Window for X11. If the surface is
|
|
|
|
// set to nullptr, the video backend will run in headless mode.
|
2020-03-11 07:09:28 -06:00
|
|
|
void* render_window = nullptr;
|
|
|
|
|
|
|
|
// Render surface. Depending on the host platform, this may differ from the window.
|
|
|
|
// This is kept seperate as input may require a different handle to rendering, and
|
|
|
|
// during video backend startup the surface pointer may change (MoltenVK).
|
2018-10-03 07:03:22 -06:00
|
|
|
void* render_surface = nullptr;
|
2019-01-18 07:35:00 -07:00
|
|
|
|
|
|
|
// Scale of the render surface. For hidpi systems, this will be >1.
|
|
|
|
float render_surface_scale = 1.0f;
|
2018-10-03 07:03:22 -06:00
|
|
|
};
|