X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglwrap.funcs.t;fp=source%2Fglwrap.funcs.t;h=108f329d5abbee3a2f9707a531ddf73e1739605b;hb=2e4973ec66cd8ae12d4253e3c3ad9e36a8a4bca6;hp=0000000000000000000000000000000000000000;hpb=c6b2f7585d51164dc32f4dd2a05855913e464c58;p=gldbg.git diff --git a/source/glwrap.funcs.t b/source/glwrap.funcs.t new file mode 100644 index 0000000..108f329 --- /dev/null +++ b/source/glwrap.funcs.t @@ -0,0 +1,29 @@ +# $Id$ +^typemap gl.tm +^iomap gl.io +^spec gl gl.spec +wl('%s APIENTRY %s(%s)', ret.ctype, func.name, ", ".join([p.ctype+" "+p.name for p in params])) +wl('{') +wl(' static %s (*orig)(%s);', ret.ctype, ", ".join([p.ctype for p in params])) +if ret.ctype!='void': + wl(' %s ret;', ret.ctype) +wl(' if(!orig)') +wl(' orig = glsym("%s");', func.name) +w(' ') +if ret.ctype!='void': + w('ret = ') +wl('orig(%s);', ", ".join([p.name for p in params])) +wl(' begin_packet(FUNC_%s);', func.name.upper()) +if ret.ctype!='void': + wl(' write_%s(ret);', ret.io[0]) +for p in params: + if p.kind=="value": + wl(' write_%s(%s);', p.io[0], p.name) + elif p.csize: + wl(' write_data(%s, %s);', p.name, p.csize) + else: + wl(' write_pointer(%s);', p.name) +wl(' send_packet();') +if ret.ctype!='void': + wl(' return ret;') +wl('}')