local last_update_time = -1
local last_value = 0

function p.get_name()
    return "Num Rendered Quads Immediate"
end

function p.render(wid, min_x, min_y, max_x, max_y)
    local cur_time = ga_get_sys_f("time.current")
    if cur_time > last_update_time + 1.0 then
        last_update_time = cur_time
        last_value = ga_get_sys_i("stats.num_rendered_quads_imm")
    end

    local diff_y = max_y - min_y
    local char_h = diff_y * 0.75
    local char_w = char_h * 0.5
    local str = "Rendered Quads Imm: " .. base_local_str.add_commas(last_value)
    local green = std.vec(0.0, 1.0, 0.0)

    ga_win_set_front_color(wid, green)
    ga_win_set_char_size(wid, char_w, char_h)
    ga_win_txt(wid, min_x, min_y, str)
end
