27 const std::function<std::optional<Picture>()>& picture_callback) {
32 RenderCapture(aiks_context.
GetContext()->capture);
38 if (ImGui::IsKeyPressed(ImGuiKey_Z)) {
39 wireframe_ = !wireframe_;
43 if (ImGui::IsKeyPressed(ImGuiKey_C)) {
44 capturing_ = !capturing_;
51 hovered_element_ =
nullptr;
52 selected_element_ =
nullptr;
54 std::optional<Picture> new_picture = picture_callback();
58 if (!new_picture.has_value() || new_picture->pass) {
59 last_picture_ = std::move(new_picture);
72 [](CaptureBooleanProperty& p) {
73 ImGui::Checkbox(p.label.c_str(), &p.value);
76 [](CaptureIntegerProperty& p) {
77 if (p.options.range.has_value()) {
78 ImGui::SliderInt(p.label.c_str(), &p.value,
79 static_cast<int>(p.options.range->min),
80 static_cast<int>(p.options.range->max));
83 ImGui::InputInt(p.label.c_str(), &p.value);
86 [](CaptureScalarProperty& p) {
87 if (p.options.range.has_value()) {
88 ImGui::SliderFloat(p.label.c_str(), &p.value, p.options.range->min,
89 p.options.range->max);
92 ImGui::DragFloat(p.label.c_str(), &p.value, 0.01);
95 [](CapturePointProperty& p) {
96 if (p.options.range.has_value()) {
97 ImGui::SliderFloat2(p.label.c_str(),
98 reinterpret_cast<float*
>(&p.value),
99 p.options.range->min, p.options.range->max);
102 ImGui::DragFloat2(p.label.c_str(),
reinterpret_cast<float*
>(&p.value),
106 [](CaptureVector3Property& p) {
107 if (p.options.range.has_value()) {
108 ImGui::SliderFloat3(p.label.c_str(),
109 reinterpret_cast<float*
>(&p.value),
110 p.options.range->min, p.options.range->max);
113 ImGui::DragFloat3(p.label.c_str(),
reinterpret_cast<float*
>(&p.value),
117 [](CaptureRectProperty& p) {
118 ImGui::DragFloat4(p.label.c_str(),
reinterpret_cast<float*
>(&p.value),
122 [](CaptureColorProperty& p) {
123 ImGui::ColorEdit4(p.label.c_str(),
124 reinterpret_cast<float*
>(&p.value));
127 [](CaptureMatrixProperty& p) {
128 float* pointer =
reinterpret_cast<float*
>(&p.value);
129 ImGui::DragFloat4((p.label +
" X basis").c_str(), pointer, 0.001);
130 ImGui::DragFloat4((p.label +
" Y basis").c_str(), pointer + 4, 0.001);
131 ImGui::DragFloat4((p.label +
" Z basis").c_str(), pointer + 8, 0.001);
132 ImGui::DragFloat4((p.label +
" Translation").c_str(), pointer + 12,
136 [](CaptureStringProperty& p) {
137 ImGui::InputTextEx(p.label.c_str(),
"",
139 const_cast<char*
>(p.value.c_str()), p.value.size(),
140 ImVec2(0, 0), ImGuiInputTextFlags_ReadOnly);
ContentContext & GetContentContext() const
std::shared_ptr< Context > GetContext() const
static CaptureContext MakeInactive()
static CaptureContext MakeAllowlist(std::initializer_list< std::string > allowlist)
void SetWireframe(bool wireframe)