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

Method ViewerSettingsPlugin

source/MRViewer/MRViewerSettingsPlugin.cpp:71–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69{
70
71ViewerSettingsPlugin::ViewerSettingsPlugin() :
72 StatePlugin( "Viewer settings" )
73{
74 shadowGl_ = std::make_unique<ShadowsGL>();
75 CommandLoop::appendCommand( [&] ()
76 {
77 auto& viewer = getViewerInstance();
78
79 if ( viewer.isGLInitialized() && loadGL() )
80 {
81 GL_EXEC( glGetIntegerv( GL_MAX_SAMPLES, &maxSamples_ ) );
82 storedSamples_ = viewer.getMSAA();
83 maxSamples_ = std::max( std::min( maxSamples_, 16 ), storedSamples_ ); // there are some known issues with 32 MSAA
84 gpuOverridesMSAA_ = storedSamples_ != viewer.getRequestedMSAA(); // if it fails on application start - gpu overrides settings
85#ifdef __EMSCRIPTEN__
86 if ( !viewer.isSceneTextureEnabled() )
87 maxSamples_ = std::min( maxSamples_, 4 ); // web does not allow more than x4 msaa for main framebuffer
88#endif
89 }
90 }, CommandLoop::StartPosition::AfterWindowAppear );
91}
92
93void ViewerSettingsPlugin::drawDialog( ImGuiContext* )
94{

Callers

nothing calls this directly

Calls 6

loadGLFunction · 0.85
maxFunction · 0.85
minFunction · 0.85
getMSAAMethod · 0.80
getRequestedMSAAMethod · 0.80
isSceneTextureEnabledMethod · 0.80

Tested by

no test coverage detected