diff --git a/examples/example_sdl_vulkan/main.cpp b/examples/example_sdl_vulkan/main.cpp index 22fa7ef48aa57..f518bffabf376 100644 --- a/examples/example_sdl_vulkan/main.cpp +++ b/examples/example_sdl_vulkan/main.cpp @@ -448,6 +448,10 @@ int main(int, char**) bool show_demo_window = true; bool show_another_window = false; ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f); + wd->ClearValue.color.float32[0] = clear_color.x; + wd->ClearValue.color.float32[1] = clear_color.y; + wd->ClearValue.color.float32[2] = clear_color.z; + wd->ClearValue.color.float32[3] = clear_color.w; // Main loop bool done = false; @@ -496,7 +500,13 @@ int main(int, char**) ImGui::Checkbox("Another Window", &show_another_window); ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f - ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color + if(ImGui::ColorEdit3("clear color", (float*)&clear_color)) // Edit 3 floats representing a color + { + wd->ClearValue.color.float32[0] = clear_color.x; + wd->ClearValue.color.float32[1] = clear_color.y; + wd->ClearValue.color.float32[2] = clear_color.z; + wd->ClearValue.color.float32[3] = clear_color.w; + } if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated) counter++;