summaryrefslogtreecommitdiffstats
path: root/src/VBox/GuestHost/OpenGL/error/error.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/error/error.py')
-rwxr-xr-xsrc/VBox/GuestHost/OpenGL/error/error.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/error/error.py b/src/VBox/GuestHost/OpenGL/error/error.py
new file mode 100755
index 00000000..7f3da03a
--- /dev/null
+++ b/src/VBox/GuestHost/OpenGL/error/error.py
@@ -0,0 +1,49 @@
+# Copyright (c) 2001, Stanford University
+# All rights reserved.
+#
+# See the file LICENSE.txt for information on redistributing this software.
+
+
+from __future__ import print_function
+import sys
+
+import apiutil
+
+apiutil.CopyrightC()
+
+
+print("""#include <stdio.h>
+#include "cr_error.h"
+#include "cr_spu.h"
+#include "state/cr_statetypes.h"
+
+#if defined(WINDOWS)
+#define ERROR_APIENTRY __stdcall
+#else
+#define ERROR_APIENTRY
+#endif
+
+#define ERROR_UNUSED(x) ((void)x)""")
+
+
+keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+for func_name in keys:
+ return_type = apiutil.ReturnType(func_name)
+ params = apiutil.Parameters(func_name)
+ print('\nstatic %s ERROR_APIENTRY error%s(%s)' % (return_type, func_name, apiutil.MakeDeclarationString(params )))
+ print('{')
+ # Handle the void parameter list
+ for (name, type, vecSize) in params:
+ print('\tERROR_UNUSED(%s);' % name)
+ print('\tcrError("ERROR SPU: Unsupported function gl%s called!");' % func_name)
+ if return_type != "void":
+ print('\treturn (%s)0;' % return_type)
+ print('}')
+
+print('SPUNamedFunctionTable _cr_error_table[] = {')
+for index in range(len(keys)):
+ func_name = keys[index]
+ print('\t{ "%s", (SPUGenericFunction) error%s },' % (func_name, func_name ))
+print('\t{ NULL, NULL }')
+print('};')