Monado OpenXR Runtime
comp_window_peek.h File Reference

Displays the content of one or both eye onto a desktop window. More...

#include "xrt/xrt_config_have.h"
#include "os/os_threading.h"
Include dependency graph for comp_window_peek.h:

Go to the source code of this file.

Enumerations

enum  comp_window_peek_eye { COMP_WINDOW_PEEK_EYE_LEFT = 0 , COMP_WINDOW_PEEK_EYE_RIGHT = 1 , COMP_WINDOW_PEEK_EYE_BOTH = 2 }
 

Functions

struct comp_window_peekcomp_window_peek_create (struct comp_compositor *c)
 
void comp_window_peek_destroy (struct comp_window_peek **w_ptr)
 
void comp_window_peek_blit (struct comp_window_peek *w, VkImage src, int32_t width, int32_t height)
 
enum comp_window_peek_eye comp_window_peek_get_eye (struct comp_window_peek *w)
 Getter for the peek window's eye enum. More...
 
bool comp_window_peek_get_vk_instance_exts (struct u_string_list *out_required_list)
 Gets the required vulkan instance extensions for comp_window_peek support. More...
 

Detailed Description

Displays the content of one or both eye onto a desktop window.

Author
Simon Zeni simon.nosp@m.@bl4.nosp@m.ckb0n.nosp@m.e.ca

Function Documentation

◆ comp_window_peek_get_eye()

enum comp_window_peek_eye comp_window_peek_get_eye ( struct comp_window_peek w)

Getter for the peek window's eye enum.

This is a getter function so that struct comp_window_peek can be private.

Parameters
[in]wThe peek window struct this compositor has.
Returns
The eye that the peek window wants to display.

◆ comp_window_peek_get_vk_instance_exts()

bool comp_window_peek_get_vk_instance_exts ( struct u_string_list out_required_list)

Gets the required vulkan instance extensions for comp_window_peek support.

Parameters
[in,out]out_required_listlist of string containing the required instance extensions to enable, the list may already contain some/all of the required, duplicates will not be added.

NOTE: The SDL2 function SDL_Vulkan_GetInstanceExtensions requires an SDL_Window but the compositor needs to know which vk (instance) extensions are required much earlier than when comp_window_peek is created.

API docs for SDL_Vulkan_GetInstanceExtensions states that in future versions this parameter will be removed so for now just create a temporary, tiny window.

WARNING: The extension name strings will not be deeply copied, the docs for SDL_Vulkan_GetInstanceExtensions do not state the life time of these strings.

based on looking the current codebase these are copied from function-level static arrays containing string literals (expanded from vulkan header macros, e.g. VK_FOO_EXTENSION_NAME) so we can assume it's safe to pass around but future versions this may change, they may get destroyed when deleting the SDL_Window (although check note comment above).

References U_LOG_E, U_LOG_T, u_string_list::u_string_list_append_unique(), and U_TYPED_ARRAY_CALLOC.