summaryrefslogtreecommitdiff
path: root/src/mem_fb.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-11-30 11:34:15 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-11-30 11:44:14 -0800
commit28d12a899645be09dae7e4cb8c293bf7fc64d6ad (patch)
treead195d50f3d488521add9f81f7fd291fc7d92743 /src/mem_fb.c
parent97b3dd17c1499c7ffd6d429a01d64ceaed233df2 (diff)
til: wire up til_video_setup_t throughout *_fb
Preparatory commit for aspect ratio settings at the fb layer. This slightly reworks how main::setup_video() integrates the selected fb backend's setup_func to better resemble how the module setup_funcs work now, with more clearly separated settings-building and setup-baking/finalizing phases. Which makes inserting the ratio setting in the middle of the front-end and back-end setup_funcs fairly trivial. Not a fan of all the casts, but there will probably be more helpers introduced to take care of that and make til_video_setup_t more of a first-class thing facilitating the fb stuff.
Diffstat (limited to 'src/mem_fb.c')
-rw-r--r--src/mem_fb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mem_fb.c b/src/mem_fb.c
index 94566d7..72de1e5 100644
--- a/src/mem_fb.c
+++ b/src/mem_fb.c
@@ -4,6 +4,7 @@
#include "til_fb.h"
#include "til_settings.h"
#include "til_util.h"
+#include "til_video_setup.h"
/* dummy mem_fb backend; render to anonymous memory */
/* useful for testing/debugging, and benchmarking systems even if headless */
@@ -16,7 +17,7 @@ struct mem_fb_page_t {
};
typedef struct mem_fb_setup_t {
- til_setup_t til_setup;
+ til_video_setup_t til_video_setup;
unsigned width, height;
} mem_fb_setup_t;
@@ -26,7 +27,7 @@ typedef struct mem_fb_t {
} mem_fb_t;
-static int mem_fb_init(const char *title, const til_setup_t *setup, void **res_context)
+static int mem_fb_init(const char *title, const til_video_setup_t *setup, void **res_context)
{
mem_fb_t *c;
int r;
@@ -169,9 +170,9 @@ static int mem_fb_setup(const til_settings_t *settings, til_setting_t **res_sett
return -ENOMEM;
if (sscanf(size->value, "%ux%u", &setup->width, &setup->height) != 2)
- return til_setup_free_with_failed_setting_ret_err(&setup->til_setup, size, res_setting, -EINVAL);
+ return til_setup_free_with_failed_setting_ret_err(&setup->til_video_setup.til_setup, size, res_setting, -EINVAL);
- *res_setup = &setup->til_setup;
+ *res_setup = &setup->til_video_setup.til_setup;
}
return 0;
© All Rights Reserved