MCPcopy Create free account
hub / github.com/crosire/reshade / get_annotation_string_from_technique

Method get_annotation_string_from_technique

source/runtime_api.cpp:922–955  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

920 return false;
921}
922bool reshade::runtime::get_annotation_string_from_technique(api::effect_technique handle, const char *name_in, char *value, size_t *size) const
923{
924 if (handle != 0 && name_in != nullptr)
925 {
926 const auto &tech = *reinterpret_cast<const technique *>(handle.handle);
927 const std::string_view name(name_in);
928
929 if (const auto it = std::find_if(tech.annotations.cbegin(), tech.annotations.cend(),
930 [&](const reshadefx::annotation &annotation) { return annotation.name == name; });
931 it != tech.annotations.cend())
932 {
933 const std::string_view annotation = tech.annotation_as_string(name);
934
935 if (size != nullptr)
936 {
937 if (value == nullptr)
938 {
939 *size = annotation.size() + 1;
940 }
941 else if (*size != 0)
942 {
943 *size = annotation.copy(value, *size - 1);
944 value[*size] = '\0';
945 }
946 }
947
948 return true;
949 }
950 }
951
952 if (size != nullptr)
953 *size = 0;
954 return false;
955}
956
957bool reshade::runtime::get_technique_state(api::effect_technique handle) const
958{

Callers 1

Calls 1

annotation_as_stringMethod · 0.45

Tested by

no test coverage detected