commit 44db15aed760987acbd2892f62e74e3c2699afed
Author: Simon Howard <fraggle@soulsphere.org>
AuthorDate: Thu Jan 7 01:23:45 2016 +0100
Commit: Simon Howard <fraggle@soulsphere.org>
CommitDate: Thu Jan 7 01:23:45 2016 +0100
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.
---
src/i_video.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/i_video.c b/src/i_video.c
index 143a9b50..142e07a5 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -512,7 +512,7 @@ static void CreateUpscaledTexture(int w, int h)
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 @@ static void SetVideoMode(int w, int h)
// is going to change frequently.
texture = SDL_CreateTexture(renderer,
- SDL_PIXELFORMAT_ARGB8888,
+ SDL_GetWindowPixelFormat(screen),
SDL_TEXTUREACCESS_STREAMING,
SCREENWIDTH, SCREENHEIGHT);