Replies: 1 comment
-
Command::record() is const as the intent is that users will just dispatch data to Vulkan and not modify the local data, so can the commands can be safely recorded from multi-threads without having to protect the data with mutexes. If you have a special case Command that needs to modify it's local data the either cast away constness locally or declare the member variables as mutable. You will need take care over threading of this Command so you don't end end with race conditions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been working on integrating ImGuizmo with vsg, and in particular, porting https://github.com/CedricGuillemet/ImGuizmo/blob/master/example/main.cpp . One thing that I stumbled on, was the integration of the
TransformStart()
andTransformEdit()
functions in the abovemain.cpp
into avsg::Command
class record function. After some struggling, I managed to port the code so that they are called fromvsg::Command::record
. This worked when keeping the functions external to the class as in the original example. I then wanted to encapsulate the class, and bring everything into member functions that are called from thevsg::Command::record()
method. However, I then I got stuck on the issue ofrecord()
being definedconst
.The
TransformStart()
andTransformEdit()
change the gizmo state, and saves the result in global variables. However, when moving these global variables into class variables, I can no longer change them in a function called fromrecord()
because of theconst
declaration.So I'm wondering what's the best way of solving this? Here are some options that I can think of:
record()
and call it from the inner loop prior to callingviewer->recordAndSubmit()
const
declaration fromvsg::Command::record()
to allow for more flexibility?I'd be happy to receive some feedback, about what you think is the best approach.
Beta Was this translation helpful? Give feedback.
All reactions