Conversation
(missing init, refresh registering object and camera missing)
Render without showing anything on screen, while still calling all the graphics functions: the window and its OpenGL context are created as usual, they are simply never mapped on screen (GLFW_VISIBLE hint). Available as '--offscreen' in runSofaGLFW, and in runSofa with the glfw and imgui GUIs. SofaGLFWGUI::RegisterGUIParameters() declares it for both of them: GUIManager declares the parameters of every registered GUI, so the function guards against a second registration. Fullscreen is ignored in offscreen mode, and switchFullScreen() (F11) is refused, since it would map the window.
'-n'/'--nbIter' only stopped the batch GUI; with glfw or imgui the simulation ran until the window was closed, which made it impossible to run a bounded simulation while still rendering, e.g. together with '--offscreen'. The argument is registered by the batch GUI, and cxxopts refuses a duplicate, so it is not declared a second time: SofaGLFWGUI keeps the ArgumentParser given to RegisterGUIParameters and reads the already parsed value in mainLoop(). Only arguments actually present on the command line end up in the parse result, hence the simulation keeps running indefinitely when '-n' is not given. 'infinite' is supported as in the batch GUI.
The imgui GUI is the glfw one plus interactive widgets, so rendering it without ever showing the window serves no purpose.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on
Add a new feature to render without opening any window.
Only usable with glfw GUI (as the imgui is by definition interactive in my opinion)
add 2 flags:
Note that you still need opengl/context/ whatever stuff like that of course