MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / inputFrameRequestsRender

Method inputFrameRequestsRender

src/visualizer/visualizer_impl.cpp:1181–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179 }
1180
1181 bool VisualizerImpl::inputFrameRequestsRender() const {
1182 if (!window_manager_)
1183 return false;
1184
1185 const auto& input = window_manager_->frameInput();
1186 if (!input.had_event)
1187 return false;
1188 if (input.window_event)
1189 return true;
1190
1191 const bool mouse_button_event = input.mouse_clicked[0] || input.mouse_clicked[1] ||
1192 input.mouse_clicked[2] || input.mouse_released[0] ||
1193 input.mouse_released[1] || input.mouse_released[2];
1194 const bool keyboard_event = !input.keys_pressed.empty() ||
1195 !input.keys_repeated.empty() ||
1196 !input.keys_released.empty() ||
1197 !input.text_codepoints.empty() ||
1198 !input.text_inputs.empty() ||
1199 input.has_text_editing;
1200 if (mouse_button_event || keyboard_event || input.mouse_wheel != 0.0f)
1201 return true;
1202
1203 if (!input.mouse_moved)
1204 return false;
1205
1206 if (input.mouse_down[0] || input.mouse_down[1] || input.mouse_down[2])
1207 return true;
1208
1209 if (selection_tool_ && selection_tool_->isEnabled() && gui_manager_ &&
1210 gui_manager_->isPositionInViewport(input.mouse_x, input.mouse_y)) {
1211 return true;
1212 }
1213
1214 if (gui_manager_ && gui_manager_->passiveMouseMoveNeedsRender(input.mouse_x, input.mouse_y)) {
1215 return true;
1216 }
1217
1218 const auto targets = window_manager_->inputRouter().pointerTargets(input.mouse_x, input.mouse_y);
1219 const bool targets_gui = targets.hover_target == input::InputTarget::Gui ||
1220 targets.pointer_target == input::InputTarget::Gui;
1221 if (!targets_gui)
1222 return false;
1223
1224 return !gui_manager_;
1225 }
1226
1227 VisualizerImpl::FrameDemand VisualizerImpl::collectFrameDemand(const bool viewport_export_locked,
1228 const bool drained_store_dirty) {

Callers

nothing calls this directly

Calls 5

isEnabledMethod · 0.80
isPositionInViewportMethod · 0.80
pointerTargetsMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected