| 142 | } |
| 143 | |
| 144 | void Interface::syncWindowMetrics() { |
| 145 | int width = 0; |
| 146 | int height = 0; |
| 147 | glfwGetFramebufferSize(window_, &width, &height); |
| 148 | |
| 149 | if (width <= 0 || height <= 0) { |
| 150 | return; |
| 151 | } |
| 152 | |
| 153 | if (width == lastWindowWidth_ && height == lastWindowHeight_) { |
| 154 | return; |
| 155 | } |
| 156 | |
| 157 | lastWindowWidth_ = width; |
| 158 | lastWindowHeight_ = height; |
| 159 | const float previousScale = styleManager.getScale(); |
| 160 | styleManager.onResize(glm::ivec2(width, height)); |
| 161 | if (std::abs(previousScale - styleManager.getScale()) > 0.001f) { |
| 162 | pendingUiScaleRefresh_ = true; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | void Interface::shutdown() { |
| 167 | ImGui_ImplWGPU_Shutdown(); |