Monado OpenXR Runtime
GUI Config Interface

Small GUI interface to configure Monado based on SDL2. More...

Collaboration diagram for GUI Config Interface:

Modules

 Debug GUI
 GUI for live inspecting Monado.
 

Files

file  gui_common.h
 Common file for the Monado GUI program.
 
file  gui_imgui.h
 Imgui integration for gui.
 
file  gui_ogl.c
 OpenGL helper functions for drawing GUI elements.
 
file  gui_ogl.h
 OpenGL helper functions for drawing GUI elements.
 
file  gui_ogl_sink.c
 OpenGL sink functions.
 
file  gui_scene.cpp
 SDL2 functions to drive the GUI.
 
file  gui_scene_calibrate.c
 Calibration gui scene.
 
file  gui_scene_debug.c
 A debugging scene.
 
file  gui_scene_hand_tracking_demo.c
 Small hand-tracking demo scene.
 
file  gui_scene_main_menu.c
 Main menu.
 
file  gui_scene_record.c
 Recording scene gui.
 
file  gui_scene_record_euroc.c
 Small hand-tracking demo scene.
 
file  gui_scene_remote.c
 Remote debugging UI.
 
file  gui_scene_tracking_overrides.c
 A very small scene that lets the user configure tracking overrides.
 
file  gui_scene_video.c
 A very small scene that lets the user select a video device.
 
file  gui_widget_native_images.c
 Swapchain rendering helper code.
 
file  gui_widget_native_images.h
 Swapchain rendering helper code.
 
file  gui_window_record.c
 Recording window gui.
 
file  gui_window_record.h
 Recording window gui.
 
file  gui_sdl2.c
 SDL2 functions to drive the GUI.
 
file  gui_sdl2.h
 Common file for the Monado SDL2 based GUI program.
 
file  gui_sdl2_imgui.c
 Main entrypoint for the Monado GUI program.
 
file  gui_sdl2_main.c
 Main entrypoint for the Monado GUI program.
 

Data Structures

struct  gui_program
 A gui program. More...
 
struct  gui_ogl_texture
 A OpenGL texture. More...
 
struct  gui_widget_native_images
 A small widget that interfaces a u_native_images_debug struct, caching the imports from the listed xrt_image_native list. More...
 
struct  gui_widget_native_images_record
 A single record in a native image widget storage. More...
 
struct  gui_widget_native_images_storage
 Helper struct to cache gui_widget_native_images. More...
 
struct  sdl2_program
 Common struct holding state for the GUI interface. More...
 
struct  gui_imgui
 Internal gui state. More...
 
interface  gui_scene
 A single currently running scene. More...
 

Functions

int gui_prober_init (struct gui_program *p)
 Initialize the prober and open all devices found. More...
 
int gui_prober_select (struct gui_program *p)
 Create devices. More...
 
void gui_prober_update (struct gui_program *p)
 Update all devices. More...
 
void gui_prober_teardown (struct gui_program *p)
 Destroy all opened devices and destroy the prober. More...
 
struct gui_ogl_texturegui_ogl_sink_create (const char *name, struct xrt_frame_context *xfctx, struct xrt_frame_sink **out_sink)
 Create a sink that will turn frames into OpenGL textures, since the frame can come from another thread gui_ogl_sink_update needs to be called. More...
 
void gui_ogl_sink_update (struct gui_ogl_texture *)
 Update the texture to the latest received frame. More...
 
void gui_scene_push_front (struct gui_program *p, struct gui_scene *me)
 Push the scene to the top of the lists. More...
 
void gui_scene_delete_me (struct gui_program *p, struct gui_scene *me)
 Put a scene on the delete list, also removes it from any other list. More...
 
void gui_scene_manager_render (struct gui_program *p)
 Render the scenes. More...
 
void gui_scene_manager_init (struct gui_program *p)
 Initialize the scene manager. More...
 
void gui_scene_manager_destroy (struct gui_program *p)
 Destroy the scene manager. More...
 
void gui_scene_main_menu (struct gui_program *p)
 Shows the main menu. More...
 
void gui_scene_select_video_calibrate (struct gui_program *p)
 Shows a UI that lets you select a video device and mode for calibration. More...
 
void gui_scene_tracking_overrides (struct gui_program *p)
 Shows a UI that lets you set up tracking overrides. More...
 
void gui_scene_debug (struct gui_program *p)
 Regular debug UI. More...
 
void gui_scene_hand_tracking_demo (struct gui_program *p)
 Small hand-tracking demo. More...
 
void gui_scene_record_euroc (struct gui_program *p)
 EuRoC recorder for DepthAI cameras. More...
 
void gui_scene_record (struct gui_program *p, const char *camera)
 Create a recording view scene. More...
 
void gui_scene_remote (struct gui_program *p, const char *address)
 Remote control debugging UI. More...
 
void gui_scene_calibrate (struct gui_program *p, struct xrt_frame_context *xfctx, struct xrt_fs *xfs, struct xrt_settings_tracking *s)
 Given the frameserver runs the calibration code on it. More...
 
void gui_ogl_draw_image (uint32_t width, uint32_t height, uint32_t tex_id, float scale, bool rotate_180, bool flip_y)
 Draw the given textures as igImage, scale of 1.0f == 100%. More...
 
void gui_ogl_draw_background (uint32_t width, uint32_t height, uint32_t tex_id, bool rotate_180, bool flip_y)
 Draw the given texture to the background of the current OS window. More...
 
void gui_widget_native_images_init (struct gui_widget_native_images *gwni)
 Initialise a embeddable record window. More...
 
void gui_widget_native_images_update (struct gui_widget_native_images *gwni, struct u_native_images_debug *unid)
 Update the swapchain widget. More...
 
void gui_widget_native_images_render (struct gui_widget_native_images *gwni, struct gui_program *p)
 Renders all controls of a record window. More...
 
void gui_widget_native_images_to_background (struct gui_widget_native_images *gwni, struct gui_program *p)
 Draw the sink image as the background to the background of the render view. More...
 
void gui_widget_native_images_close (struct gui_widget_native_images *gwni)
 Frees all resources associated with a record window. More...
 
struct gui_widget_native_imagesgui_widget_native_images_storage_ensure (struct gui_widget_native_images_storage *gwnis, struct u_native_images_debug *unid)
 Search the storage for the matching record for the debug swapchain and return it, if not found and there is room create it. More...
 
struct gui_widget_native_imagesgui_widget_native_images_storage_close (struct gui_widget_native_images_storage *gwnis, struct u_native_images_debug *unid)
 Close the storage. More...
 

Detailed Description

Small GUI interface to configure Monado based on SDL2.

Function Documentation

◆ gui_ogl_draw_background()

void gui_ogl_draw_background ( uint32_t  width,
uint32_t  height,
uint32_t  tex_id,
bool  rotate_180,
bool  flip_y 
)

#include <state_trackers/gui/gui_ogl.h>

Draw the given texture to the background of the current OS window.

Referenced by gui_window_record_to_background().

◆ gui_ogl_draw_image()

void gui_ogl_draw_image ( uint32_t  width,
uint32_t  height,
uint32_t  tex_id,
float  scale,
bool  rotate_180,
bool  flip_y 
)

#include <state_trackers/gui/gui_ogl.h>

Draw the given textures as igImage, scale of 1.0f == 100%.

◆ gui_ogl_sink_create()

struct gui_ogl_texture* gui_ogl_sink_create ( const char *  name,
struct xrt_frame_context xfctx,
struct xrt_frame_sink **  out_sink 
)

#include <state_trackers/gui/gui_common.h>

Create a sink that will turn frames into OpenGL textures, since the frame can come from another thread gui_ogl_sink_update needs to be called.

Destruction is handled by the frame context.

References xrt_frame_node::break_apart, push_frame(), xrt_frame_sink::push_frame, and U_TYPED_CALLOC.

◆ gui_ogl_sink_update()

void gui_ogl_sink_update ( struct gui_ogl_texture tex)

#include <state_trackers/gui/gui_common.h>

Update the texture to the latest received frame.

References container_of, and U_LOG_E.

Referenced by gui_window_record_render(), and gui_window_record_to_background().

◆ gui_prober_init()

int gui_prober_init ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Initialize the prober and open all devices found.

◆ gui_prober_select()

int gui_prober_select ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Create devices.

Referenced by gui_scene_debug().

◆ gui_prober_teardown()

void gui_prober_teardown ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Destroy all opened devices and destroy the prober.

◆ gui_prober_update()

void gui_prober_update ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Update all devices.

◆ gui_scene_calibrate()

void gui_scene_calibrate ( struct gui_program p,
struct xrt_frame_context xfctx,
struct xrt_fs xfs,
struct xrt_settings_tracking s 
)

#include <state_trackers/gui/gui_common.h>

Given the frameserver runs the calibration code on it.

Claims ownership of s.

References U_TYPED_CALLOC.

◆ gui_scene_debug()

void gui_scene_debug ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Regular debug UI.

References gui_prober_select(), and U_TYPED_CALLOC.

◆ gui_scene_delete_me()

void gui_scene_delete_me ( struct gui_program p,
struct gui_scene me 
)

#include <state_trackers/gui/gui_common.h>

Put a scene on the delete list, also removes it from any other list.

◆ gui_scene_hand_tracking_demo()

void gui_scene_hand_tracking_demo ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Small hand-tracking demo.

◆ gui_scene_main_menu()

void gui_scene_main_menu ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Shows the main menu.

References U_TYPED_CALLOC.

◆ gui_scene_manager_destroy()

void gui_scene_manager_destroy ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Destroy the scene manager.

◆ gui_scene_manager_init()

void gui_scene_manager_init ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Initialize the scene manager.

◆ gui_scene_manager_render()

void gui_scene_manager_render ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Render the scenes.

◆ gui_scene_push_front()

void gui_scene_push_front ( struct gui_program p,
struct gui_scene me 
)

#include <state_trackers/gui/gui_common.h>

Push the scene to the top of the lists.

◆ gui_scene_record()

void gui_scene_record ( struct gui_program p,
const char *  camera 
)

#include <state_trackers/gui/gui_common.h>

Create a recording view scene.

References U_TYPED_CALLOC.

◆ gui_scene_record_euroc()

void gui_scene_record_euroc ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

EuRoC recorder for DepthAI cameras.

◆ gui_scene_remote()

void gui_scene_remote ( struct gui_program p,
const char *  address 
)

#include <state_trackers/gui/gui_common.h>

Remote control debugging UI.

Parameters
Optionaladdress.

References U_TYPED_CALLOC.

◆ gui_scene_select_video_calibrate()

void gui_scene_select_video_calibrate ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Shows a UI that lets you select a video device and mode for calibration.

◆ gui_scene_tracking_overrides()

void gui_scene_tracking_overrides ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Shows a UI that lets you set up tracking overrides.

◆ gui_widget_native_images_close()

void gui_widget_native_images_close ( struct gui_widget_native_images gwni)

#include <state_trackers/gui/gui_widget_native_images.h>

Frees all resources associated with a record window.

Make sure to only call this function on the main gui thread, and that nothing is pushing into the record windows sink.

◆ gui_widget_native_images_init()

void gui_widget_native_images_init ( struct gui_widget_native_images gwni)

#include <state_trackers/gui/gui_widget_native_images.h>

Initialise a embeddable record window.

References gui_widget_native_images::active_index, and U_ZERO.

Referenced by gui_widget_native_images_storage_ensure().

◆ gui_widget_native_images_render()

void gui_widget_native_images_render ( struct gui_widget_native_images gwni,
struct gui_program p 
)

#include <state_trackers/gui/gui_widget_native_images.h>

Renders all controls of a record window.

References gui_widget_native_images::active_index.

◆ gui_widget_native_images_storage_close()

struct gui_widget_native_images* gui_widget_native_images_storage_close ( struct gui_widget_native_images_storage gwnis,
struct u_native_images_debug unid 
)

#include <state_trackers/gui/gui_widget_native_images.h>

Close the storage.

◆ gui_widget_native_images_storage_ensure()

struct gui_widget_native_images* gui_widget_native_images_storage_ensure ( struct gui_widget_native_images_storage gwnis,
struct u_native_images_debug unid 
)

#include <state_trackers/gui/gui_widget_native_images.h>

Search the storage for the matching record for the debug swapchain and return it, if not found and there is room create it.

References ARRAY_SIZE, and gui_widget_native_images_init().

◆ gui_widget_native_images_to_background()

void gui_widget_native_images_to_background ( struct gui_widget_native_images gwni,
struct gui_program p 
)

#include <state_trackers/gui/gui_widget_native_images.h>

Draw the sink image as the background to the background of the render view.

Basically the main window in which all ImGui windows lives in, not to a ImGui window.

References gui_widget_native_images::active_index.

◆ gui_widget_native_images_update()

void gui_widget_native_images_update ( struct gui_widget_native_images gwni,
struct u_native_images_debug unid 
)