MCPcopy Create free account
hub / github.com/Sven-vh/ImReflect / pointer_test

Function pointer_test

examples/include/imgui_app.cpp:375–403  ·  view source on GitHub ↗

======================================== Pointer Test ========================================

Source from the content-addressed store, hash-verified

373// Pointer Test
374// ========================================
375static void pointer_test() {
376 const std::string name = "Pointer";
377
378 ImGui::SeparatorText((name + "*").c_str());
379 ImGui::PushID((name + "*").c_str());
380 ImGui::Indent();
381
382 static int my_value = 42;
383 static int* invalid_ptr = nullptr;
384 static int* my_ptr = invalid_ptr;
385
386 ImGui::Text("Pointer - nullptr");
387 HelpMarker("Pointer is nullptr, nothing to edit");
388 {
389 ImReflect::Input("my_ptr", invalid_ptr);
390 }
391
392 ImGui::NewLine();
393
394 ImGui::Text("Pointer - valid");
395 HelpMarker("Pointer is valid, you can edit the value it points to");
396 {
397 my_ptr = &my_value;
398 ImReflect::Input("my_ptr", my_ptr);
399 }
400
401 ImGui::Unindent();
402 ImGui::PopID();
403}
404
405// ========================================
406// Simple Test

Callers 1

renderMethod · 0.85

Calls 2

HelpMarkerFunction · 0.85
InputFunction · 0.85

Tested by

no test coverage detected