VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.py@ 78942

Last change on this file since 78942 was 69310, checked in by vboxsync, 7 years ago

common/crOpenGL: scm updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 966 bytes
Line 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6from __future__ import print_function
7import sys
8
9import apiutil
10
11
12apiutil.CopyrightC()
13
14print("""#include <stdio.h>
15#include "cr_error.h"
16#include "cr_string.h"
17#include "cr_spu.h"
18#include "passthroughspu.h"
19""")
20
21keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
22
23
24print('SPUNamedFunctionTable _cr_passthrough_table[%d];' % ( len(keys) + 1 ))
25
26print("""
27static void __fillin(int offset, char *name, SPUGenericFunction func)
28{
29 _cr_passthrough_table[offset].name = crStrdup(name);
30 _cr_passthrough_table[offset].fn = func;
31}
32
33void BuildPassthroughTable( SPU *child )
34{""")
35
36for index in range(len(keys)):
37 func_name = keys[index]
38 print('\t__fillin(%3d, "%s", (SPUGenericFunction) child->dispatch_table.%s);' % (index, func_name, func_name ))
39print('\t__fillin(%3d, NULL, NULL);' % len(keys))
40print('}')
Note: See TracBrowser for help on using the repository browser.

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