diff options
Diffstat (limited to 'src/nvg/frame.c')
-rw-r--r-- | src/nvg/frame.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/nvg/frame.c b/src/nvg/frame.c new file mode 100644 index 0000000..0012431 --- /dev/null +++ b/src/nvg/frame.c @@ -0,0 +1,32 @@ +#include <lua.h> +#include <lauxlib.h> +#include <nanovg.h> +#include "nvg.h" + + +int nvgBeginFrame_bind(lua_State *L) +{ + struct NVGcontext **vg = luaL_checkudata(L, 1, nvg_ctx_tname); + float width = luaL_checknumber(L, 2); + float height = luaL_checknumber(L, 3); + float pixelRatio = luaL_checknumber(L, 4); + + nvgBeginFrame(*vg, width, height, pixelRatio); + return 0; +} + + +int nvgCancelFrame_bind(lua_State *L) +{ + struct NVGcontext **vg = luaL_checkudata(L, 1, nvg_ctx_tname); + nvgCancelFrame(*vg); + return 0; +} + + +int nvgEndFrame_bind(lua_State *L) +{ + struct NVGcontext **vg = luaL_checkudata(L, 1, nvg_ctx_tname); + nvgEndFrame(*vg); + return 0; +} |