6 from read
import read_gl
15 t[0] = string.strip(t[0])
16 f_out.write(
'static %s APIENTRY log%s(%s) {\n' % ( t[0], t[2], t[3] ))
18 base_params = string.split(t[3],
',')
22 format = t[1][1:] + t[2]
27 regex = re.compile(
'([a-zA-Z0-9]*)$')
28 name = regex.search(i).group(1)
29 type = string.strip(i[0:len(i)-len(name)])
38 if (type ==
'GLenum'):
40 params.append(
'EnumString(' + name +
')' )
41 elif (type ==
'GLfloat' or type ==
'GLclampf' or type ==
'GLdouble'):
44 elif (type ==
'GLint' or type ==
'GLuint' or type ==
'GLsizei' or type ==
'GLbyte' or type ==
'GLshort'
45 or type ==
'GLubyte' or type ==
'GLushort'):
48 elif (type ==
'GLboolean'):
50 params.append( name +
' ? "Y" : "N"' )
51 elif (type ==
'void'):
54 f_out.write(
'// unknown type: "%s" name: "%s"\n' % (type, name))
55 format +=
' \'' + type +
' ' + name +
'\''
56 f_out.write(
'\tfprintf( tr.logFile, "' + format +
'\\n"')
58 f_out.write(
', ' + par)
61 f_out.write(
'\treturn dll%s(' % t[2])
63 f_out.write(
'\tdll%s(' % t[2])
74 if __name__ ==
'__main__':