#ifndef AC_GRAPH_H #define AC_GRAPH_H #include "framebuffer.h" #include "color.h" // Graphics state typedef struct { ACFramebuffer *fb; // Active render target ACFramebuffer *screen; // Primary screen buffer ACColor ink; // Current drawing color uint32_t ink_packed; // Pre-packed ARGB32 void *gpu_display; // ACDisplay* when SDL3 GPU is available (NULL = CPU only) } ACGraph; void graph_init(ACGraph *g, ACFramebuffer *screen); void graph_init_gpu(ACGraph *g, void *display); // Enable GPU-accelerated effects // Core primitives (matching AC API) void graph_wipe(ACGraph *g, ACColor color); void graph_ink(ACGraph *g, ACColor color); void graph_plot(ACGraph *g, int x, int y); void graph_line(ACGraph *g, int x0, int y0, int x1, int y1); void graph_line_thick(ACGraph *g, int x0, int y0, int x1, int y1, int thickness); void graph_box(ACGraph *g, int x, int y, int w, int h, int filled); void graph_circle(ACGraph *g, int cx, int cy, int r, int filled); // Effects void graph_scroll(ACGraph *g, int dx, int dy); void graph_blur(ACGraph *g, int strength); void graph_zoom(ACGraph *g, double level); void graph_contrast(ACGraph *g, double level); void graph_spin(ACGraph *g, double angle_radians); // QR code rendering void graph_qr(ACGraph *g, const char *text, int x, int y, int scale); // Off-screen buffer support ACFramebuffer *graph_painting(int w, int h); void graph_paste(ACGraph *g, ACFramebuffer *src, int dx, int dy); void graph_page(ACGraph *g, ACFramebuffer *target); // Switch render target #endif