Profiling macros
Adds a profiling scope. Excluded by default in release builds.
a - A name for the scope
Profile a scope
{
DM_PROFILE("DoWork");
DoWork1();
DoWork2();
}
Adds a profiling scope. Excluded by default in release builds. Accepts a name cache value for performance.
a - The scope name
a - The scope name hash value pointer. May be 0.
Create a dynamic profiling scope
{
DM_PROFILE_DYN(work->m_Name, &work->m_NameHash);
work->DoWork();
}
Send text to the profiler
a - The format string
a - The variable argument list
Send a string to the profiler
DM_PROFILE_TEXT("Some value: %d", value);
Declare an extern property
name - The symbol name
Use a property declared elsewhere in the same library
DM_PROPERTY_EXTERN(rmtp_GameObject);
DM_PROPERTY_U32(rmtp_ComponentsAnim, 0, FrameReset, "#", &rmtp_GameObject);
Declare a property group
name - The group name
desc - The description
DM_PROPERTY_GROUP(rmtp_GameObject, "My Group");
Declare a property of type bool
name - The property symbol/name
default - The default value
flags - The flags. Either NoFlags
or FrameReset
. FrameReset
makes the value reset each frame.
desc - The description
group - [optional] The parent group
DM_PROPERTY_BOOL(rmtp_MyBool, 0, FrameReset, "true or false", &rmtp_MyGroup);
Declare a property of type int32_t
name - The property symbol/name
default - The default value
flags - The flags. Either NoFlags
or FrameReset
. FrameReset
makes the value reset each frame.
desc - The description
group - [optional] The parent group
DM_PROPERTY_S32(rmtp_MyValue, 0, FrameReset, "a value", &rmtp_MyGroup);
Declare a property of type uint32_t
name - The property symbol/name
default - The default value
flags - The flags. Either NoFlags
or FrameReset
. FrameReset
makes the value reset each frame.
desc - The description
group - [optional] The parent group
DM_PROPERTY_U32(rmtp_MyValue, 0, FrameReset, "a value", &rmtp_MyGroup);
Declare a property of type float
name - The property symbol/name
default - The default value
flags - The flags. Either NoFlags
or FrameReset
. FrameReset
makes the value reset each frame.
desc - The description
group - [optional] The parent group
DM_PROPERTY_F32(rmtp_MyValue, 0, FrameReset, "a value", &rmtp_MyGroup);
Declare a property of type int64_t
name - The property symbol/name
default - The default value
flags - The flags. Either NoFlags
or FrameReset
. FrameReset
makes the value reset each frame.
desc - The description
group - [optional] The parent group
DM_PROPERTY_S64(rmtp_MyValue, 0, FrameReset, "a value", &rmtp_MyGroup);
Declare a property of type uint64_t
name - The property symbol/name
default - The default value
flags - The flags. Either NoFlags
or FrameReset
. FrameReset
makes the value reset each frame.
desc - The description
group - [optional] The parent group
DM_PROPERTY_U64(rmtp_MyValue, 0, FrameReset, "a value", &rmtp_MyGroup);
Declare a property of type double
name - The property symbol/name
default - The default value
flags - The flags. Either NoFlags
or FrameReset
. FrameReset
makes the value reset each frame.
desc - The description
group - [optional] The parent group
DM_PROPERTY_F64(rmtp_MyValue, 0, FrameReset, "a value", &rmtp_MyGroup);
Set the value of a bool property
name - The property
value - The value
DM_PROPERTY_SET_BOOL(rmtp_MyBool, false);
Set the value of a int32_t property
name - The property
value - The value
DM_PROPERTY_SET_S32(rmtp_MyValue, -1);
Set the value of a uint32_t property
name - The property
value - The value
DM_PROPERTY_SET_U32(rmtp_MyValue, 1);
Set the value of a float property
name - The property
value - The value
DM_PROPERTY_SET_F32(rmtp_MyValue, 1.5);
Set the value of a int64_t property
name - The property
value - The value
DM_PROPERTY_SET_S64(rmtp_MyValue, -1);
Set the value of a uint64_t property
name - The property
value - The value
DM_PROPERTY_SET_U64(rmtp_MyValue, 1);
Set the value of a double property
name - The property
value - The value
DM_PROPERTY_SET_F64(rmtp_MyValue, 1.5);
Add a value to int32_t property
name - The property
value - The value
DM_PROPERTY_ADD_S32(rmtp_MyValue, -1);
Add a value to uint32_t property
name - The property
value - The value
DM_PROPERTY_ADD_U32(rmtp_MyValue, 1);
Add a value to float property
name - The property
value - The value
DM_PROPERTY_ADD_F32(rmtp_MyValue, 1.5);
Add a value to int64_t property
name - The property
value - The value
DM_PROPERTY_ADD_S64(rmtp_MyValue, -1);
Add a value to uint64_t property
name - The property
value - The value
DM_PROPERTY_ADD_U64(rmtp_MyValue, 1);
Add a value to double property
name - The property
value - The value
DM_PROPERTY_ADD_F64(rmtp_MyValue, 1.5);
Reset a property to its default value
name - The property
DM_PROPERTY_RESET(rmtp_MyValue);
Profile snapshot handle
Begin profiling, eg start of frame
context - The current profiling context. Must be released by #EndFrame
Release profile returned by #Begin
profile - Profile to release