| 172 static void fps_counter_update(AscBehavior *behavior) { |
172 static void fps_counter_update(AscBehavior *behavior) { |
| 173 asc_ptr_cast(AscText, node, behavior->node); |
173 asc_ptr_cast(AscText, node, behavior->node); |
| 174 static float last_fps = 0.f; |
174 static float last_fps = 0.f; |
| 175 if (fabsf(asc_context.frame_rate - last_fps) > 1) { |
175 if (fabsf(asc_context.frame_rate - last_fps) > 1) { |
| 176 last_fps = asc_context.frame_rate; |
176 last_fps = asc_context.frame_rate; |
| 177 asc_text_printf(node, "%.2f FPS", asc_context.frame_rate); |
177 asc_text_printf(node, |
| |
178 "%.2f FPS\n" |
| |
179 "%llu draw calls\n" |
| |
180 "%llu triangles\n" |
| |
181 "%llu vertices", |
| |
182 asc_context.frame_rate, |
| |
183 asc_active_glctx->counters.draw_calls, |
| |
184 asc_active_glctx->counters.triangles_rendered, |
| |
185 asc_active_glctx->counters.vertices_rendered); |
| 178 } |
186 } |
| 179 } |
187 } |
| 180 |
188 |
| 181 static void fps_counter_tie_to_corner(AscBehavior *behavior) { |
189 static void fps_counter_tie_to_corner(AscBehavior *behavior) { |
| 182 // TODO: this should be replaced with some sort of UI layout manager |
190 // TODO: this should be replaced with some sort of UI layout manager |