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