1 | # Copyright (c) 2001, Stanford University
|
---|
2 | # All rights reserved.
|
---|
3 | #
|
---|
4 | # See the file LICENSE.txt for information on redistributing this software.
|
---|
5 |
|
---|
6 | # This script generates the include/state/cr_currentpointers.h file.
|
---|
7 |
|
---|
8 | import sys
|
---|
9 | sys.path.append( "../glapi_parser" )
|
---|
10 | import apiutil
|
---|
11 |
|
---|
12 | from pack_currenttypes import *
|
---|
13 |
|
---|
14 | apiutil.CopyrightC()
|
---|
15 |
|
---|
16 | print """
|
---|
17 | /* DO NOT EDIT - THIS FILE GENERATED BY THE pack_currentheader.py SCRIPT */
|
---|
18 |
|
---|
19 | #ifndef CR_CURRENT_H
|
---|
20 | #define CR_CURRENT_H
|
---|
21 |
|
---|
22 | #include "state/cr_limits.h"
|
---|
23 | """
|
---|
24 |
|
---|
25 | for k in current_fns.keys():
|
---|
26 | name = k.lower();
|
---|
27 | print "typedef struct {"
|
---|
28 | if current_fns[k].has_key( 'array' ):
|
---|
29 | print "\tconst unsigned char *ptr[%s];" % current_fns[k]['array']
|
---|
30 | else:
|
---|
31 | print "\tconst unsigned char *ptr;"
|
---|
32 | for type in current_fns[k]['types']:
|
---|
33 | for size in current_fns[k]['sizes']:
|
---|
34 | if current_fns[k].has_key( 'array' ):
|
---|
35 | print "\tconst unsigned char *%s%d[%s];" % (type, size, current_fns[k]['array'])
|
---|
36 | else:
|
---|
37 | print "\tconst unsigned char *%s%d;" % (type, size)
|
---|
38 | print "} GL%s_p;\n" % name
|
---|
39 |
|
---|
40 | print "typedef struct attrs {"
|
---|
41 | for k in current_fns.keys():
|
---|
42 | name = k.lower()
|
---|
43 | field = '%s%s' % (k[:1].lower(),k[1:])
|
---|
44 | print "\tGL%s_p %s;" % (name,field)
|
---|
45 | print " } CRCurrentStateAttr;"
|
---|
46 |
|
---|
47 |
|
---|
48 | print "typedef struct {"
|
---|
49 | print """
|
---|
50 | CRCurrentStateAttr c;
|
---|
51 | unsigned char *vtx_op;
|
---|
52 | unsigned char *vtx_data;
|
---|
53 | unsigned char *begin_op;
|
---|
54 | unsigned char *begin_data;
|
---|
55 | unsigned int vtx_count;
|
---|
56 | unsigned int vtx_max;
|
---|
57 | unsigned int vtx_count_begin;
|
---|
58 | unsigned int attribsUsedMask;
|
---|
59 |
|
---|
60 | } CRCurrentStatePointers;
|
---|
61 |
|
---|
62 | #endif /* CR_CURRENT_H */
|
---|
63 | """
|
---|