diff options
Diffstat (limited to 'src/nvg/composite.c')
-rw-r--r-- | src/nvg/composite.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/nvg/composite.c b/src/nvg/composite.c new file mode 100644 index 0000000..be5ff1f --- /dev/null +++ b/src/nvg/composite.c @@ -0,0 +1,35 @@ +#include <lua.h> +#include <lauxlib.h> +#include <nanovg.h> +#include "nvg.h" + + +int nvgGlobalCompositeOperation_bind(lua_State *L) +{ + NVGcontext **ctx = luaL_checkudata(L, 1, nvg_ctx_tname); + int op = luaL_checkinteger(L, 2); + nvgGlobalCompositeOperation(*ctx, op); + return 0; +} + + +int nvgGlobalCompositeBlendFunc_bind(lua_State *L) +{ + NVGcontext **ctx = luaL_checkudata(L, 1, nvg_ctx_tname); + int sfactor = luaL_checkinteger(L, 2); + int dfactor = luaL_checkinteger(L, 3); + nvgGlobalCompositeBlendFunc(*ctx, sfactor, dfactor); + return 0; +} + + +int nvgGlobalCompositeBlendFuncSeparate_bind(lua_State *L) +{ + NVGcontext **ctx = luaL_checkudata(L, 1, nvg_ctx_tname); + int src_rgb = luaL_checkinteger(L, 2); + int dst_rgb = luaL_checkinteger(L, 3); + int src_alpha = luaL_checkinteger(L, 4); + int dst_alpha = luaL_checkinteger(L, 5); + nvgGlobalCompositeBlendFuncSeparate(*ctx, src_rgb, dst_rgb, src_alpha, dst_alpha); + return 0; +} |