From f0a6c6757a795b8e186de0076836a87acef59fa7 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 15 Nov 2026 11:20:40 -0800 Subject: Graphics now allow resize Reorganize docs. Fix bugs X86 LOad+cmp scheduling. Math intrinsics --- chapter31/src/main/c/simple_graphics.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'chapter31/src/main/c/simple_graphics.c') diff --git a/chapter31/src/main/c/simple_graphics.c b/chapter31/src/main/c/simple_graphics.c index 40d66ba9..a35c28a6 100644 --- a/chapter31/src/main/c/simple_graphics.c +++ b/chapter31/src/main/c/simple_graphics.c @@ -74,7 +74,8 @@ static int load_graphics(void) { if (!candidate || candidate->version != SIMPLE_GRAPHICS_VERSION || !candidate->open || !candidate->present || !candidate->poll || !candidate->mouse_x || !candidate->mouse_y || !candidate->button || - !candidate->key || !candidate->close || !candidate->wait) { + !candidate->key || !candidate->close || !candidate->wait || + !candidate->width || !candidate->height || !candidate->present_size) { fprintf(stderr, "Simple graphics: incompatible MiniFB backend '%s'. Rebuild with make graphics.\n", path); dlclose(library); library = NULL; @@ -93,6 +94,11 @@ int32_t simple_gfx_open(const char *title, uint32_t width, uint32_t height) { int32_t simple_gfx_present(const uint32_t *pixels, uint32_t count) { return api ? api->present(pixels, count) : -1; } +int32_t simple_gfx_present_size(const uint32_t *pixels, uint32_t count, uint32_t width, uint32_t height) { + return api ? api->present_size(pixels, count, width, height) : -1; +} +uint32_t simple_gfx_width(void) { return api ? api->width() : 0; } +uint32_t simple_gfx_height(void) { return api ? api->height() : 0; } int32_t simple_gfx_poll(int32_t wait) { return api ? api->poll(wait) : -1; } int32_t simple_gfx_mouse_x(void) { return api ? api->mouse_x() : 0; } int32_t simple_gfx_mouse_y(void) { return api ? api->mouse_y() : 0; } -- cgit v1.2.3