Changeset 76263 in vbox for trunk/src/VBox
- Timestamp:
- Dec 17, 2018 3:03:28 PM (6 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp
r76255 r76263 124 124 return NULL; 125 125 } 126 127 static PFNRT MyX11GetProcAddress(const char *pszSymbol) 128 { 129 int rc; 130 131 static RTLDRMOD s_hX11 = NULL; 132 if (s_hX11 == NULL) 133 { 134 static const char s_szLibX11[] = "libX11.so.6"; 135 rc = RTLdrLoadEx(s_szLibX11, &s_hX11, RTLDRLOAD_FLAGS_GLOBAL | RTLDRLOAD_FLAGS_NO_UNLOAD, NULL); 136 if (RT_FAILURE(rc)) 137 { 138 LogRel(("VMSVGA3d: failed to load %s: %Rrc\n", s_szLibX11, rc)); 139 s_hX11 = NULL; 140 return NULL; 141 } 142 } 143 144 PFNRT p = NULL; 145 rc = RTLdrGetSymbol(s_hX11, pszSymbol, (void **)&p); 146 if (RT_SUCCESS(rc)) 147 return p; 148 149 return NULL; 150 } 151 152 #define X11GETPROC_(ProcName) do { \ 153 *(PFNRT *)&pfn_##ProcName = pfnRet = MyX11GetProcAddress(#ProcName); \ 154 if (pfnRet) { /* likely */ } \ 155 else \ 156 { \ 157 AssertLogRelMsg(pfnRet, ("%s missing\n", #ProcName)); \ 158 return PDMDevHlpVMSetError(pDevIns, VERR_VGA_GL_SYMBOL_NOT_FOUND, RT_SRC_POS, \ 159 "Missing libX11 symbol '%s'\n", #ProcName); \ 160 } \ 161 } while(0) 126 162 #endif 127 163 … … 223 259 pfn_glXMakeCurrent = 0; 224 260 pfn_glXDestroyContext = 0; 261 pfn_XConfigureWindow = 0; 262 pfn_XCloseDisplay = 0; 263 pfn_XCreateColormap = 0; 264 pfn_XCreateWindow = 0; 265 pfn_XDefaultRootWindow = 0; 266 pfn_XDestroyWindow = 0; 267 pfn_XNextEvent = 0; 268 pfn_XOpenDisplay = 0; 269 pfn_XPending = 0; 225 270 #endif 226 271 … … 300 345 GLGETPROC_(glXMakeCurrent, ""); 301 346 GLGETPROC_(glXDestroyContext, ""); 347 X11GETPROC_(XConfigureWindow); 348 X11GETPROC_(XCloseDisplay); 349 X11GETPROC_(XCreateColormap); 350 X11GETPROC_(XCreateWindow); 351 X11GETPROC_(XDefaultRootWindow); 352 X11GETPROC_(XDestroyWindow); 353 X11GETPROC_(XNextEvent); 354 X11GETPROC_(XOpenDisplay); 355 X11GETPROC_(XPending); 302 356 #endif 303 357 return VINF_SUCCESS; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h
r76255 r76263 328 328 #define glXDestroyContext pfn_glXDestroyContext 329 329 330 #endif 331 332 #endif 330 /* 331 * X11 332 */ 333 GLPFN int (* pfn_XConfigureWindow)(Display *display, Window w, unsigned value_mask, XWindowChanges *changes); 334 #define XConfigureWindow pfn_XConfigureWindow 335 336 GLPFN int (* pfn_XCloseDisplay)(Display *display); 337 #define XCloseDisplay pfn_XCloseDisplay 338 339 GLPFN Colormap (* pfn_XCreateColormap)(Display *display, Window w, Visual *visual, int alloc); 340 #define XCreateColormap pfn_XCreateColormap 341 342 GLPFN Window (* pfn_XCreateWindow)(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, 343 unsigned int border_width, int depth, unsigned int window_class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes); 344 #define XCreateWindow pfn_XCreateWindow 345 346 GLPFN Window (* pfn_XDefaultRootWindow)(Display *display); 347 #define XDefaultRootWindow pfn_XDefaultRootWindow 348 349 GLPFN int (* pfn_XDestroyWindow)(Display *display, Window w); 350 #define XDestroyWindow pfn_XDestroyWindow 351 352 GLPFN int (* pfn_XNextEvent)(Display *display, XEvent *event_return); 353 #define XNextEvent pfn_XNextEvent 354 355 GLPFN Display *(* pfn_XOpenDisplay)(char *display_name); 356 #define XOpenDisplay pfn_XOpenDisplay 357 358 GLPFN int (* pfn_XPending)(Display *display); 359 #define XPending pfn_XPending 360 361 #endif 362 363 #endif -
trunk/src/VBox/Devices/Makefile.kmk
r76260 r76263 311 311 $(VBOX_DEF_2_LAZY_LOAD) --explicit-load-function --library VBoxSVGA3DObjC --output "$@" $(filter %.def, $^) 312 312 313 # VBoxDD_LIBS.linux += X11314 313 ifdef VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD 315 314 VBoxDD_DEFS += VMSVGA3D_DYNAMIC_LOAD … … 317 316 Graphics/DevVGA-SVGA3d-glLdr.cpp 318 317 else 319 VBoxDD_LIBS.linux += GL318 VBoxDD_LIBS.linux += X11 GL 320 319 VBoxDD_LIBS.win += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib 321 320 endif
Note:
See TracChangeset
for help on using the changeset viewer.