mirror of https://github.com/auygun/kaliber.git
Fix for flickering imgui when switching renderer
Use the geometry from last frame in ImguiBackend::CreateRenderResources if available.
This commit is contained in:
parent
61a96c7988
commit
8b149bf8f4
|
@ -80,7 +80,10 @@ void ImguiBackend::Shutdown() {
|
||||||
void ImguiBackend::CreateRenderResources(Renderer* renderer) {
|
void ImguiBackend::CreateRenderResources(Renderer* renderer) {
|
||||||
renderer_ = renderer;
|
renderer_ = renderer;
|
||||||
shader_->SetRenderer(renderer);
|
shader_->SetRenderer(renderer);
|
||||||
|
|
||||||
geometries_.clear();
|
geometries_.clear();
|
||||||
|
if (ImGui::GetCurrentContext() && ImGui::GetDrawData())
|
||||||
|
Render();
|
||||||
|
|
||||||
auto source = std::make_unique<ShaderSource>();
|
auto source = std::make_unique<ShaderSource>();
|
||||||
if (source->Load("engine/imgui.glsl")) {
|
if (source->Load("engine/imgui.glsl")) {
|
||||||
|
|
Loading…
Reference in New Issue