VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_current.py@ 41057

Last change on this file since 41057 was 33475, checked in by vboxsync, 14 years ago

crOpenGL/wddm: multithreading fix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.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
6# This script generates the pack_current.c file.
7
8import sys
9sys.path.append( "../glapi_parser" )
10import apiutil
11
12from pack_currenttypes import *
13
14apiutil.CopyrightC()
15
16print """
17/* DO NOT EDIT - THIS FILE GENERATED BY THE pack_current.py SCRIPT */
18
19#include <memory.h>
20#include "packer.h"
21#include "state/cr_currentpointers.h"
22
23#include <stdio.h>
24
25void crPackOffsetCurrentPointers( int offset )
26{
27 CR_GET_PACKER_CONTEXT(pc);
28 GLnormal_p *normal = &(pc->current.c.normal);
29 GLcolor_p *color = &(pc->current.c.color);
30 GLsecondarycolor_p *secondaryColor = &(pc->current.c.secondaryColor);
31 GLtexcoord_p *texCoord = &(pc->current.c.texCoord);
32 GLindex_p *index = &(pc->current.c.index);
33 GLedgeflag_p *edgeFlag = &(pc->current.c.edgeFlag);
34 GLvertexattrib_p *vertexAttrib = &(pc->current.c.vertexAttrib);
35 GLfogcoord_p *fogCoord = &(pc->current.c.fogCoord);
36 int i;
37"""
38
39for k in current_fns.keys():
40 name = '%s%s' % (k[:1].lower(),k[1:])
41 if current_fns[k].has_key( 'array' ):
42 print '\tfor (i = 0 ; i < %s ; i++)' % current_fns[k]['array']
43 print '\t{'
44 for type in current_fns[k]['types']:
45 for size in current_fns[k]['sizes']:
46 indent = ""
47 ptr = "%s->%s%d" % (name, type, size )
48 if current_fns[k].has_key( 'array' ):
49 ptr += "[i]"
50 indent = "\t"
51 print "%s\tif ( %s )" % (indent, ptr)
52 print "%s\t{" % indent
53 print "%s\t\t%s += offset;" % (indent, ptr )
54 print "%s\t}" % indent
55 if current_fns[k].has_key( 'array' ):
56 print '\t}'
57print """
58}
59
60void crPackNullCurrentPointers( void )
61{
62 CR_GET_PACKER_CONTEXT(pc);
63 CRCurrentStateAttr *c = &(pc->current.c);
64"""
65print '\tmemset ( c, 0, sizeof (CRCurrentStateAttr));'
66print "}"
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