Mersiles the best
-
Автор темы
- #1
Отрисовка blur:
oid _draw(ImDrawList* drawList, float alpha) noexcept
{
createTextures();
createShaders();
if (!blurTexture1 || !blurTexture2)
return;
drawList->AddCallback(&begin, nullptr);
for (int i = 0; i < 8; ++i) {
drawList->AddCallback(&firstPass, nullptr);
drawList->AddImageRounded(reinterpret_cast<ImTextureID>(blurTexture1), { -1.0f, -1.0f }, { 1.0f, 1.0f }, ImVec2(0, 0), ImVec2(1, 1), IM_COL32_WHITE,10, ImDrawFlags_RoundCornersAll);
drawList->AddCallback(&secondPass, nullptr);
drawList->AddImageRounded(reinterpret_cast<ImTextureID>(blurTexture2), { -1.0f, -1.0f }, { 1.0f, 1.0f }, ImVec2(0, 0), ImVec2(1, 1), IM_COL32_WHITE, 10, ImDrawFlags_RoundCornersAll);
}
drawList->AddCallback(&end, nullptr);
drawList->AddCallback(ImDrawCallback_ResetRenderState, nullptr);
#ifdef _WIN32
drawList->AddImageRounded(reinterpret_cast<ImTextureID>(blurTexture1), { 0.0f, 0.0f }, { backbufferWidth * 1.0f, backbufferHeight * 1.0f }, { 0.0f, 0.0f }, { 1.0f, 1.0f }, IM_COL32(155, 185 , 231, 255 * alpha),10, ImDrawFlags_RoundCornersAll);
#else
drawList->AddImage(reinterpret_cast<ImTextureID>(blurTexture1), { 0.0f, 0.0f }, { backbufferWidth * 1.0f, backbufferHeight * 1.0f }, { 0.0f, 1.0f }, { 1.0f, 0.0f }, IM_COL32(255, 255, 255, 255 * alpha));
#endif
}