The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/gui: Render U_VAR_RO_I64_NS

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2491>

authored by

Jakob Bornecrantz and committed by
Marge Bot
bf8799ce 7dfe32c7

+32
+32
src/xrt/state_trackers/gui/gui_scene_debug.c
··· 1 1 // Copyright 2019-2024, Collabora, Ltd. 2 + // Copyright 2024-2025, NVIDIA CORPORATION. 2 3 // SPDX-License-Identifier: BSL-1.0 3 4 /*! 4 5 * @file ··· 38 39 #include "imgui_monado/cimgui_monado.h" 39 40 40 41 #include <float.h> 42 + #include <inttypes.h> 43 + 41 44 42 45 /* 43 46 * ··· 375 378 } 376 379 377 380 static void 381 + on_ro_i64_ns(const char *name, void *ptr) 382 + { 383 + const ImGuiInputTextFlags ro_i_flags = ImGuiInputTextFlags_ReadOnly; 384 + 385 + // Display in a more readable format. 386 + double time = time_ns_to_ms_f(*(int64_t *)ptr); 387 + 388 + igBeginGroup(); 389 + igPushID_Str(name); 390 + igPushMultiItemsWidths(2, igCalcItemWidth()); 391 + 392 + igPushID_Int(0); 393 + igInputScalar("", ImGuiDataType_Double, &time, NULL, NULL, "%+.3f ms", ro_i_flags); 394 + igPopItemWidth(); 395 + igPopID(); 396 + 397 + igSameLine(0, 4.0f); 398 + 399 + igPushID_Int(1); 400 + igInputScalar(name, ImGuiDataType_U64, ptr, NULL, NULL, "%" PRIu64 " ns", ro_i_flags); 401 + igPopItemWidth(); 402 + igPopID(); 403 + 404 + igPopID(); 405 + igEndGroup(); 406 + } 407 + 408 + static void 378 409 on_ff_vec3_var(struct u_var_info *info, struct gui_program *p) 379 410 { 380 411 char tmp[512]; ··· 666 697 case U_VAR_KIND_RO_I64: igInputScalar(name, ImGuiDataType_S64, ptr, NULL, NULL, NULL, ro_i_flags); break; 667 698 case U_VAR_KIND_RO_U64: igInputScalar(name, ImGuiDataType_S64, ptr, NULL, NULL, NULL, ro_i_flags); break; 668 699 case U_VAR_KIND_RO_F64: igInputScalar(name, ImGuiDataType_Double, ptr, NULL, NULL, "%+f", ro_i_flags); break; 700 + case U_VAR_KIND_RO_I64_NS: on_ro_i64_ns(name, ptr); break; 669 701 case U_VAR_KIND_RO_VEC3_I32: igInputInt3(name, (int *)ptr, ro_i_flags); break; 670 702 case U_VAR_KIND_RO_VEC3_F32: igInputFloat3(name, (float *)ptr, "%+f", ro_i_flags); break; 671 703 case U_VAR_KIND_RO_QUAT_F32: igInputFloat4(name, (float *)ptr, "%+f", ro_i_flags); break;