Add a way to set the vsync_interval CVar from code (#5813)
* Add a way to set the render vsync from code Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * Update change with PR feedback. Missing whitespace plus a comment on why the assignment is outside the value changed check Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>
This commit is contained in:
@@ -32,7 +32,16 @@ namespace AZ
|
||||
template <typename BASE_TYPE, ThreadSafety THREAD_SAFETY>
|
||||
inline void ConsoleDataWrapper<BASE_TYPE, THREAD_SAFETY>::operator =(const BASE_TYPE& rhs)
|
||||
{
|
||||
const BASE_TYPE currentValue = this->m_value;
|
||||
// Do the value assignment outside new value check.
|
||||
// Client code can supply a type for m_value that overrides the operator= function and trigger side effects
|
||||
// in the operator= function body. Doing the assignment outside the value change check avoids those side
|
||||
// effects not being triggered because AzCore believes the value wouldn't change.
|
||||
this->m_value = rhs;
|
||||
if (currentValue != rhs)
|
||||
{
|
||||
InvokeCallback();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename BASE_TYPE, ThreadSafety THREAD_SAFETY>
|
||||
|
||||
Reference in New Issue
Block a user