# HG changeset patch # User Mike Becker # Date 1755121779 -7200 # Node ID cc5cd4c98e46dd7b238a21558a03dba204489955 # Parent b47de42f4598d48ad10a1f7f0ee2b68c8034fc5b fix that backdrop texture scale was not inverting the ui scale diff -r b47de42f4598 -r cc5cd4c98e46 test/snake/snake.c --- a/test/snake/snake.c Tue Aug 12 21:04:59 2025 +0200 +++ b/test/snake/snake.c Wed Aug 13 23:49:39 2025 +0200 @@ -127,7 +127,7 @@ } static void backdrop_create(void) { - const float scale = asc_active_window->ui_scale; + const float scale = 1.f / asc_active_window->ui_scale; AscSceneNode *node = asc_sprite( .texture = TEXTURE_BACKDROP, .texture_scale_mode = ASC_TEXTURE_SCALE_REPEAT, @@ -466,11 +466,14 @@ // load textures textures_init(); - // initialize the scenes + // initialize backdrop scene asc_scene_init(BACKDROP_SCENE, "backdrop", .type = ASC_CAMERA_ORTHO, .projection_update_func = asc_camera_ortho_update_size ); + backdrop_create(); + + // Initialize main scene asc_scene_init(MAIN_SCENE, "main", .type = ASC_CAMERA_ORTHO, .ortho.rect = ASC_RECT( @@ -483,7 +486,6 @@ .clear_color = ASC_RGBi(0, 32, 16), .viewport_update_func = main_scene_viewport_update ); - backdrop_create(); // create the fps counter AscSceneNode *fps_counter = fps_counter_create();