From ff9032bc225e66bda5f0aabc122766439e0fba78 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 9 Apr 2023 11:42:22 +0300 Subject: [PATCH] sdl 2x scale --- ~/SDL/Scale2x/scale2x.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ~/SDL/Scale2x/scale2x.c diff --git a/~/SDL/Scale2x/scale2x.c b/~/SDL/Scale2x/scale2x.c new file mode 100644 index 0000000..27ab53f --- /dev/null +++ b/~/SDL/Scale2x/scale2x.c @@ -0,0 +1,11 @@ +#define WIDTH 320 +#define HEIGHT 192 + +#define SCALE 2 + +SDL_Window * window = SDL_CreateWindow("SDL 2x scale", +SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, 0); +SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, 0); + +SDL_SetWindowSize(window, WIDTH * SCALE, HEIGHT * SCALE); +SDL_RenderSetScale(renderer, SCALE, SCALE);