- Timestamp:
- Dec 16, 2018 2:12:32 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 127518
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp
r76247 r76248 81 81 82 82 #else 83 // # define OGLGETPROCADDRESS(x) glXGetProcAddress((const GLubyte *)x)84 83 # define OGLGETPROCADDRESS MyGLXGetProcAddress 85 84 static void *MyGLXGetProcAddress(const char *pszSymbol) … … 90 89 if (s_hGL == NULL) 91 90 { 92 rc = RTLdrLoadSystem("libGL.so", /* fNoUnload = */ true, &s_hGL); 91 static const char s_szLibGL[] = "libGL.so.1"; 92 rc = RTLdrLoadEx(s_szLibGL, &s_hGL, RTLDRLOAD_FLAGS_GLOBAL | RTLDRLOAD_FLAGS_NO_UNLOAD, NULL); 93 93 if (RT_FAILURE(rc)) 94 s_hGL = NULL; 95 } 96 97 typedef void(*)() (* PFNGLXGETPROCADDRESS)(const GLubyte * procName); 94 { 95 LogRel(("VMSVGA3d: failed to load %s: %Rrc\n", s_szLibGL, rc)); 96 s_hGL = NULL; 97 return NULL; 98 } 99 } 100 101 typedef void * (* PFNGLXGETPROCADDRESS)(const GLubyte * procName); 98 102 static PFNGLXGETPROCADDRESS s_glXGetProcAddress = NULL; 99 103 if (s_glXGetProcAddress == NULL) 100 104 { 101 if (s_hGL != NULL) 105 rc = RTLdrGetSymbol(s_hGL, "glXGetProcAddress", (void **)&s_glXGetProcAddress); 106 if (RT_FAILURE(rc)) 102 107 { 103 rc = RTLdrGetSymbol(s_hGL, "glXGetProcAddress", (void **)&s_glXGetProcAddress);104 if (RT_FAILURE(rc))105 s_glXGetProcAddress =NULL;108 LogRel(("VMSVGA3d: failed to get glXGetProcAddress: %Rrc\n", rc)); 109 s_glXGetProcAddress = NULL; 110 return NULL; 106 111 } 107 112 } 108 113 109 if (s_glXGetProcAddress) 110 { 111 void *p = glXGetProcAddress((const GLubyte *)pszSymbol); 112 if (RT_VALID_PTR(p)) 113 return p; 114 115 /* Might be an exported symbol. */ 116 rc = RTLdrGetSymbol(s_hGL, pszSymbol, (void **)&p); 117 if (RT_SUCCESS(rc)) 118 return p; 119 } 120 121 return 0; 114 void *p = s_glXGetProcAddress((const GLubyte *)pszSymbol); 115 if (RT_VALID_PTR(p)) 116 return p; 117 118 /* Might be an exported symbol. */ 119 rc = RTLdrGetSymbol(s_hGL, pszSymbol, (void **)&p); 120 if (RT_SUCCESS(rc)) 121 return p; 122 123 return NULL; 122 124 } 123 125 #endif
Note:
See TracChangeset
for help on using the changeset viewer.