Fix the scaling and add nonthreaded

This commit is contained in:
2025-02-22 16:35:53 +01:00
parent 274c99f98b
commit 8158d35065
3 changed files with 28 additions and 19 deletions

View File

@@ -72,15 +72,15 @@ void init_switches(Switches *switches, SDL_Renderer *renderer, int x, int y, int
switches->rect->x = 0;
switches->rect->y = 0;
switches->rect->w = width;
switches->rect->h = height;
switches->rect->w = width + 2;
switches->rect->h = height + 2;
switches->outRect->x = x;
switches->outRect->y = y;
switches->outRect->w = width;
switches->outRect->h = height;
switches->outRect->w = width + 2;
switches->outRect->h = height + 2;
switches->texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, width, height);
switches->texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, width + 2, height + 2);
if (!switches->texture) {
fprintf(stderr, "Failed to create texture: %s\n", SDL_GetError());
exit(EXIT_FAILURE);