[vlc-commits] [Git][videolan/vlc][master] 2 commits: wgl: don't use opengl32 if it's not found

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Feb 5 07:12:58 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
76cf197d by Steve Lhomme at 2025-02-05T06:56:39+00:00
wgl: don't use opengl32 if it's not found

The many mandatory openGL functions are not available through
wglGetProcAddress(). If we can't use GetProcAddress() we can't
this display module.

- - - - -
698cb607 by Steve Lhomme at 2025-02-05T06:56:39+00:00
wgl: use already loaded opengl32.dll

This module has a hard dependency on opengl32 since it was created in db93ff060269a331518a9dc39a39527b396bf0f9.
It uses:
* wglMakeCurrent
* glGetString
* wglCreateContext
* wglDeleteContext
* wglGetProcAddress

- - - - -


1 changed file:

- modules/video_output/win32/wgl.c


Changes:

=====================================
modules/video_output/win32/wgl.c
=====================================
@@ -175,12 +175,17 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height,
 
     sys->hvideownd = wnd->handle.hwnd;
     sys->hGLDC = GetDC(sys->hvideownd);
-    sys->hOpengl = LoadLibraryExA("opengl32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
     if (sys->hGLDC == NULL)
     {
         msg_Err(gl, "Could not get the device context");
         goto error;
     }
+    sys->hOpengl = GetModuleHandleA("opengl32.dll");
+    if (unlikely(sys->hOpengl == NULL))
+    {
+        msg_Err(gl, "Could not get the opengl32 DLL");
+        goto error;
+    }
 
     /* Set the pixel format for the DC */
     PIXELFORMATDESCRIPTOR pfd = VLC_PFD_INITIALIZER;
@@ -252,8 +257,6 @@ static void Close(vlc_gl_t *gl)
         wglDeleteContext(sys->hGLRC);
     if (sys->hGLDC)
         ReleaseDC(sys->hvideownd, sys->hGLDC);
-    if (sys->hOpengl)
-        FreeLibrary(sys->hOpengl);
 
     DestroyGPUAffinityDC(gl);
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b21fdbf044086fd94b66281f5ad52b0d32ac3d0c...698cb6076728d5d14f6c040dd019783abafc57b6

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b21fdbf044086fd94b66281f5ad52b0d32ac3d0c...698cb6076728d5d14f6c040dd019783abafc57b6
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list