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 | from __future__ import print_function
|
---|
9 | import sys
|
---|
10 | sys.path.append( "../glapi_parser" )
|
---|
11 | import apiutil
|
---|
12 |
|
---|
13 | from pack_currenttypes import *
|
---|
14 |
|
---|
15 | apiutil.CopyrightC()
|
---|
16 |
|
---|
17 | print("""
|
---|
18 | /* DO NOT EDIT - THIS FILE GENERATED BY THE pack_currentheader.py SCRIPT */
|
---|
19 |
|
---|
20 | #ifndef CR_CURRENT_H
|
---|
21 | #define CR_CURRENT_H
|
---|
22 |
|
---|
23 | #include "state/cr_limits.h"
|
---|
24 | """)
|
---|
25 |
|
---|
26 | sorted_keys = sorted(current_fns.keys())
|
---|
27 |
|
---|
28 | for k in sorted_keys:
|
---|
29 | name = k.lower();
|
---|
30 | print("typedef struct {")
|
---|
31 | if 'array' in current_fns[k]:
|
---|
32 | print("\tconst unsigned char *ptr[%s];" % current_fns[k]['array'])
|
---|
33 | else:
|
---|
34 | print("\tconst unsigned char *ptr;")
|
---|
35 | for type in current_fns[k]['types']:
|
---|
36 | for size in current_fns[k]['sizes']:
|
---|
37 | if 'array' in current_fns[k]:
|
---|
38 | print("\tconst unsigned char *%s%d[%s];" % (type, size, current_fns[k]['array']))
|
---|
39 | else:
|
---|
40 | print("\tconst unsigned char *%s%d;" % (type, size))
|
---|
41 | print("} GL%s_p;\n" % name)
|
---|
42 |
|
---|
43 | print("typedef struct attrs {")
|
---|
44 | for k in sorted_keys:
|
---|
45 | name = k.lower()
|
---|
46 | field = '%s%s' % (k[:1].lower(),k[1:])
|
---|
47 | print("\tGL%s_p %s;" % (name,field))
|
---|
48 | print(" } CRCurrentStateAttr;")
|
---|
49 |
|
---|
50 |
|
---|
51 | print("typedef struct {")
|
---|
52 | print("""
|
---|
53 | CRCurrentStateAttr c;
|
---|
54 | unsigned char *vtx_op;
|
---|
55 | unsigned char *vtx_data;
|
---|
56 | unsigned char *begin_op;
|
---|
57 | unsigned char *begin_data;
|
---|
58 | unsigned int vtx_count;
|
---|
59 | unsigned int vtx_max;
|
---|
60 | unsigned int vtx_count_begin;
|
---|
61 | unsigned int attribsUsedMask;
|
---|
62 | unsigned int changedVertexAttrib;
|
---|
63 | } CRCurrentStatePointers;
|
---|
64 |
|
---|
65 | #endif /* CR_CURRENT_H */
|
---|
66 | """)
|
---|