1 | /* $Id: glx_c_exports.c 76553 2019-01-01 01:45:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox guest OpenGL DRI GLX C stubs
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #include "stub.h"
|
---|
19 | #include "dri_glx.h"
|
---|
20 | #include "fakedri_drv.h"
|
---|
21 |
|
---|
22 |
|
---|
23 | #ifdef VBOXOGL_FAKEDRI
|
---|
24 | /*DECLEXPORT(void) VBOXGLXENTRYTAG(glXGetDriverConfig)(const char *driverName)
|
---|
25 | {
|
---|
26 | return glxim.GetDriverConfig(driverName);
|
---|
27 | }*/
|
---|
28 |
|
---|
29 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXFreeMemoryMESA)(Display *dpy, int scrn, void *pointer)
|
---|
30 | {
|
---|
31 | return glxim.FreeMemoryMESA(dpy, scrn, pointer);
|
---|
32 | }
|
---|
33 |
|
---|
34 | DECLEXPORT(GLXContext) VBOXGLXENTRYTAG(glXImportContextEXT)(Display *dpy, GLXContextID contextID)
|
---|
35 | {
|
---|
36 | return glxim.ImportContextEXT(dpy, contextID);
|
---|
37 | }
|
---|
38 |
|
---|
39 | DECLEXPORT(GLXContextID) VBOXGLXENTRYTAG(glXGetContextIDEXT)(const GLXContext ctx)
|
---|
40 | {
|
---|
41 | return glxim.GetContextIDEXT(ctx);
|
---|
42 | }
|
---|
43 |
|
---|
44 | DECLEXPORT(Bool) VBOXGLXENTRYTAG(glXMakeCurrentReadSGI)(Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
|
---|
45 | {
|
---|
46 | return glxim.MakeCurrentReadSGI(display, draw, read, ctx);
|
---|
47 | }
|
---|
48 |
|
---|
49 |
|
---|
50 | /*const char * VBOXGLXENTRYTAG(glXGetScreenDriver)(Display *dpy, int scrNum)
|
---|
51 | {
|
---|
52 | return glxim.GetScreenDriver(dpy, scrNum);
|
---|
53 | }*/
|
---|
54 |
|
---|
55 |
|
---|
56 | DECLEXPORT(Display*) VBOXGLXENTRYTAG(glXGetCurrentDisplayEXT)(void)
|
---|
57 | {
|
---|
58 | return glxim.GetCurrentDisplayEXT();
|
---|
59 | }
|
---|
60 |
|
---|
61 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXFreeContextEXT)(Display *dpy, GLXContext ctx)
|
---|
62 | {
|
---|
63 | return glxim.FreeContextEXT(dpy, ctx);
|
---|
64 | }
|
---|
65 |
|
---|
66 | /*Mesa internal*/
|
---|
67 | DECLEXPORT(int) VBOXGLXENTRYTAG(glXQueryContextInfoEXT)(Display *dpy, GLXContext ctx)
|
---|
68 | {
|
---|
69 | return glxim.QueryContextInfoEXT(dpy, ctx);
|
---|
70 | }
|
---|
71 |
|
---|
72 | DECLEXPORT(void *) VBOXGLXENTRYTAG(glXAllocateMemoryMESA)(Display *dpy, int scrn,
|
---|
73 | size_t size, float readFreq,
|
---|
74 | float writeFreq, float priority)
|
---|
75 | {
|
---|
76 | return glxim.AllocateMemoryMESA(dpy, scrn, size, readFreq, writeFreq, priority);
|
---|
77 | }
|
---|
78 |
|
---|
79 | DECLEXPORT(GLuint) VBOXGLXENTRYTAG(glXGetMemoryOffsetMESA)(Display *dpy, int scrn, const void *pointer )
|
---|
80 | {
|
---|
81 | return glxim.GetMemoryOffsetMESA(dpy, scrn, pointer);
|
---|
82 | }
|
---|
83 |
|
---|
84 |
|
---|
85 | DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap)
|
---|
86 | {
|
---|
87 | return glxim.CreateGLXPixmapMESA(dpy, visual, pixmap, cmap);
|
---|
88 | }
|
---|
89 | #endif
|
---|
90 |
|
---|
91 | /*Common glX functions*/
|
---|
92 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXCopyContext)( Display *dpy, GLXContext src, GLXContext dst, unsigned long mask)
|
---|
93 | {
|
---|
94 | return glxim.CopyContext(dpy, src, dst, mask);
|
---|
95 | }
|
---|
96 |
|
---|
97 |
|
---|
98 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXUseXFont)(Font font, int first, int count, int listBase)
|
---|
99 | {
|
---|
100 | return glxim.UseXFont(font, first, count, listBase);
|
---|
101 | }
|
---|
102 |
|
---|
103 | DECLEXPORT(CR_GLXFuncPtr) VBOXGLXENTRYTAG(glXGetProcAddress)(const GLubyte *name)
|
---|
104 | {
|
---|
105 | return glxim.GetProcAddress(name);
|
---|
106 | }
|
---|
107 |
|
---|
108 | DECLEXPORT(Bool) VBOXGLXENTRYTAG(glXQueryExtension)(Display *dpy, int *errorBase, int *eventBase)
|
---|
109 | {
|
---|
110 | return glxim.QueryExtension(dpy, errorBase, eventBase);
|
---|
111 | }
|
---|
112 |
|
---|
113 | DECLEXPORT(Bool) VBOXGLXENTRYTAG(glXIsDirect)(Display *dpy, GLXContext ctx)
|
---|
114 | {
|
---|
115 | return glxim.IsDirect(dpy, ctx);
|
---|
116 | }
|
---|
117 |
|
---|
118 | DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmap)(Display *dpy, XVisualInfo *vis, Pixmap pixmap)
|
---|
119 | {
|
---|
120 | return glxim.CreateGLXPixmap(dpy, vis, pixmap);
|
---|
121 | }
|
---|
122 |
|
---|
123 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXSwapBuffers)(Display *dpy, GLXDrawable drawable)
|
---|
124 | {
|
---|
125 | return glxim.SwapBuffers(dpy, drawable);
|
---|
126 | }
|
---|
127 |
|
---|
128 |
|
---|
129 | DECLEXPORT(GLXDrawable) VBOXGLXENTRYTAG(glXGetCurrentDrawable)(void)
|
---|
130 | {
|
---|
131 | return glxim.GetCurrentDrawable();
|
---|
132 | }
|
---|
133 |
|
---|
134 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXWaitGL)(void)
|
---|
135 | {
|
---|
136 | return glxim.WaitGL();
|
---|
137 | }
|
---|
138 |
|
---|
139 | DECLEXPORT(Display *) VBOXGLXENTRYTAG(glXGetCurrentDisplay)(void)
|
---|
140 | {
|
---|
141 | return glxim.GetCurrentDisplay();
|
---|
142 | }
|
---|
143 |
|
---|
144 | DECLEXPORT(const char *) VBOXGLXENTRYTAG(glXQueryServerString)(Display *dpy, int screen, int name)
|
---|
145 | {
|
---|
146 | return glxim.QueryServerString(dpy, screen, name);
|
---|
147 | }
|
---|
148 |
|
---|
149 | DECLEXPORT(GLXContext) VBOXGLXENTRYTAG(glXCreateContext)(Display *dpy, XVisualInfo *vis, GLXContext share, Bool direct)
|
---|
150 | {
|
---|
151 | return glxim.CreateContext(dpy, vis, share, direct);
|
---|
152 | }
|
---|
153 |
|
---|
154 | DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetConfig)(Display *dpy, XVisualInfo *vis, int attrib, int *value)
|
---|
155 | {
|
---|
156 | return glxim.GetConfig(dpy, vis, attrib, value);
|
---|
157 | }
|
---|
158 |
|
---|
159 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXWaitX)(void)
|
---|
160 | {
|
---|
161 | return glxim.WaitX();
|
---|
162 | }
|
---|
163 |
|
---|
164 | DECLEXPORT(GLXContext) VBOXGLXENTRYTAG(glXGetCurrentContext)(void)
|
---|
165 | {
|
---|
166 | return glxim.GetCurrentContext();
|
---|
167 | }
|
---|
168 |
|
---|
169 | DECLEXPORT(const char *) VBOXGLXENTRYTAG(glXGetClientString)(Display *dpy, int name)
|
---|
170 | {
|
---|
171 | return glxim.GetClientString(dpy, name);
|
---|
172 | }
|
---|
173 |
|
---|
174 | DECLEXPORT(Bool) VBOXGLXENTRYTAG(glXMakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx)
|
---|
175 | {
|
---|
176 | return glxim.MakeCurrent(dpy, drawable, ctx);
|
---|
177 | }
|
---|
178 |
|
---|
179 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyContext)(Display *dpy, GLXContext ctx)
|
---|
180 | {
|
---|
181 | return glxim.DestroyContext(dpy, ctx);
|
---|
182 | }
|
---|
183 |
|
---|
184 | DECLEXPORT(CR_GLXFuncPtr) VBOXGLXENTRYTAG(glXGetProcAddressARB)(const GLubyte *name)
|
---|
185 | {
|
---|
186 | return glxim.GetProcAddressARB(name);
|
---|
187 | }
|
---|
188 |
|
---|
189 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyGLXPixmap)(Display *dpy, GLXPixmap pix)
|
---|
190 | {
|
---|
191 | return glxim.DestroyGLXPixmap(dpy, pix);
|
---|
192 | }
|
---|
193 |
|
---|
194 | DECLEXPORT(Bool) VBOXGLXENTRYTAG(glXQueryVersion)(Display *dpy, int *major, int *minor)
|
---|
195 | {
|
---|
196 | return glxim.QueryVersion(dpy, major, minor);
|
---|
197 | }
|
---|
198 |
|
---|
199 | DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXChooseVisual)(Display *dpy, int screen, int *attribList)
|
---|
200 | {
|
---|
201 | return glxim.ChooseVisual(dpy, screen, attribList);
|
---|
202 | }
|
---|
203 |
|
---|
204 | DECLEXPORT(const char *) VBOXGLXENTRYTAG(glXQueryExtensionsString)(Display *dpy, int screen)
|
---|
205 | {
|
---|
206 | return glxim.QueryExtensionsString(dpy, screen);
|
---|
207 | }
|
---|
208 |
|
---|
209 | #if GLX_EXTRAS
|
---|
210 | DECLEXPORT(GLXPbufferSGIX) VBOXGLXENTRYTAG(glXCreateGLXPbufferSGIX)
|
---|
211 | (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list)
|
---|
212 | {
|
---|
213 | return glxim.CreateGLXPbufferSGIX(dpy, config, width, height, attrib_list);
|
---|
214 | }
|
---|
215 |
|
---|
216 | DECLEXPORT(int) VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)
|
---|
217 | (Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value)
|
---|
218 | {
|
---|
219 | return glxim.QueryGLXPbufferSGIX(dpy, pbuf, attribute, value);
|
---|
220 | }
|
---|
221 |
|
---|
222 | DECLEXPORT(GLXFBConfigSGIX *) VBOXGLXENTRYTAG(glXChooseFBConfigSGIX)
|
---|
223 | (Display *dpy, int screen, int *attrib_list, int *nelements)
|
---|
224 | {
|
---|
225 | return glxim.ChooseFBConfigSGIX(dpy, screen, attrib_list, nelements);
|
---|
226 | }
|
---|
227 |
|
---|
228 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf)
|
---|
229 | {
|
---|
230 | return glxim.DestroyGLXPbufferSGIX(dpy, pbuf);
|
---|
231 | }
|
---|
232 |
|
---|
233 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXSelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask)
|
---|
234 | {
|
---|
235 | return glxim.SelectEventSGIX(dpy, drawable, mask);
|
---|
236 | }
|
---|
237 |
|
---|
238 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXGetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask)
|
---|
239 | {
|
---|
240 | return glxim.GetSelectedEventSGIX(dpy, drawable, mask);
|
---|
241 | }
|
---|
242 |
|
---|
243 | DECLEXPORT(GLXFBConfigSGIX) VBOXGLXENTRYTAG(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis)
|
---|
244 | {
|
---|
245 | return glxim.GetFBConfigFromVisualSGIX(dpy, vis);
|
---|
246 | }
|
---|
247 |
|
---|
248 | DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config)
|
---|
249 | {
|
---|
250 | return glxim.GetVisualFromFBConfigSGIX(dpy, config);
|
---|
251 | }
|
---|
252 |
|
---|
253 | DECLEXPORT(GLXContext) VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)
|
---|
254 | (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct)
|
---|
255 | {
|
---|
256 | return glxim.CreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct);
|
---|
257 | }
|
---|
258 |
|
---|
259 | DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap)
|
---|
260 | {
|
---|
261 | return glxim.CreateGLXPixmapWithConfigSGIX(dpy, config, pixmap);
|
---|
262 | }
|
---|
263 |
|
---|
264 | DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value)
|
---|
265 | {
|
---|
266 | return glxim.GetFBConfigAttribSGIX(dpy, config, attribute, value);
|
---|
267 | }
|
---|
268 |
|
---|
269 |
|
---|
270 | /*
|
---|
271 | * GLX 1.3 functions
|
---|
272 | */
|
---|
273 | DECLEXPORT(GLXFBConfig *) VBOXGLXENTRYTAG(glXChooseFBConfig)(Display *dpy, int screen, ATTRIB_TYPE *attrib_list, int *nelements)
|
---|
274 | {
|
---|
275 | return glxim.ChooseFBConfig(dpy, screen, attrib_list, nelements);
|
---|
276 | }
|
---|
277 |
|
---|
278 | DECLEXPORT(GLXPbuffer) VBOXGLXENTRYTAG(glXCreatePbuffer)(Display *dpy, GLXFBConfig config, ATTRIB_TYPE *attrib_list)
|
---|
279 | {
|
---|
280 | return glxim.CreatePbuffer(dpy, config, attrib_list);
|
---|
281 | }
|
---|
282 |
|
---|
283 | DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const ATTRIB_TYPE *attrib_list)
|
---|
284 | {
|
---|
285 | return glxim.CreatePixmap(dpy, config, pixmap, attrib_list);
|
---|
286 | }
|
---|
287 |
|
---|
288 | DECLEXPORT(GLXWindow) VBOXGLXENTRYTAG(glXCreateWindow)(Display *dpy, GLXFBConfig config, Window win, ATTRIB_TYPE *attrib_list)
|
---|
289 | {
|
---|
290 | return glxim.CreateWindow(dpy, config, win, attrib_list);
|
---|
291 | }
|
---|
292 |
|
---|
293 |
|
---|
294 | DECLEXPORT(GLXContext) VBOXGLXENTRYTAG(glXCreateNewContext)
|
---|
295 | (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct)
|
---|
296 | {
|
---|
297 | return glxim.CreateNewContext(dpy, config, render_type, share_list, direct);
|
---|
298 | }
|
---|
299 |
|
---|
300 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyPbuffer)(Display *dpy, GLXPbuffer pbuf)
|
---|
301 | {
|
---|
302 | return glxim.DestroyPbuffer(dpy, pbuf);
|
---|
303 | }
|
---|
304 |
|
---|
305 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyPixmap)(Display *dpy, GLXPixmap pixmap)
|
---|
306 | {
|
---|
307 | return glxim.DestroyPixmap(dpy, pixmap);
|
---|
308 | }
|
---|
309 |
|
---|
310 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyWindow)(Display *dpy, GLXWindow win)
|
---|
311 | {
|
---|
312 | return glxim.DestroyWindow(dpy, win);
|
---|
313 | }
|
---|
314 |
|
---|
315 | DECLEXPORT(GLXDrawable) VBOXGLXENTRYTAG(glXGetCurrentReadDrawable)(void)
|
---|
316 | {
|
---|
317 | return glxim.GetCurrentReadDrawable();
|
---|
318 | }
|
---|
319 |
|
---|
320 | DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value)
|
---|
321 | {
|
---|
322 | return glxim.GetFBConfigAttrib(dpy, config, attribute, value);
|
---|
323 | }
|
---|
324 |
|
---|
325 | DECLEXPORT(GLXFBConfig *) VBOXGLXENTRYTAG(glXGetFBConfigs)(Display *dpy, int screen, int *nelements)
|
---|
326 | {
|
---|
327 | return glxim.GetFBConfigs(dpy, screen, nelements);
|
---|
328 | }
|
---|
329 |
|
---|
330 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXGetSelectedEvent)(Display *dpy, GLXDrawable draw, unsigned long *event_mask)
|
---|
331 | {
|
---|
332 | return glxim.GetSelectedEvent(dpy, draw, event_mask);
|
---|
333 | }
|
---|
334 |
|
---|
335 | DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXGetVisualFromFBConfig)(Display *dpy, GLXFBConfig config)
|
---|
336 | {
|
---|
337 | return glxim.GetVisualFromFBConfig(dpy, config);
|
---|
338 | }
|
---|
339 |
|
---|
340 | DECLEXPORT(Bool) VBOXGLXENTRYTAG(glXMakeContextCurrent)(Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
|
---|
341 | {
|
---|
342 | return glxim.MakeContextCurrent(display, draw, read, ctx);
|
---|
343 | }
|
---|
344 |
|
---|
345 | DECLEXPORT(int) VBOXGLXENTRYTAG(glXQueryContext)(Display *dpy, GLXContext ctx, int attribute, int *value)
|
---|
346 | {
|
---|
347 | return glxim.QueryContext(dpy, ctx, attribute, value);
|
---|
348 | }
|
---|
349 |
|
---|
350 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXQueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value)
|
---|
351 | {
|
---|
352 | return glxim.QueryDrawable(dpy, draw, attribute, value);
|
---|
353 | }
|
---|
354 |
|
---|
355 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXSelectEvent)(Display *dpy, GLXDrawable draw, unsigned long event_mask)
|
---|
356 | {
|
---|
357 | return glxim.SelectEvent(dpy, draw, event_mask);
|
---|
358 | }
|
---|
359 |
|
---|
360 | /*
|
---|
361 | #ifdef CR_EXT_texture_from_pixmap
|
---|
362 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXBindTexImageEXT)(Display *dpy, GLXDrawable draw, int buffer, const int *attrib_list)
|
---|
363 | {
|
---|
364 | return glxim.BindTexImageEXT(dpy, draw, buffer, attrib_list);
|
---|
365 | }
|
---|
366 |
|
---|
367 | DECLEXPORT(void) VBOXGLXENTRYTAG(glXReleaseTexImageEXT)(Display *dpy, GLXDrawable draw, int buffer)
|
---|
368 | {
|
---|
369 | return glxim.ReleaseTexImageEXT(dpy, draw, buffer);
|
---|
370 | }
|
---|
371 | #endif
|
---|
372 | */
|
---|
373 |
|
---|
374 | #endif /* GLX_EXTRAS */
|
---|
375 |
|
---|