diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-05-09 12:14:19 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-05-09 12:14:19 +0100 |
commit | d49b5caeb379cc2f49f7f3d04035ffc6fd60bf05 (patch) | |
tree | af79761754dd4c35a5a4900a5633efb07d13d1b6 /tr8vm.c | |
parent | 37ffeeb5446fedc5f205f435c16dea1dce8ec3ad (diff) | |
download | tr8vm-d49b5caeb379cc2f49f7f3d04035ffc6fd60bf05.tar.gz tr8vm-d49b5caeb379cc2f49f7f3d04035ffc6fd60bf05.zip |
Support rendering a to texture, use ARGB everywhere
It was working anyway, but this seems more correct.
Diffstat (limited to 'tr8vm.c')
-rw-r--r-- | tr8vm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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()); |