Browse Source

PlayerQuickItem: do not create IDirect3DDevice9 in ANGLE mode

AA_UseOpenGLES indicates ANGLE is used (or the request that ANGLE should
be used - we set it in main.cpp). ANGLE does not use exclusive
fullscreen mode (unlike many drivers do in native OpenGL), so there is
no need to create a IDirect3DDevice9 in advance. (Without this, libmpv
will not be able to initialize a hardware decoder if PMP is fullscreened
and the driver uses exclusive mode.)

This is mostly untested, but should work.
Vincent Lang 9 years ago
parent
commit
f3f07be5e2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/player/PlayerQuickItem.cpp

+ 4 - 0
src/player/PlayerQuickItem.cpp

@@ -2,6 +2,7 @@
 
 #include <stdexcept>
 
+#include <QCoreApplication>
 #include <QOpenGLContext>
 #include <QRunnable>
 
@@ -35,6 +36,9 @@ void initD3DDevice(void)
   D3DDISPLAYMODE        d3ddm;
   UINT adapter = D3DADAPTER_DEFAULT;
 
+  if (QCoreApplication::testAttribute(Qt::AA_UseOpenGLES))
+    return;
+
   HMODULE d3dlib = LoadLibraryW(L"d3d9.dll");
   if (!d3dlib) {
       QLOG_ERROR() << "Failed to load D3D9 library";