VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_currentheader.py@ 70939

Last change on this file since 70939 was 69392, checked in by vboxsync, 7 years ago

GuestHost/OpenGL: scm updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.6 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
6# This script generates the include/state/cr_currentpointers.h file.
7
8from __future__ import print_function
9import sys
10sys.path.append( "../glapi_parser" )
11import apiutil
12
13from pack_currenttypes import *
14
15apiutil.CopyrightC()
16
17print("""
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
26sorted_keys = sorted(current_fns.keys())
27
28for 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
43print("typedef struct attrs {")
44for 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))
48print(" } CRCurrentStateAttr;")
49
50
51print("typedef struct {")
52print("""
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""")
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