Browse Source

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 years ago
parent
commit
416b92fe10
1 changed files with 1 additions and 5 deletions
  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;