From 5521347322892f4997644925acfe1edf2c6b0bbf Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 3 Aug 2025 03:44:09 -0400 Subject: lib: liboda: Add oda_plotwin() window plotter Introduce the oda_plotwin() function to allow one to plot a pixel onto a window relative to the starting X/Y position of it. Plotting to (0,0) draws to the top left corner of the window. Signed-off-by: Ian Moffett --- lib/liboda/include/liboda/oda.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/liboda/include') diff --git a/lib/liboda/include/liboda/oda.h b/lib/liboda/include/liboda/oda.h index d807a50..10738a9 100644 --- a/lib/liboda/include/liboda/oda.h +++ b/lib/liboda/include/liboda/oda.h @@ -80,8 +80,26 @@ struct oda_wattr { odadimm_t w, h; }; +/* + * A pixel point that can be plotted + * onto a window. + * + * @x,y: Point position + * @rgb: Color (RGB) + * @window: Window this will be plotted to + * + * Just set x, y, the color (rgb) then point it + * to a window! + */ +struct oda_point { + odapos_t x, y; + odacolor_t rgb; + struct oda_window *window; +}; + int oda_reqwin(struct oda_wattr *params, struct oda_window **res); int oda_termwin(struct oda_state *state, struct oda_window *win); +int oda_plotwin(struct oda_state *state, const struct oda_point *point); int oda_start_win(struct oda_state *state, struct oda_window *win); int oda_init(struct oda_state *res); -- cgit v1.2.3