Examples: Reworked setup of clear color to be compatible with transparent values. (#2693, #2764, #2766, #2873, #3447, #3813, #3816)

This commit is contained in:
ocornut
2021-02-17 19:29:39 +01:00
parent bda12e5fdd
commit 6a161b8789
20 changed files with 36 additions and 23 deletions

View File

@ -520,7 +520,10 @@ int main(int, char**)
const bool is_minimized = (draw_data->DisplaySize.x <= 0.0f || draw_data->DisplaySize.y <= 0.0f);
if (!is_minimized)
{
memcpy(&wd->ClearValue.color.float32[0], &clear_color, 4 * sizeof(float));
wd->ClearValue.color.float32[0] = clear_color.x * clear_color.w;
wd->ClearValue.color.float32[1] = clear_color.y * clear_color.w;
wd->ClearValue.color.float32[2] = clear_color.z * clear_color.w;
wd->ClearValue.color.float32[3] = clear_color.w;
FrameRender(wd, draw_data);
FramePresent(wd);
}