MCPcopy Create free account
hub / github.com/MyGUI/mygui / notifyFrameStarted

Method notifyFrameStarted

UnitTests/UnitTest_AttachDetach/DemoKeeper.cpp:283–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281 }
282
283 void DemoKeeper::notifyFrameStarted(float _time)
284 {
285 if (all_widgets.size() > 500)
286 {
287 step_destroy_widget(200);
288 }
289 else
290 {
291 int step = random(8);
292 if (step == 0)
293 {
294 step_detach_layer(10);
295 }
296 else if (step == 1)
297 {
298 step_attach_layer(30);
299 }
300 else if (step == 2)
301 {
302 step_attach_widget(10);
303 }
304 else if (step == 3)
305 {
306 step_detach_widget(10);
307 }
308 else if (step == 4)
309 {
310 step_destroy_widget(2);
311 }
312 else if (step == 5)
313 {
314 step_create_widget(30);
315 }
316 else if (step == 6)
317 {
318 step_change_skin(30);
319 }
320 else if (step == 7)
321 {
322 step_change_type(30);
323 }
324 }
325
326 getStatisticInfo()->change("COUNT", all_widgets.size());
327
328 // random clicking was causing a crash at some point
329 MyGUI::InputManager::getInstance().injectMousePress(100, 100, MyGUI::MouseButton::Left);
330 MyGUI::InputManager::getInstance().injectMouseRelease(100, 100, MyGUI::MouseButton::Left);
331
332#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
333 ::Sleep(10);
334#endif
335 }
336
337} // namespace demo
338

Callers

nothing calls this directly

Calls 13

step_destroy_widgetFunction · 0.85
randomFunction · 0.85
step_detach_layerFunction · 0.85
step_attach_layerFunction · 0.85
step_attach_widgetFunction · 0.85
step_detach_widgetFunction · 0.85
step_create_widgetFunction · 0.85
step_change_skinFunction · 0.85
step_change_typeFunction · 0.85
changeMethod · 0.80
sizeMethod · 0.45
injectMousePressMethod · 0.45

Tested by

no test coverage detected