[15532] | 1 | # Copyright (c) 2001, Stanford University
|
---|
| 2 | # All rights reserved.
|
---|
| 3 | #
|
---|
| 4 | # See the file LICENSE.txt for information on redistributing this software.
|
---|
| 5 |
|
---|
| 6 | import sys
|
---|
| 7 |
|
---|
| 8 | import apiutil
|
---|
| 9 |
|
---|
| 10 | apiutil.CopyrightC()
|
---|
| 11 |
|
---|
| 12 | print """
|
---|
| 13 | /* DO NOT EDIT - THIS FILE GENERATED BY THE getprocaddress.py SCRIPT */
|
---|
| 14 |
|
---|
| 15 | #include "chromium.h"
|
---|
[17719] | 16 | #include "cr_error.h"
|
---|
[15532] | 17 | #include "cr_string.h"
|
---|
| 18 | #include "cr_version.h"
|
---|
| 19 | #include "stub.h"
|
---|
[18088] | 20 | #include "dri_glx.h"
|
---|
| 21 | #if defined(VBOXOGL_DRI) || defined(VBOXOGL_FAKEDRI)
|
---|
| 22 | #include "cr_gl.h"
|
---|
[21022] | 23 | #include "fakedri_drv.h"
|
---|
[18088] | 24 | #endif
|
---|
[15532] | 25 |
|
---|
| 26 | struct name_address {
|
---|
| 27 | const char *name;
|
---|
| 28 | CR_PROC address;
|
---|
| 29 | };
|
---|
| 30 |
|
---|
| 31 | static struct name_address functions[] = {
|
---|
| 32 | """
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | keys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
|
---|
| 36 | for func_name in keys:
|
---|
| 37 | if "Chromium" == apiutil.Category(func_name):
|
---|
| 38 | continue
|
---|
[30457] | 39 | if "VBox" == apiutil.Category(func_name):
|
---|
| 40 | continue
|
---|
[15532] | 41 | if func_name == "BoundsInfoCR":
|
---|
| 42 | continue
|
---|
| 43 | if "GL_chromium" == apiutil.Category(func_name):
|
---|
| 44 | pass #continue
|
---|
| 45 |
|
---|
| 46 | wrap = apiutil.GetCategoryWrapper(func_name)
|
---|
| 47 | name = "gl" + func_name
|
---|
[18088] | 48 | address = "VBOXGLTAG(gl" + func_name + ")"
|
---|
[15532] | 49 | if wrap:
|
---|
| 50 | print '#ifdef CR_%s' % wrap
|
---|
| 51 | print '\t{ "%s", (CR_PROC) %s },' % (name, address)
|
---|
| 52 | if wrap:
|
---|
| 53 | print '#endif'
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | print "\t/* Chromium binding/glue functions */"
|
---|
| 57 |
|
---|
| 58 | for func_name in keys:
|
---|
| 59 | if (func_name == "Writeback" or
|
---|
[23399] | 60 | func_name == "BoundsInfoCR" or
|
---|
| 61 | func_name == "GetUniformsLocations"):
|
---|
[15532] | 62 | continue
|
---|
| 63 | if apiutil.Category(func_name) == "Chromium":
|
---|
| 64 | print '\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name)
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | print """
|
---|
| 68 | { NULL, NULL }
|
---|
| 69 | };
|
---|
| 70 |
|
---|
| 71 | CR_PROC CR_APIENTRY crGetProcAddress( const char *name )
|
---|
| 72 | {
|
---|
| 73 | int i;
|
---|
| 74 | stubInit();
|
---|
| 75 |
|
---|
| 76 | for (i = 0; functions[i].name; i++) {
|
---|
| 77 | if (crStrcmp(name, functions[i].name) == 0) {
|
---|
| 78 | return functions[i].address;
|
---|
| 79 | }
|
---|
| 80 | }
|
---|
| 81 |
|
---|
[21022] | 82 |
|
---|
| 83 | #define GLXAPI_ENTRY(Func) if (!crStrcmp(name, "glX"#Func)) return (CR_PROC) &VBOXGLXENTRYTAG(glX##Func);
|
---|
| 84 | #include "fakedri_glxfuncsList.h"
|
---|
| 85 | #undef GLXAPI_ENTRY
|
---|
| 86 |
|
---|
| 87 | /*CR_EXT_texture_from_pixmap*/
|
---|
[18088] | 88 | if (!crStrcmp( name, "glXBindTexImageEXT" )) return (CR_PROC) VBOXGLXTAG(glXBindTexImageEXT);
|
---|
| 89 | if (!crStrcmp( name, "glXReleaseTexImageEXT" )) return (CR_PROC) VBOXGLXTAG(glXReleaseTexImageEXT);
|
---|
[16574] | 90 |
|
---|
| 91 | if (name) crDebug("Returning NULL for %s", name);
|
---|
[15532] | 92 | return NULL;
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | """
|
---|
| 96 |
|
---|
| 97 |
|
---|
| 98 |
|
---|
| 99 | # XXX should crGetProcAddress really handle WGL/GLX functions???
|
---|
| 100 |
|
---|
| 101 | print_foo = """
|
---|
| 102 | /* As these are Windows specific (i.e. wgl), define these now.... */
|
---|
| 103 | #ifdef WINDOWS
|
---|
| 104 | {
|
---|
| 105 | wglGetExtensionsStringEXTFunc_t wglGetExtensionsStringEXT = NULL;
|
---|
| 106 | wglChoosePixelFormatFunc_t wglChoosePixelFormatEXT = NULL;
|
---|
| 107 | wglGetPixelFormatAttribivEXTFunc_t wglGetPixelFormatAttribivEXT = NULL;
|
---|
| 108 | wglGetPixelFormatAttribfvEXTFunc_t wglGetPixelFormatAttribfvEXT = NULL;
|
---|
| 109 | if (!crStrcmp( name, "wglGetExtensionsStringEXT" )) return (CR_PROC) wglGetExtensionsStringEXT;
|
---|
| 110 | if (!crStrcmp( name, "wglChoosePixelFormatEXT" )) return (CR_PROC) wglChoosePixelFormatEXT;
|
---|
| 111 | if (!crStrcmp( name, "wglGetPixelFormatAttribivEXT" )) return (CR_PROC) wglGetPixelFormatAttribivEXT;
|
---|
| 112 | if (!crStrcmp( name, "wglGetPixelFormatAttribfvEXT" )) return (CR_PROC) wglGetPixelFormatAttribfvEXT;
|
---|
| 113 | }
|
---|
| 114 | #endif
|
---|
| 115 | """
|
---|