-# $Id$
w('static void print_%s(void *user_data', func.name)
if ret.ctype!="void":
w(', %s ret', ret.ctype)
wl(' GlPrintData *gpd = (GlPrintData *)user_data;')
w(' snprintf(gpd->buffer, gpd->bufsize, "%s(', func.name)
first = True
+pname = None
for p in params:
if not first:
w(', ')
+ if p.name=="pname":
+ pname = p
if p.kind=="value":
- w('%s', p.io[1])
+ if pname and p.name=="param" and p.base_ctype=="GLint":
+ w('%%s')
+ elif p.type=="TextureComponentCount":
+ w('%%s')
+ else:
+ w('%s', p.io[1])
elif p.kind=="reference" and not p.io:
w('<ref:%s %%p>', p.type)
else:
for p in params+[ret]:
if p.ctype!="void":
if p.kind=="value":
- if len(p.io)>=3 and p.io[2]:
- w(', %s(%s, "%s")', p.io[2], p.name, p.type)
+ if pname and p.name=="param" and p.base_ctype=="GLint":
+ w(', print_parameter(%s, %s)', pname.name, p.name)
+ elif p.type=="TextureComponentCount":
+ w(', print_internal_format(%s)', p.name)
+ elif len(p.io)>=3 and p.io[2]:
+ if p.io[2][0]=='(':
+ w(', %s%s', p.io[2], p.name)
+ else:
+ w(', %s(%s, "%s")', p.io[2], p.name, p.type)
else:
w(', %s', p.name)
elif p.kind=="reference" and not p.io: