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