From 189eac273ba14c8ca0d22b31182b030ccc4c7756 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 25 Dec 2021 22:01:57 -0800 Subject: *: introduce a projection matrix and winmodes The bulk of this is mechanical wiring up of a projection_x to all the nodes. But this also introduces maintenance of the projection_x, with aspect-ratio preservation in two of the modes: WINDOWED and FULLSCREEN, with the previously default stretched-to-fill fullscreen mode now relegated to a third FILLSCREEN winmode. The default at startup is now an aspect ratio-preserving windowed mode. Simply press the 'f' key at any time to cycle through them. This was mostly done in sars to provide a source-available test for reproducing a fullscreen SDL2 bug I filed @ https://github.com/libsdl-org/SDL/issues/5139 Otherwise it's pretty silly to bother with doing anything on sars... but it is a handy little mule for such things. --- src/hungrycat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hungrycat.c') diff --git a/src/hungrycat.c b/src/hungrycat.c index bae9c10..8457d8a 100644 --- a/src/hungrycat.c +++ b/src/hungrycat.c @@ -57,7 +57,7 @@ static void * hungrycat_init(play_t *play, int argc, char *argv[]) hungrycat = calloc(1, sizeof(hungrycat_t)); fatal_if(!hungrycat, "Unable to allocate hungrycat_t"); - hungrycat->node = hungrycat_node_new(&(stage_conf_t){ .parent = sars->stage, .name = "hungrycat", .active = 1 }, &hungrycat->model_x); + hungrycat->node = hungrycat_node_new(&(stage_conf_t){ .parent = sars->stage, .name = "hungrycat", .active = 1 }, &sars->projection_x, &hungrycat->model_x); fatal_if(!hungrycat->node, "Unable to create hungrycat->node"); hungrycat->model_x = m4f_identity(); -- cgit v1.2.3