VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/getprocaddress.py@ 38113

最後變更 在這個檔案從38113是 37032,由 vboxsync 提交於 14 年 前

crOpenGL: fix missing updates for gnome3 on ubuntu 11.04

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 3.5 KB
 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6import sys
7
8import apiutil
9
10apiutil.CopyrightC()
11
12print """
13/* DO NOT EDIT - THIS FILE GENERATED BY THE getprocaddress.py SCRIPT */
14
15#include "chromium.h"
16#include "cr_error.h"
17#include "cr_string.h"
18#include "cr_version.h"
19#include "stub.h"
20#include "dri_glx.h"
21#if defined(VBOXOGL_DRI) || defined(VBOXOGL_FAKEDRI)
22#include "cr_gl.h"
23#include "fakedri_drv.h"
24#endif
25
26struct name_address {
27 const char *name;
28 CR_PROC address;
29};
30
31static struct name_address functions[] = {
32"""
33
34
35keys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
36for func_name in keys:
37 if "Chromium" == apiutil.Category(func_name):
38 continue
39 if "VBox" == apiutil.Category(func_name):
40 continue
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
48 address = "VBOXGLTAG(gl" + func_name + ")"
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
56print "\t/* Chromium binding/glue functions */"
57
58for func_name in keys:
59 if (func_name == "Writeback" or
60 func_name == "BoundsInfoCR" or
61 func_name == "GetUniformsLocations"):
62 continue
63 if apiutil.Category(func_name) == "Chromium":
64 print '\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name)
65
66
67print """
68 { NULL, NULL }
69};
70
71CR_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
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*/
88 if (!crStrcmp( name, "glXBindTexImageEXT" )) return (CR_PROC) VBOXGLXTAG(glXBindTexImageEXT);
89 if (!crStrcmp( name, "glXReleaseTexImageEXT" )) return (CR_PROC) VBOXGLXTAG(glXReleaseTexImageEXT);
90
91#if defined(Linux) && defined(CR_EXT_framebuffer_blit)
92 /* Hacky way to make gnome3 happy on ubuntu 11.04, even though glBlitFramebuffer is part of OpenGL 3.0 spec,
93 * it expects to find glBlitFramebuffer and not glBlitFramebufferEXT after checking for EXT_framebuffer_blit support.
94 * Untill 3.0 support, it's better to go this way instead of adding an alias to src/VBox/GuestHost/OpenGL/glapi_parser/apispec.txt.
95 */
96 if (!crStrcmp(name, "glBlitFramebuffer")) return crGetProcAddress("glBlitFramebufferEXT");
97#endif
98
99 if (name) crDebug("Returning NULL for %s", name);
100 return NULL;
101}
102
103"""
104
105
106
107# XXX should crGetProcAddress really handle WGL/GLX functions???
108
109print_foo = """
110/* As these are Windows specific (i.e. wgl), define these now.... */
111#ifdef WINDOWS
112 {
113 wglGetExtensionsStringEXTFunc_t wglGetExtensionsStringEXT = NULL;
114 wglChoosePixelFormatFunc_t wglChoosePixelFormatEXT = NULL;
115 wglGetPixelFormatAttribivEXTFunc_t wglGetPixelFormatAttribivEXT = NULL;
116 wglGetPixelFormatAttribfvEXTFunc_t wglGetPixelFormatAttribfvEXT = NULL;
117 if (!crStrcmp( name, "wglGetExtensionsStringEXT" )) return (CR_PROC) wglGetExtensionsStringEXT;
118 if (!crStrcmp( name, "wglChoosePixelFormatEXT" )) return (CR_PROC) wglChoosePixelFormatEXT;
119 if (!crStrcmp( name, "wglGetPixelFormatAttribivEXT" )) return (CR_PROC) wglGetPixelFormatAttribivEXT;
120 if (!crStrcmp( name, "wglGetPixelFormatAttribfvEXT" )) return (CR_PROC) wglGetPixelFormatAttribfvEXT;
121 }
122#endif
123"""
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette