SDL: testcamera: create the texture as a streaming texture, since we'll update it every frame.

From e6e1412e20f693cd35d87cb228825c9db18bf849 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 2 May 2024 10:57:28 -0700
Subject: [PATCH] testcamera: create the texture as a streaming texture, since
 we'll update it every frame.

Also set the window size to the camera texture size
---
 test/testcamera.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/testcamera.c b/test/testcamera.c
index c0d9ec4763678..01e0fcf3d2e2e 100644
--- a/test/testcamera.c
+++ b/test/testcamera.c
@@ -189,9 +189,12 @@ int SDL_AppEvent(void *appstate, const SDL_Event *event)
                 return -1;
             }
 
+            /* Resize the window to match */
+            SDL_SetWindowSize(window, spec.width, spec.height);
+
             /* Create texture with appropriate format */
             SDL_assert(texture == NULL);
-            texture = SDL_CreateTexture(renderer, spec.format, SDL_TEXTUREACCESS_STATIC, spec.width, spec.height);
+            texture = SDL_CreateTexture(renderer, spec.format, SDL_TEXTUREACCESS_STREAMING, spec.width, spec.height);
             if (!texture) {
                 SDL_Log("Couldn't create texture: %s", SDL_GetError());
                 return -1;