mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-27 16:39:29 +00:00
Added gfx.startFrame and gfx.endFrame
This commit is contained in:
parent
0e42f25b8b
commit
2584e46816
2 changed files with 19 additions and 5 deletions
18
source/gfx.c
18
source/gfx.c
|
|
@ -5,14 +5,24 @@
|
|||
|
||||
u32 defaultColor = RGBA8(255, 255, 255, 255);
|
||||
|
||||
static int gfx_render(lua_State *L) {
|
||||
sf2d_end_frame();
|
||||
sf2d_swapbuffers();
|
||||
static int gfx_startFrame(lua_State *L) {
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gfx_endFrame(lua_State *L) {
|
||||
sf2d_end_frame();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gfx_render(lua_State *L) {
|
||||
sf2d_swapbuffers();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gfx_rectangle(lua_State *L) {
|
||||
int x = luaL_checkinteger(L, 1);
|
||||
int y = luaL_checkinteger(L, 2);
|
||||
|
|
@ -26,6 +36,8 @@ static int gfx_rectangle(lua_State *L) {
|
|||
}
|
||||
|
||||
static const struct luaL_Reg gfx_lib[] = {
|
||||
{ "startFrame", gfx_startFrame},
|
||||
{ "endFrame", gfx_endFrame },
|
||||
{ "render", gfx_render },
|
||||
{ "rectangle", gfx_rectangle },
|
||||
{ NULL, NULL }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue