Kaynağa Gözat

Update SDL RenderGeometry sample for SDL 2.0.20

See https://github.com/libsdl-org/SDL/issues/5093
Michael Ragazzon 3 yıl önce
ebeveyn
işleme
4791d7abc7

+ 2 - 2
CMakeLists.txt

@@ -722,7 +722,7 @@ if(BUILD_SAMPLES)
 					message("-- Can SDL2 sample w/OpenGL renderer be built - no - GLEW not found")
 			endif()
 			
-			if("${SDL2_VERSION}" VERSION_GREATER_EQUAL "2.0.18")
+			if("${SDL2_VERSION}" VERSION_GREATER_EQUAL "2.0.20")
 				message("-- Can SDL2 sample w/SDL-renderer be built - yes")
 				include_directories(${SDL2_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIR})
 
@@ -733,7 +733,7 @@ if(BUILD_SAMPLES)
 					RUNTIME DESTINATION ${SAMPLES_DIR}/sdl2_sdlrenderer
 					BUNDLE DESTINATION ${SAMPLES_DIR})
 			else()
-				message("-- Can SDL2 sample w/SDL-renderer be built - no - requires SDL 2.0.18 (found ${SDL2_VERSION})")
+				message("-- Can SDL2 sample w/SDL-renderer be built - no - requires SDL 2.0.20 (found ${SDL2_VERSION})")
 			endif()
 		else()
 				message("-- Can SDL2 samples be built - SDL2_image not found")

+ 1 - 1
Samples/basic/sdl2_sdlrenderer/src/RenderInterfaceSDL2.cpp

@@ -67,7 +67,7 @@ void RmlUiSDL2Renderer::RenderGeometry(Rml::Vertex* vertices, int num_vertices,
     int off3 = offsetof(Rml::Vertex, tex_coord);
     SDL_RenderGeometryRaw(mRenderer, sdl_texture, 
             (float *)((Uint8 *) vertices + off1), sz,
-            (int *)((Uint8 *) vertices + off2), sz,
+            (SDL_Color *)((Uint8 *) vertices + off2), sz,
             (float *)((Uint8 *) vertices + off3), sz,
             num_vertices, indices, num_indices, 4);