From a9f97d405b1a2bfb07385899e65573a3fb7ffdd0 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 17 Feb 2017 05:59:07 +0400 Subject: [PATCH] linux just queries libGL directly --- tests/Tests/GRGlInterfaceTest.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/Tests/GRGlInterfaceTest.cs b/tests/Tests/GRGlInterfaceTest.cs index a8cc074a..9855a260 100644 --- a/tests/Tests/GRGlInterfaceTest.cs +++ b/tests/Tests/GRGlInterfaceTest.cs @@ -54,16 +54,12 @@ namespace SkiaSharp.Tests WindowsDynamicLibraries.FreeLibrary(lib); } else if (IsLinux) { - var lib = LinuxDynamicLibraries.dlopen("libGL.so.1", 1); - var glInterface = GRGlInterface.AssembleGlInterface((context, name) => { - return LinuxDynamicLibraries.dlsym(lib, name); + return glXGetProcAddress(name); }); Assert.NotNull(glInterface); Assert.True(glInterface.Validate()); - - LinuxDynamicLibraries.dlclose(lib); } else { // more platforms !!! throw new Exception("Some strange platform that is not Windows, macOS nor Linux..."); @@ -73,5 +69,8 @@ namespace SkiaSharp.Tests [DllImport("opengl32.dll", CallingConvention = CallingConvention.Winapi)] public static extern IntPtr wglGetProcAddress([MarshalAs(UnmanagedType.LPStr)] string lpszProc); + + [DllImport("libGL.so.1")] + public static extern IntPtr glXGetProcAddress([MarshalAs(UnmanagedType.LPStr)] string lpszProc); } }