1#define NONSTD_IMPLEMENTATION
 2#include "../nonstd.h"
 3
 4int main() {
 5	u32 width = 400;
 6	u32 height = 400;
 7	Canvas img = ppm_init(width, height);
 8
 9	// Background
10	ppm_fill(&img, COLOR_HEX(0x1a1a1a));
11
12	// Draw some shapes
13	ppm_draw_rect(&img, 50, 50, 100, 100, COLOR_RED);
14	ppm_draw_circle(&img, 250, 100, 40, COLOR_BLUE);
15	ppm_draw_triangle(&img, 50, 350, 150, 350, 100, 250, COLOR_YELLOW);
16	ppm_draw_line(&img, 200, 200, 350, 350, COLOR_GREEN);
17
18	// Random colors and macros
19	ppm_draw_rect(&img, 200, 250, 50, 80, COLOR_RGB(255, 165, 0));
20
21	if (ppm_save(&img, "example.ppm")) {
22		printf("Image saved to example.ppm\n");
23	} else {
24		printf("Failed to save image\n");
25	}
26
27	ppm_free(&img);
28	return 0;
29}