X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glwrap.h;h=bd2e265dac5e9d26c7d7a12821e08ea9f0c0e40a;hb=d307a28f436ae7f2d80ce40589328fc64f540947;hp=2dc18383c0c864e40e5b033ce67f2f209fe895dd;hpb=4ef9d74d4ff12afcc7e31bf13fe2a4993f06b987;p=fips diff --git a/glwrap.h b/glwrap.h index 2dc1838..bd2e265 100644 --- a/glwrap.h +++ b/glwrap.h @@ -37,10 +37,12 @@ glwrap_lookup (char *name); real_ ## function(__VA_ARGS__); \ } while (0); -/* Should be called at the end of ever function wrapper for an OpenGL - * function that ends a frame, (glXSwapBuffers and similar). - */ -void -glwrap_end_frame (void); +/* As GLWRAP_DEFER, but also set 'ret' to the return value */ +#define GLWRAP_DEFER_WITH_RETURN(ret, function,...) do { \ + static typeof(&function) real_ ## function; \ + if (! real_ ## function) \ + real_ ## function = glwrap_lookup (#function); \ + (ret) = real_ ## function(__VA_ARGS__); \ +} while (0); #endif