| 1020 | |
| 1021 | template<typename T> |
| 1022 | bool GuiImpl::addVecVar( |
| 1023 | const char label[], |
| 1024 | T& var, |
| 1025 | typename T::value_type minVal, |
| 1026 | typename T::value_type maxVal, |
| 1027 | float step, |
| 1028 | bool sameLine, |
| 1029 | const char* displayFormat |
| 1030 | ) |
| 1031 | { |
| 1032 | if constexpr (std::is_same<typename T::value_type, int32_t>::value) |
| 1033 | { |
| 1034 | return addVecVarHelper(label, var, ImGuiDataType_S32, minVal, maxVal, step, sameLine, displayFormat); |
| 1035 | } |
| 1036 | else if constexpr (std::is_same<typename T::value_type, uint32_t>::value) |
| 1037 | { |
| 1038 | return addVecVarHelper(label, var, ImGuiDataType_U32, minVal, maxVal, step, sameLine, displayFormat); |
| 1039 | } |
| 1040 | else if constexpr (std::is_same<typename T::value_type, int64_t>::value) |
| 1041 | { |
| 1042 | return addVecVarHelper(label, var, ImGuiDataType_S64, minVal, maxVal, step, sameLine, displayFormat); |
| 1043 | } |
| 1044 | else if constexpr (std::is_same<typename T::value_type, uint64_t>::value) |
| 1045 | { |
| 1046 | return addVecVarHelper(label, var, ImGuiDataType_U64, minVal, maxVal, step, sameLine, displayFormat); |
| 1047 | } |
| 1048 | else if constexpr (std::is_same<typename T::value_type, float>::value) |
| 1049 | { |
| 1050 | return addVecVarHelper(label, var, ImGuiDataType_Float, minVal, maxVal, step, sameLine, displayFormat); |
| 1051 | } |
| 1052 | else if constexpr (std::is_same<typename T::value_type, uint64_t>::value) |
| 1053 | { |
| 1054 | return addVecVarHelper(label, var, ImGuiDataType_U64, minVal, maxVal, step, sameLine, displayFormat); |
| 1055 | } |
| 1056 | else |
| 1057 | { |
| 1058 | static_assert(!sizeof(T), "Unsupported data type"); |
| 1059 | } |
| 1060 | } |
| 1061 | |
| 1062 | template<typename T> |
| 1063 | bool addVecSliderHelper( |