diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-03 03:44:09 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-03 03:44:09 -0400 |
commit | 5521347322892f4997644925acfe1edf2c6b0bbf (patch) | |
tree | 20b4386fd799f90e2a0d4c227bfac58b08be7460 /lib/liboda/include | |
parent | a50119daf92b52951c3a68fe70d8d5bf548adf55 (diff) |
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 <ian@osmora.org>
Diffstat (limited to 'lib/liboda/include')
-rw-r--r-- | lib/liboda/include/liboda/oda.h | 18 |
1 files changed, 18 insertions, 0 deletions
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); |