Leonard Ritter avatar Leonard Ritter committed 2b3aa02

Fixed a win32 related DLL finding bug

Comments (0)

Files changed (1)

 void *wglGetProcAddress(const char *); 
 """
 
+def find_win32_library(name):
+    WIN32_SEARCH_PATH = os.environ.get('PATH', '').split(os.pathsep)    
+    WIN32_SEARCH_PATH.insert(0, r'c:\windows\system32')
+    filename = name + '.dll'
+    for path in WIN32_SEARCH_PATH:
+        fullpath = os.path.join(path, filename)
+        if os.path.isfile(fullpath):
+            return fullpath 
+    return name
+
 def load_lib(cdefs):
     global _LIB
     
     #import time
     #t = time.time()
     if IS_WIN32:
-        libname = 'opengl32'
+        libname = find_win32_library('opengl32')
         cdefs += WIN32_WGL_CDEFS
     elif IS_DARWIN:
         libname = os.path.join(DARWIN_LIB_PATH, "libGL.dylib")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.