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

Function glfw_framebuffer_size

source/MRViewer/MRViewer.cpp:198–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196static bool gWindowSizeInitialized = false;
197
198static void glfw_framebuffer_size( GLFWwindow* /*window*/, int width, int height )
199{
200 auto viewer = &MR::getViewerInstance();
201#if defined( __linux__ ) && !defined( __EMSCRIPTEN__ )
202 if ( gWindowSizeInitialized )
203 {
204 // on Linux some (or all?) window managers send resize events in batch, processing all of them hits performance
205 viewer->emplaceEvent( "Window resize", [width, height, viewer]
206 {
207 viewer->postResize( width, height );
208 }, true );
209 }
210 else
211#endif
212 {
213 viewer->postResize( width, height );
214 viewer->postEmptyEvent();
215 }
216}
217
218static void glfw_window_pos( GLFWwindow* /*window*/, int xPos, int yPos )
219{

Callers 1

setupWindow_Method · 0.85

Calls 3

emplaceEventMethod · 0.80
postResizeMethod · 0.80
postEmptyEventMethod · 0.80

Tested by

no test coverage detected