Enable fullscreen support for Vulkan on yuzu-cmd

Hooked up the existing SDL2 logic for fullscreen support in the Vulkan window of yuzu-cmd.
This commit is contained in:
san 2021-07-16 15:04:10 +02:00
parent 718c272421
commit 604ff1f178
3 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,7 @@
#include <SDL.h> #include <SDL.h>
#include <SDL_syswm.h> #include <SDL_syswm.h>
EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, bool fullscreen)
: EmuWindow_SDL2{input_subsystem} { : EmuWindow_SDL2{input_subsystem} {
const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name, const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name,
Common::g_scm_branch, Common::g_scm_desc); Common::g_scm_branch, Common::g_scm_desc);
@ -42,6 +42,10 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste
SetWindowIcon(); SetWindowIcon();
if (fullscreen) {
Fullscreen();
}
switch (wm.subsystem) { switch (wm.subsystem) {
#ifdef SDL_VIDEO_DRIVER_WINDOWS #ifdef SDL_VIDEO_DRIVER_WINDOWS
case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS:

View File

@ -19,7 +19,7 @@ class InputSubsystem;
class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 { class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 {
public: public:
explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem); explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, bool fullscreen);
~EmuWindow_SDL2_VK() override; ~EmuWindow_SDL2_VK() override;
std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override;

View File

@ -175,7 +175,7 @@ int main(int argc, char** argv) {
emu_window = std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, fullscreen); emu_window = std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, fullscreen);
break; break;
case Settings::RendererBackend::Vulkan: case Settings::RendererBackend::Vulkan:
emu_window = std::make_unique<EmuWindow_SDL2_VK>(&input_subsystem); emu_window = std::make_unique<EmuWindow_SDL2_VK>(&input_subsystem, fullscreen);
break; break;
} }