5 !handcode glXGetProcAddress
6 !handcode glXGetProcAddressARB
7 !handcode eglGetProcAddress
8 wl('%s APIENTRY %s(%s)', ret.ctype, func.name, ", ".join([p.ctype+" "+p.name for p in params]))
10 wl(' static %s (*orig)(%s);', ret.ctype, ", ".join([p.ctype for p in params]))
12 wl(' %s ret;', ret.ctype)
14 wl(' orig = glsym("%s");', func.name)
15 wl(' begin_packet(FUNC_%s);', func.name.upper())
18 if p.direction=="out" and not head_sent:
19 wl(' send_partial_packet();')
23 wl('orig(%s);', ", ".join([q.name for q in params]))
26 wl(' write_%s(%s);', p.io[0].replace(' ', '_'), p.name)
27 elif p.kind=="array" and p.io and p.io[0]=="string":
28 wl(' write_string_array(%s, %s);', p.name, p.csize)
30 wl(' write_data(%s, %s);', p.name, p.csize)
32 wl(' write_pointer(%s);', p.name)
35 wl(' send_partial_packet();')
36 wl(' ret = orig(%s);', ", ".join([p.name for p in params]))
38 wl(' write_%s(ret);', ret.io[0].replace(' ', '_'))
41 wl(' orig(%s);', ", ".join([p.name for p in params]))
42 if not func.name.startswith("glX"):