MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / requestFrame

Method requestFrame

source/MRViewer/MRFrameRedrawRequest.cpp:17–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17void FrameRedrawRequest::requestFrame( size_t millisecondsInterval )
18{
19 // do not do it too frequently not to overload the renderer
20 auto minInterval = std::chrono::milliseconds( millisecondsInterval );
21 // make request
22#ifdef __EMSCRIPTEN__
23 bool testFrameOrder = false;
24 if ( frameRequested_.compare_exchange_strong( testFrameOrder, true ) )
25 {
26#pragma clang diagnostic push
27#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
28 MAIN_THREAD_EM_ASM( postEmptyEvent( $0, 2 ), int( minInterval.count() ) );
29#pragma clang diagnostic pop
30 }
31#else
32 asyncRequest_.requestIfNotSet( std::chrono::system_clock::now() + minInterval, [] ()
33 {
34 getViewerInstance().postEmptyEvent();
35 } );
36#endif
37}
38
39}

Callers 2

setProgressFunction · 0.80
finishFunction · 0.80

Calls 4

postEmptyEventFunction · 0.85
countMethod · 0.80
requestIfNotSetMethod · 0.80
postEmptyEventMethod · 0.80

Tested by

no test coverage detected