浏览代码

Do not call LoadLibrary() manually for opengl32.dll

openGLModuleHandle() is what we actually want. The DLL could be
different from opengl32.dll in some scenarios.
Vincent Lang 9 年之前
父节点
当前提交
416b92fe10
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1 5
      src/player/PlayerQuickItem.cpp

+ 1 - 5
src/player/PlayerQuickItem.cpp

@@ -105,15 +105,11 @@ static void* get_proc_address(void* ctx, const char* name)
   // builtin functions with all drivers (only extensions). Qt compensates this
   // for a degree, but does this only for functions Qt happens to need. So
   // we need our own falback as well.
-  // Warning: this might break if using ANGLE.
   if (!res)
   {
-    HMODULE handle = LoadLibrary("opengl32.dll");
+    HMODULE handle = (HMODULE)QOpenGLContext::openGLModuleHandle();
     if (handle)
-    {
       res = (void *)GetProcAddress(handle, name);
-      FreeLibrary(handle);
-    }
   }
 #endif
   return res;