From d49b5caeb379cc2f49f7f3d04035ffc6fd60bf05 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 9 May 2023 12:14:19 +0100 Subject: Support rendering a to texture, use ARGB everywhere It was working anyway, but this seems more correct. --- tr8vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tr8vm.c b/tr8vm.c index 65dc86b..107b54b 100644 --- a/tr8vm.c +++ b/tr8vm.c @@ -252,7 +252,7 @@ int main(int argc, char *argv[]) return 1; } - SDL_Renderer *renderer = SDL_CreateRenderer(screen, -1, SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED); + SDL_Renderer *renderer = SDL_CreateRenderer(screen, -1, SDL_RENDERER_TARGETTEXTURE | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED); if (!renderer) { fprintf(stderr, "Failed to create the renderer: %s\n", SDL_GetError()); @@ -260,7 +260,7 @@ int main(int argc, char *argv[]) } SDL_SetHint("SDL_HINT_RENDER_SCALE_QUALITY", "0"); - SDL_Texture *canvas = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, TR8_W, TR8_H); + SDL_Texture *canvas = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, TR8_W, TR8_H); if (!canvas) { fprintf(stderr, "Failed to create the canvas: %s\n", SDL_GetError()); -- cgit v1.2.3