Browse Source

qt: force OpenGL on Windows 7 if Qt >= 6.0

QRhiD3D11 uses functionality that is expected
to be not available on Windows 7. Since RHI
fallback does not work, we force OpenGL so
that it does not crash.
pull/162/head
Fatih Uzunoglu 3 years ago
committed by Jean-Baptiste Kempf
parent
commit
cbd2cf1d26
  1. 20
      modules/gui/qt/qt.cpp

20
modules/gui/qt/qt.cpp

@ -730,6 +730,26 @@ static void *Thread( void *obj )
Q_INIT_RESOURCE( vlc );
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#ifdef _WIN32
// QSysInfo::productVersion() returns "unknown" on Windows 7
// RHI Fallback does not seem to work.
DWORD dwVersion = 0;
DWORD dwMajorVersion = 0;
DWORD dwMinorVersion = 0;
dwVersion = GetVersion();
dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
if (dwMajorVersion <= 6 && dwMinorVersion <= 1)
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
#endif
#endif
auto compositor = var_InheritString(p_intf, "qt-compositor");
vlc::CompositorFactory compositorFactory(p_intf, compositor);
free(compositor);

Loading…
Cancel
Save