aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-09 12:14:19 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-09 12:14:19 +0100
commitd49b5caeb379cc2f49f7f3d04035ffc6fd60bf05 (patch)
treeaf79761754dd4c35a5a4900a5633efb07d13d1b6
parent37ffeeb5446fedc5f205f435c16dea1dce8ec3ad (diff)
downloadtr8vm-d49b5caeb379cc2f49f7f3d04035ffc6fd60bf05.tar.gz
tr8vm-d49b5caeb379cc2f49f7f3d04035ffc6fd60bf05.zip
Support rendering a to texture, use ARGB everywhere
It was working anyway, but this seems more correct.
-rw-r--r--tr8vm.c4
1 files 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());