瀏覽代碼

examples: a few renderer fixes.

Ryan C. Gordon 6 月之前
父節點
當前提交
4fdeb6861b

+ 2 - 2
examples/CMakeLists.txt

@@ -125,9 +125,9 @@ add_sdl_example_executable(renderer-primitives SOURCES renderer/02-primitives/pr
 add_sdl_example_executable(renderer-lines SOURCES renderer/03-lines/lines.c)
 add_sdl_example_executable(renderer-points SOURCES renderer/04-points/points.c)
 add_sdl_example_executable(renderer-rectangles SOURCES renderer/05-rectangles/rectangles.c)
-add_sdl_example_executable(renderer-textures SOURCES renderer/06-textures/textures.c)
+add_sdl_example_executable(renderer-textures SOURCES renderer/06-textures/textures.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp)
 add_sdl_example_executable(renderer-streaming-textures SOURCES renderer/07-streaming-textures/streaming-textures.c)
-add_sdl_example_executable(renderer-rotating-textures SOURCES renderer/08-rotating-textures/rotating-textures.c)
+add_sdl_example_executable(renderer-rotating-textures SOURCES renderer/08-rotating-textures/rotating-textures.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp)
 add_sdl_example_executable(audio-simple-playback SOURCES audio/01-simple-playback/simple-playback.c)
 add_sdl_example_executable(audio-simple-playback-callback SOURCES audio/02-simple-playback-callback/simple-playback-callback.c)
 add_sdl_example_executable(audio-load-wav SOURCES audio/03-load-wav/load-wav.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.wav)

+ 1 - 0
examples/renderer/06-textures/textures.c

@@ -119,6 +119,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
 /* This function runs once at shutdown. */
 void SDL_AppQuit(void *appstate)
 {
+    SDL_DestroyTexture(texture);
     /* SDL will clean up the window/renderer for us. */
 }
 

+ 1 - 0
examples/renderer/07-streaming-textures/streaming-textures.c

@@ -101,6 +101,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
 /* This function runs once at shutdown. */
 void SDL_AppQuit(void *appstate)
 {
+    SDL_DestroyTexture(texture);
     /* SDL will clean up the window/renderer for us. */
 }
 

+ 1 - 0
examples/renderer/08-rotating-textures/rotating-textures.c

@@ -105,6 +105,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
 /* This function runs once at shutdown. */
 void SDL_AppQuit(void *appstate)
 {
+    SDL_DestroyTexture(texture);
     /* SDL will clean up the window/renderer for us. */
 }