added debug render frame flag

pull/1/head
Sara 2023-04-10 16:57:09 +02:00
parent 96ffaf5f9e
commit 3e8eef4200
1 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,8 @@ float _render_width=0, _render_height=0;
view_t g_active_view = DEFAULT_VIEW;
int d_debug_next_frame = 0;
void screen_to_view(float *x, float *y) {
float xx = *x, yy = *y;
@ -119,8 +121,12 @@ drawcmd_delegate const drawcmd_funcs[] = {
&exec_rect_cmd
};
void exec_buffer() {
if(d_debug_next_frame) printf("debug capture of draw buffer\ncount: %zu\n", (size_t)(g_drawdata_endptr - g_drawdata));
for(const drawcmd_t* cmd = g_drawdata; cmd != g_drawdata_endptr; ++cmd) {
if(cmd->type > DRAWCMDTYPE_MIN && cmd->type < DRAWCMDTYPE_MAX) {
if(d_debug_next_frame) {
printf("depth: %d, type: %d\n", cmd->depth, cmd->type);
}
drawcmd_funcs[cmd->type](cmd);
}
}