ref: 44db15aed760987acbd2892f62e74e3c2699afed
parent: a06d40ddad9fc1445d25821f94afeded981fd055
author: Simon Howard <[email protected]>
date: Wed Jan 6 20:23:45 EST 2016
video: Use native pixel format. Instead of always converting to/from SDL_PIXELFORMAT_ARGB8888, use the native pixel format of the screen window. This may avoid some unnecessary conversion and be more efficient.
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -512,7 +512,7 @@
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
texture_upscaled = SDL_CreateTexture(renderer,
- SDL_PIXELFORMAT_ARGB8888,
+ SDL_GetWindowPixelFormat(screen),
SDL_TEXTUREACCESS_TARGET,
w_upscale*SCREENWIDTH,
h_upscale*SCREENHEIGHT);
@@ -1059,7 +1059,7 @@
// is going to change frequently.
texture = SDL_CreateTexture(renderer,
- SDL_PIXELFORMAT_ARGB8888,
+ SDL_GetWindowPixelFormat(screen),
SDL_TEXTUREACCESS_STREAMING,
SCREENWIDTH, SCREENHEIGHT);