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