CI: Add support for using Opengl in Subprocess (Windows) (#1987)

There is an environment variable in glcontext which can be used for the
locating the `opengl32.dll`. Use that instead of dynamically loading the
DLL which is error prone.
This commit is contained in:
Naveen 2021-08-31 17:46:20 +05:30 committed by GitHub
commit fb680235bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 10 deletions

View file

@ -13,6 +13,7 @@ jobs:
env:
DISPLAY: :0
PYTEST_ADDOPTS: "--color=yes" # colors in pytest
GLCONTEXT_WIN_LIBGL: C:\msys64\mingw64\bin\opengl32.dll
strategy:
fail-fast: false
matrix:

View file

@ -1,10 +0,0 @@
import os
if os.getenv("CI") and os.name == "nt":
location = r"C:\msys64\mingw64\bin"
os.environ["PATH"] = location + os.pathsep + os.getenv("PATH")
import ctypes
ctypes.CDLL(r"C:\msys64\mingw64\bin\OPENGL32.dll")
if hasattr(os, "add_dll_directory"):
os.add_dll_directory(location)