Skip to content

Commit

Permalink
Fix config panel switches
Browse files Browse the repository at this point in the history
  • Loading branch information
keith2018 committed Nov 26, 2023
1 parent 1ce9a4d commit 6af1620
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions src/Viewer/ConfigPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,30 +150,28 @@ void ConfigPanel::drawSettings() {
ImGui::Checkbox("shadow floor", &config_.showFloor);
config_.shadowMap = config_.showFloor;

if (config_.wireframe) {
return;
}

// light
ImGui::Separator();
ImGui::Text("ambient color");
ImGui::ColorEdit3("ambient color", (float *) &config_.ambientColor, ImGuiColorEditFlags_NoLabel);

ImGui::Separator();
ImGui::Checkbox("point light", &config_.showLight);
if (config_.showLight) {
ImGui::Text("light color");
ImGui::ColorEdit3("light color", (float *) &config_.pointLightColor, ImGuiColorEditFlags_NoLabel);

ImGui::Text("light position");
ImGui::SliderAngle("##light position", &lightPositionAngle_, 0, 360.f);
}
if (!config_.wireframe) {
// light
ImGui::Separator();
ImGui::Text("ambient color");
ImGui::ColorEdit3("ambient color", (float *) &config_.ambientColor, ImGuiColorEditFlags_NoLabel);

ImGui::Separator();
ImGui::Checkbox("point light", &config_.showLight);
if (config_.showLight) {
ImGui::Text("light color");
ImGui::ColorEdit3("light color", (float *) &config_.pointLightColor, ImGuiColorEditFlags_NoLabel);

ImGui::Text("light position");
ImGui::SliderAngle("##light position", &lightPositionAngle_, 0, 360.f);
}

// mipmaps
ImGui::Separator();
if (ImGui::Checkbox("mipmaps", &config_.mipmaps)) {
if (resetMipmapsFunc_) {
resetMipmapsFunc_();
// mipmaps
ImGui::Separator();
if (ImGui::Checkbox("mipmaps", &config_.mipmaps)) {
if (resetMipmapsFunc_) {
resetMipmapsFunc_();
}
}
}

Expand Down

0 comments on commit 6af1620

Please sign in to comment.