#include "../graphics.c" enum { MAX_NUM_PIXELS = 10 * 1024 * 1024, }; b8 has_screenshot = 0; i64 width = 0; i64 height = 0; vec4_f32 pixels[MAX_NUM_PIXELS] = {0}; void update_and_render_frame(void) { if (!has_screenshot) { take_screenshot(&width, &height, MAX_NUM_PIXELS, pixels); has_screenshot = 1; } handle_main_window_events(); draw_pixels( (Box) { .width = g_platform.real_width, .height = g_platform.real_height, }, (Pixel_Buffer) { .width = width, .height = height, .stride = width, .pixels = pixels, } ); render_main_window_frame(); } i32 main(i32 argc, c8 **argv) { (void) argc; (void) argv; g_platform = (Platform) { .title = "Screenshot", }; run_main_window_event_loop(); return 0; }