Monado OpenXR Runtime
Files | Data Structures | Functions
GUI Config Interface

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

Collaboration diagram for GUI Config Interface:

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 functions to drive the gui.
 
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_main_menu.c
 Main menu.
 
file  gui_scene_video.c
 A very small scene that lets the user select a video device.
 
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  sdl2_program
 Common struct holding state for the GUI interface. More...
 
struct  gui_imgui
 Internal gui state. 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_debug (struct gui_program *p)
 Regular debug 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...
 
int gui_sdl2_init (struct sdl2_program *p)
 Init SDL2, create and show a window and bring up any other structs needed. More...
 
void gui_sdl2_imgui_loop (struct sdl2_program *p)
 Loop until user request quit and show Imgui interface. More...
 
void gui_sdl2_loop (struct sdl2_program *p)
 Loop until quit signal has been received. More...
 
void gui_sdl2_quit (struct sdl2_program *p)
 Destroy all SDL things and quit SDL. More...
 

Detailed Description

Small GUI interface to configure Monado based on SDL2.

Function Documentation

◆ 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_sink::push_frame, gui_ogl_sink::sink, and U_TYPED_CALLOC.

◆ gui_ogl_sink_update()

void gui_ogl_sink_update ( struct gui_ogl_texture )

◆ 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.

References time_state::time_state_create(), gui_program::timekeeping, gui_program::xp, and xrt_prober_create().

Referenced by main().

◆ gui_prober_select()

int gui_prober_select ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Create devices.

Referenced by main().

◆ 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.

References xrt_device::destroy, NUM_XDEVS, time_state::time_state_destroy(), gui_program::timekeeping, and gui_program::xdevs.

Referenced by main().

◆ gui_prober_update()

void gui_prober_update ( struct gui_program p)

◆ 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 calibration_scene::base, gui_scene::render, and 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 debug_scene::base, gui_scene::render, and U_TYPED_CALLOC.

Referenced by main(), and oxr_sdl2_hack_stop().

◆ 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.

References gui_program::gsm, and gui_scene_manager::scenes.

◆ 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 main_menu::base, gui_scene::render, and U_TYPED_CALLOC.

Referenced by main().

◆ gui_scene_manager_destroy()

void gui_scene_manager_destroy ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Destroy the scene manager.

References gui_program::gsm, and gui_scene_manager::scenes.

Referenced by main(), and oxr_sdl2_hack_stop().

◆ gui_scene_manager_init()

void gui_scene_manager_init ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Initialize the scene manager.

References gui_program::gsm.

Referenced by main(), and oxr_sdl2_hack_stop().

◆ gui_scene_manager_render()

void gui_scene_manager_render ( struct gui_program p)

#include <state_trackers/gui/gui_common.h>

Render the scenes.

References gui_program::gsm.

Referenced by gui_sdl2_imgui_loop(), and oxr_sdl2_hack_stop().

◆ 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.

References gui_program::gsm, and gui_scene_manager::scenes.

◆ 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.

Referenced by main().

◆ gui_sdl2_imgui_loop()

void gui_sdl2_imgui_loop ( struct sdl2_program p)

◆ gui_sdl2_init()

int gui_sdl2_init ( struct sdl2_program p)

#include <targets/gui/gui_sdl2.h>

Init SDL2, create and show a window and bring up any other structs needed.

References sdl2_program::ctx, sdl2_program::sdl_initialized, and sdl2_program::win.

Referenced by main().

◆ gui_sdl2_loop()

void gui_sdl2_loop ( struct sdl2_program p)

#include <targets/gui/gui_sdl2.h>

Loop until quit signal has been received.

References sdl2_program::base, and gui_program::stopped.

◆ gui_sdl2_quit()

void gui_sdl2_quit ( struct sdl2_program p)

#include <targets/gui/gui_sdl2.h>

Destroy all SDL things and quit SDL.

References sdl2_program::ctx, sdl2_program::sdl_initialized, and sdl2_program::win.

Referenced by main().