1 | """
|
---|
2 | Copyright (C) 2009-2016 Oracle Corporation
|
---|
3 |
|
---|
4 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
5 | available from http://www.virtualbox.org. This file is free software;
|
---|
6 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
7 | General Public License (GPL) as published by the Free Software
|
---|
8 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
9 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
10 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
11 | """
|
---|
12 |
|
---|
13 | from __future__ import print_function
|
---|
14 | import sys
|
---|
15 |
|
---|
16 | #Note, this should match the fakedri_glxfuncsList.h order
|
---|
17 | glx_functions = [
|
---|
18 | "CopyContext",
|
---|
19 | "UseXFont",
|
---|
20 | #"GetDriverConfig",
|
---|
21 | "GetProcAddress",
|
---|
22 | "QueryExtension",
|
---|
23 | "IsDirect",
|
---|
24 | "DestroyGLXPbufferSGIX",
|
---|
25 | "QueryGLXPbufferSGIX",
|
---|
26 | "CreateGLXPixmap",
|
---|
27 | "CreateGLXPixmapWithConfigSGIX",
|
---|
28 | "QueryContext",
|
---|
29 | "CreateContextWithConfigSGIX",
|
---|
30 | "SwapBuffers",
|
---|
31 | "CreateNewContext",
|
---|
32 | "SelectEventSGIX",
|
---|
33 | "GetCurrentDrawable",
|
---|
34 | "ChooseFBConfig",
|
---|
35 | "WaitGL",
|
---|
36 | "GetFBConfigs",
|
---|
37 | "CreatePixmap",
|
---|
38 | "GetSelectedEventSGIX",
|
---|
39 | "GetCurrentReadDrawable",
|
---|
40 | "GetCurrentDisplay",
|
---|
41 | "QueryServerString",
|
---|
42 | "CreateWindow",
|
---|
43 | "SelectEvent",
|
---|
44 | "GetVisualFromFBConfigSGIX",
|
---|
45 | "GetFBConfigFromVisualSGIX",
|
---|
46 | "QueryDrawable",
|
---|
47 | "CreateContext",
|
---|
48 | "GetConfig",
|
---|
49 | "CreateGLXPbufferSGIX",
|
---|
50 | "CreatePbuffer",
|
---|
51 | "ChooseFBConfigSGIX",
|
---|
52 | "WaitX",
|
---|
53 | "GetVisualFromFBConfig",
|
---|
54 | #"GetScreenDriver",
|
---|
55 | "GetFBConfigAttrib",
|
---|
56 | "GetCurrentContext",
|
---|
57 | "GetClientString",
|
---|
58 | "DestroyPixmap",
|
---|
59 | "MakeCurrent",
|
---|
60 | "DestroyContext",
|
---|
61 | "GetProcAddressARB",
|
---|
62 | "GetSelectedEvent",
|
---|
63 | "DestroyPbuffer",
|
---|
64 | "DestroyWindow",
|
---|
65 | "DestroyGLXPixmap",
|
---|
66 | "QueryVersion",
|
---|
67 | "ChooseVisual",
|
---|
68 | "MakeContextCurrent",
|
---|
69 | "QueryExtensionsString",
|
---|
70 | "GetFBConfigAttribSGIX",
|
---|
71 | "FreeMemoryMESA",
|
---|
72 | "QueryContextInfoEXT",
|
---|
73 | "ImportContextEXT",
|
---|
74 | "GetContextIDEXT",
|
---|
75 | "MakeCurrentReadSGI",
|
---|
76 | "AllocateMemoryMESA",
|
---|
77 | "GetMemoryOffsetMESA",
|
---|
78 | "CreateGLXPixmapMESA",
|
---|
79 | "GetCurrentDisplayEXT",
|
---|
80 | "FreeContextEXT"
|
---|
81 | ];
|
---|
82 |
|
---|
83 | print('%include "iprt/asmdefs.mac"')
|
---|
84 | print("")
|
---|
85 | print("%ifdef RT_ARCH_AMD64")
|
---|
86 | print("extern glxim")
|
---|
87 | print("%else ; X86")
|
---|
88 | print("extern glxim")
|
---|
89 | print("%endif")
|
---|
90 | print("")
|
---|
91 |
|
---|
92 | for index in range(len(glx_functions)):
|
---|
93 | func_name = glx_functions[index]
|
---|
94 |
|
---|
95 | print("BEGINPROC_EXPORTED vbox_glX%s" % func_name)
|
---|
96 | print("%ifdef RT_ARCH_AMD64")
|
---|
97 | print("\tmov \trax, qword glxim+%d" % (8*index))
|
---|
98 | print("\tjmp \t[rax]")
|
---|
99 | print("%else ; X86")
|
---|
100 | print("\tmov \teax, dword glxim+%d" % (4*index))
|
---|
101 | print("\tjmp \t[eax]")
|
---|
102 | print("%endif")
|
---|
103 | print("ENDPROC vbox_glX%s" % func_name)
|
---|
104 | print("")
|
---|
105 |
|
---|