| 28 | {} |
| 29 | |
| 30 | void DisplaySettingsDialog::processIntern() |
| 31 | { |
| 32 | auto isFullscreen = !WindowController::get().isWindowedMode(); |
| 33 | |
| 34 | if (AlienImGui::ToggleButton(AlienImGui::ToggleButtonParameters().name("Full screen"), isFullscreen)) { |
| 35 | if (isFullscreen) { |
| 36 | setFullscreen(_selectionIndex); |
| 37 | } else { |
| 38 | _origSelectionIndex = _selectionIndex; |
| 39 | WindowController::get().setWindowedMode(); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | ImGui::BeginDisabled(!isFullscreen); |
| 44 | |
| 45 | if (AlienImGui::Combo( |
| 46 | AlienImGui::ComboParameters().name("Resolution").textWidth(RightColumnWidth).defaultValue(_origSelectionIndex).values(_videoModeStrings), |
| 47 | _selectionIndex)) { |
| 48 | |
| 49 | setFullscreen(_selectionIndex); |
| 50 | } |
| 51 | ImGui::EndDisabled(); |
| 52 | |
| 53 | auto fps = WindowController::get().getFps(); |
| 54 | if (AlienImGui::SliderInt( |
| 55 | AlienImGui::SliderIntParameters() |
| 56 | .name("Frames per second") |
| 57 | .textWidth(RightColumnWidth) |
| 58 | .defaultValue(&_origFps) |
| 59 | .min(20) |
| 60 | .max(100) |
| 61 | .tooltip("A high frame rate leads to a greater GPU workload for rendering and thus lowers the simulation speed (time steps per second)."), |
| 62 | &fps)) { |
| 63 | WindowController::get().setFps(fps); |
| 64 | } |
| 65 | |
| 66 | ImGui::Dummy({0, ImGui::GetContentRegionAvail().y - scale(50.0f)}); |
| 67 | AlienImGui::Separator(); |
| 68 | |
| 69 | if (AlienImGui::Button("OK")) { |
| 70 | close(); |
| 71 | } |
| 72 | ImGui::SetItemDefaultFocus(); |
| 73 | |
| 74 | ImGui::SameLine(); |
| 75 | if (AlienImGui::Button("Cancel")) { |
| 76 | close(); |
| 77 | WindowController::get().setMode(_origMode); |
| 78 | WindowController::get().setFps(_origFps); |
| 79 | _selectionIndex = _origSelectionIndex; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | void DisplaySettingsDialog::openIntern() |
| 84 | { |
nothing calls this directly
no test coverage detected