mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 09:35:21 +02:00
add vsync option (#776)
This commit is contained in:
@@ -265,8 +265,7 @@ static ImageHandle create_message_image(Vulkan::Device &device, int width,
|
||||
}
|
||||
|
||||
void rdp_init(void *_window, GFX_INFO _gfx_info, const void *font,
|
||||
size_t font_size, uint32_t save_state_slot,
|
||||
bool netplay_enabled) {
|
||||
size_t font_size, uint32_t save_state_slot) {
|
||||
memset(&rdp_device, 0, sizeof(RDP_DEVICE));
|
||||
|
||||
window = (SDL_Window *)_window;
|
||||
@@ -291,12 +290,12 @@ void rdp_init(void *_window, GFX_INFO _gfx_info, const void *font,
|
||||
wsi_platform = new SDL_WSIPlatform;
|
||||
wsi_platform->set_window(window);
|
||||
wsi->set_platform(wsi_platform);
|
||||
if (netplay_enabled) {
|
||||
// VK_PRESENT_MODE_MAILBOX_KHR, fallback to VK_PRESENT_MODE_IMMEDIATE_KHR
|
||||
wsi->set_present_mode(PresentMode::UnlockedMaybeTear);
|
||||
} else {
|
||||
if (gfx_info.vsync) {
|
||||
// VK_PRESENT_MODE_MAILBOX_KHR, fallback to VK_PRESENT_MODE_FIFO_KHR
|
||||
wsi->set_present_mode(PresentMode::UnlockedNoTearing);
|
||||
} else {
|
||||
// VK_PRESENT_MODE_MAILBOX_KHR, fallback to VK_PRESENT_MODE_IMMEDIATE_KHR
|
||||
wsi->set_present_mode(PresentMode::UnlockedMaybeTear);
|
||||
}
|
||||
wsi->set_backbuffer_srgb(false);
|
||||
Context::SystemHandles handles = {};
|
||||
|
||||
@@ -18,6 +18,7 @@ typedef struct {
|
||||
bool PAL;
|
||||
bool widescreen;
|
||||
bool fullscreen;
|
||||
bool vsync;
|
||||
bool integer_scaling;
|
||||
uint32_t upscale;
|
||||
bool crt;
|
||||
@@ -37,7 +38,7 @@ typedef struct {
|
||||
} CALL_BACK;
|
||||
|
||||
void rdp_init(void *_window, GFX_INFO _gfx_info, const void *font,
|
||||
size_t font_size, uint32_t save_state_slot, bool netplay_enabled);
|
||||
size_t font_size, uint32_t save_state_slot);
|
||||
void rdp_close();
|
||||
void rdp_set_vi_register(uint32_t reg, uint32_t value);
|
||||
void rdp_update_screen();
|
||||
|
||||
Reference in New Issue
Block a user