mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 01:54:31 +00:00
* added imgui as dependency * imgui renderer/basic input implementation * imgui: add layers system Add video info layer to show fps. Press F10 to toggle it. * imgui: add custom imgui config * imgui: gamepad capture, stopping propagation * imgui: changed config & log file path to use portable dir * videoout: render blank frame when video output is closed required to render imgui even when game has no video output - fixed merge compile-error
32 lines
935 B
C++
32 lines
935 B
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Based on imgui_impl_sdl3.h from Dear ImGui repository
|
|
|
|
#pragma once
|
|
|
|
struct SDL_Window;
|
|
struct SDL_Renderer;
|
|
struct SDL_Gamepad;
|
|
typedef union SDL_Event SDL_Event;
|
|
|
|
namespace ImGui::Sdl {
|
|
|
|
bool Init(SDL_Window* window);
|
|
void Shutdown();
|
|
void NewFrame();
|
|
bool ProcessEvent(const SDL_Event* event);
|
|
void OnResize();
|
|
|
|
// Gamepad selection automatically starts in AutoFirst mode, picking first available SDL_Gamepad.
|
|
// You may override this. When using manual mode, caller is responsible for opening/closing gamepad.
|
|
enum GamepadMode {
|
|
ImGui_ImplSDL3_GamepadMode_AutoFirst,
|
|
ImGui_ImplSDL3_GamepadMode_AutoAll,
|
|
ImGui_ImplSDL3_GamepadMode_Manual
|
|
};
|
|
void SetGamepadMode(GamepadMode mode, SDL_Gamepad** manual_gamepads_array = NULL,
|
|
int manual_gamepads_count = -1);
|
|
|
|
}; // namespace ImGui::Sdl
|