mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-30 07:20:13 +00:00
Fix OpenGL behavior under wayland-egl
This commit is contained in:
parent
b0d07a75e5
commit
c7b2a21fcb
@ -30,6 +30,7 @@ if(UNIX AND NOT APPLE)
|
|||||||
find_package(Wayland)
|
find_package(Wayland)
|
||||||
if(WAYLAND_FOUND)
|
if(WAYLAND_FOUND)
|
||||||
add_definitions(-DHAVE_WAYLAND)
|
add_definitions(-DHAVE_WAYLAND)
|
||||||
|
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "EGL")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "OpenGL.h"
|
#include "OpenGL.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_WAYLAND)
|
||||||
|
#include <EGL/egl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
@ -54,6 +58,14 @@ void gl::set_swapinterval(int interval)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_WAYLAND
|
||||||
|
if (auto egl_display = eglGetCurrentDisplay(); egl_display != EGL_NO_DISPLAY)
|
||||||
|
{
|
||||||
|
eglSwapInterval(egl_display, interval);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//No existing drawable or missing swap extension, EGL?
|
//No existing drawable or missing swap extension, EGL?
|
||||||
rsx_log.error("Failed to set swap interval");
|
rsx_log.error("Failed to set swap interval");
|
||||||
#else
|
#else
|
||||||
|
@ -18,12 +18,14 @@ gl_gs_frame::gl_gs_frame(QScreen* screen, const QRect& geometry, const QIcon& ap
|
|||||||
m_format.setAlphaBufferSize(0);
|
m_format.setAlphaBufferSize(0);
|
||||||
m_format.setDepthBufferSize(0);
|
m_format.setDepthBufferSize(0);
|
||||||
m_format.setSwapBehavior(QSurfaceFormat::SwapBehavior::DoubleBuffer);
|
m_format.setSwapBehavior(QSurfaceFormat::SwapBehavior::DoubleBuffer);
|
||||||
|
m_format.setSwapInterval(0);
|
||||||
if (g_cfg.video.debug_output)
|
if (g_cfg.video.debug_output)
|
||||||
{
|
{
|
||||||
m_format.setOption(QSurfaceFormat::FormatOption::DebugContext);
|
m_format.setOption(QSurfaceFormat::FormatOption::DebugContext);
|
||||||
}
|
}
|
||||||
setFormat(m_format);
|
setFormat(m_format);
|
||||||
create();
|
create();
|
||||||
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_context_t gl_gs_frame::make_context()
|
draw_context_t gl_gs_frame::make_context()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user