]> git.tdb.fi Git - gldbg.git/blobdiff - source/glwrap.funcs.t
Allow tagging funtions for handcoding in templates
[gldbg.git] / source / glwrap.funcs.t
index 108f329d5abbee3a2f9707a531ddf73e1739605b..59bdb47b216e5e71506731bb4c0d2c0b63b2c8ae 100644 (file)
@@ -1,12 +1,12 @@
 # $Id$
-^typemap gl.tm
-^iomap gl.io
-^spec gl gl.spec
+!handcode glGetError
+!handcode glXGetProcAddress
+!handcode glXGetProcAddressARB
 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('    %s ret;', ret.ctype)
 wl('   if(!orig)')
 wl('           orig = glsym("%s");', func.name)
 w('    ')
@@ -15,7 +15,7 @@ if ret.ctype!='void':
 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])
+       wl('    write_%s(ret);', ret.io[0])
 for p in params:
        if p.kind=="value":
                wl('    write_%s(%s);', p.io[0], p.name)
@@ -24,6 +24,8 @@ for p in params:
        else:
                wl('    write_pointer(%s);', p.name)
 wl('   send_packet();')
+if not func.name.startswith("glX"):
+       wl('    check_error();')
 if ret.ctype!='void':
        wl('    return ret;')
 wl('}')