void ejoy2d_game_drawframe(struct game *G) { lua_pushvalue(G->L, DRAWFRAME_FUNCTION); call(G->L, 0, 0); lua_settop(G->L, TOP_FUNCTION); shader_flush(); label_flush(); }
void ejoy2d_game_drawframe(struct game *G) { reset_drawcall_count(); lua_pushvalue(G->L, DRAWFRAME_FUNCTION); call(G->L, 0, 0); lua_settop(G->L, TOP_FUNCTION); shader_flush(); label_flush(); //int cnt = drawcall_count(); //printf("-> %d\n", cnt); }
void scissor_pop() { assert(S.depth > 0); shader_flush(); --S.depth; if (S.depth == 0) { glDisable(GL_SCISSOR_TEST); return; } struct box * s = &S.s[S.depth]; screen_scissor(s->x,s->y,s->width,s->height); }
void scissor_push(int x, int y, int w, int h) { assert(S.depth < SCISSOR_MAX); shader_flush(); if (S.depth == 0) { glEnable(GL_SCISSOR_TEST); } struct box * s = &S.s[S.depth++]; s->x = x; s->y = y; s->width = w; s->height = h; screen_scissor(s->x,s->y,s->width,s->height); }
int pixel_flush(lua_State *L) { (void)L; shader_flush(); label_flush(); return 0; }
static int lendframe(lua_State *L) { shader_flush(); label_flush(); return 0; }