VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_get.py@ 21781

Last change on this file since 21781 was 20467, checked in by vboxsync, 15 years ago

crOpenGL: aliases for pre opengl2.0 arb extensions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
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
6import sys
7
8import apiutil
9
10
11apiutil.CopyrightC()
12
13print """
14#include "cr_spu.h"
15#include "chromium.h"
16#include "cr_error.h"
17#include "cr_mem.h"
18#include "cr_net.h"
19#include "server_dispatch.h"
20#include "server.h"
21"""
22
23max_components = {
24 'GetClipPlane': 4,
25 'GetCombinerStageParameterfvNV': 4,
26 'GetCombinerStageParameterivNV': 4,
27 'GetCombinerOutputParameterfvNV': 4,
28 'GetCombinerOutputParameterivNV': 4,
29 'GetCombinerInputParameterfvNV': 4,
30 'GetCombinerInputParameterivNV': 4,
31 'GetFinalCombinerInputParameterfvNV': 4,
32 'GetFinalCombinerInputParameterivNV': 4,
33 'GetLightfv': 4,
34 'GetLightiv': 4,
35 'GetMaterialfv': 4,
36 'GetMaterialiv': 4,
37 'GetPolygonStipple': 32*32/8,
38 'GetTexEnvfv': 4,
39 'GetTexEnviv': 4,
40 'GetTexGendv': 4,
41 'GetTexGenfv': 4,
42 'GetTexGeniv': 4,
43 'GetTexLevelParameterfv': 1,
44 'GetTexLevelParameteriv': 1,
45 'GetTexParameterfv': 4,
46 'GetTexParameteriv': 4,
47 'GetProgramParameterdvNV': 4,
48 'GetProgramParameterfvNV': 4,
49 'GetProgramivNV': 1,
50 'GetTrackMatrixivNV': 1,
51 'GetVertexAttribPointervNV': 1,
52 'GetVertexAttribdvNV': 4,
53 'GetVertexAttribfvNV': 4,
54 'GetVertexAttribivNV': 4,
55 'GetFenceivNV': 1,
56 'GetVertexAttribdvARB': 4,
57 'GetVertexAttribfvARB': 4,
58 'GetVertexAttribivARB': 4,
59 'GetVertexAttribPointervARB': 1,
60 'GetProgramNamedParameterdvNV': 4,
61 'GetProgramNamedParameterfvNV': 4,
62 'GetProgramLocalParameterdvARB': 4,
63 'GetProgramLocalParameterfvARB': 4,
64 'GetProgramEnvParameterdvARB': 4,
65 'GetProgramEnvParameterfvARB': 4,
66 'GetProgramivARB': 1,
67 'AreProgramsResidentNV': 1,
68 'GetBufferParameterivARB': 1,
69 'GetBufferPointervARB': 1,
70 'GetQueryObjectivARB' : 1,
71 'GetQueryObjectuivARB' : 1,
72 'GetQueryivARB' : 1,
73 'GetProgramiv' : 1,
74 'GetShaderiv' : 1,
75 'GetObjectParameterfvARB': 1,
76 'GetObjectParameterivARB': 1
77}
78
79no_pnames = [
80 'GetClipPlane',
81 'GetPolygonStipple',
82 'GetProgramLocalParameterdvARB',
83 'GetProgramLocalParameterfvARB',
84 'GetProgramNamedParameterdvNV',
85 'GetProgramNamedParameterfvNV',
86 'GetProgramNamedParameterdvNV',
87 'GetProgramNamedParameterfvNV',
88 'GetProgramEnvParameterdvARB',
89 'GetProgramEnvParameterfvARB',
90 'GetProgramivARB',
91 'AreProgramsResidentNV',
92 'GetProgramiv',
93 'GetShaderiv',
94 'GetObjectParameterfvARB',
95 'GetObjectParameterivARB'
96];
97
98from get_components import *;
99
100keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
101for func_name in keys:
102 #(return_type, arg_names, arg_types) = gl_mapping[func_name]
103 if ("get" in apiutil.Properties(func_name) and
104 apiutil.ReturnType(func_name) == "void" and
105 not apiutil.FindSpecial( "server", func_name )):
106
107 params = apiutil.Parameters(func_name)
108
109 print 'void SERVER_DISPATCH_APIENTRY crServerDispatch%s( %s )' % (func_name, apiutil.MakeDeclarationString( params ) )
110 print '{'
111
112 lastParam = params[-1]
113 assert apiutil.IsPointer(lastParam[1])
114 local_argtype = apiutil.PointerType(lastParam[1])
115 local_argname = 'local_%s' % lastParam[0]
116
117 print '\t%s %s[%d];' % ( local_argtype, local_argname, max_components[func_name] )
118 print '\t(void) %s;' % lastParam[0]
119
120 params[-1] = (local_argname, local_argtype, 0)
121
122 print '\tcr_server.head_spu->dispatch_table.%s( %s );' % ( func_name, apiutil.MakeCallString(params) )
123 if func_name in no_pnames:
124 print '\tcrServerReturnValue( &(%s[0]), %d*sizeof(%s) );' % (local_argname, max_components[func_name], local_argtype );
125 else:
126 print '\tcrServerReturnValue( &(%s[0]), lookupComponents(pname)*sizeof(%s) );' % (local_argname, local_argtype );
127 print '}\n'
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