Monado OpenXR Runtime
|
Internal header for SDL XR system. More...
#include "xrt/xrt_system.h"
#include "xrt/xrt_device.h"
#include "xrt/xrt_instance.h"
#include "xrt/xrt_tracking.h"
#include "xrt/xrt_compositor.h"
#include "util/u_pacing.h"
#include "util/u_logging.h"
#include "util/comp_base.h"
#include "util/comp_swapchain.h"
#include "SDL2/SDL.h"
#include "ogl/ogl_api.h"
Go to the source code of this file.
Data Structures | |
struct | sdl_swapchain |
Sub-class of comp_swapchain, used to do OpenGL rendering. More... | |
struct | sdl_comp_frame |
Tracking frame state. More... | |
struct | sdl_compositor |
Split out for convenience. More... | |
struct | sdl_program |
C base class for the SDL program. More... | |
Macros | |
#define | CHECK_GL() |
Check for OpenGL errors, context needs to be current. More... | |
Functions | |
static struct sdl_program * | from_xinst (struct xrt_instance *xinst) |
static struct sdl_program * | from_xsysd (struct xrt_system_devices *xsysd) |
static struct sdl_program * | from_xdev (struct xrt_device *xdev) |
static struct sdl_program * | from_comp (struct xrt_compositor *xc) |
static void | sdl_make_current (struct sdl_program *sp) |
Makes the OpenGL context current in this thread, takes lock. More... | |
static void | sdl_make_uncurrent (struct sdl_program *sp) |
Unmakes the any OpenGL context current in this thread, releases the lock. More... | |
void | sdl_device_init (struct sdl_program *sp) |
Init the xrt_device sub struct. More... | |
xrt_result_t | sdl_swapchain_create (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc) |
Implementation of xrt_compositor::create_swapchain. More... | |
xrt_result_t | sdl_swapchain_import (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t native_image_count, struct xrt_swapchain **out_xsc) |
Implementation of xrt_compositor::import_swapchain. More... | |
void | sdl_compositor_init (struct sdl_program *sp) |
Initializes the compositor part of the SDL program. More... | |
xrt_result_t | sdl_compositor_create_system (struct sdl_program *sp, struct xrt_system_compositor **out_xsysc) |
Creates the system compositor that wraps the native compositor. More... | |
void | sdl_system_init (struct sdl_program *sp) |
Init the xrt_system (and u_system) struct. More... | |
void | sdl_system_devices_init (struct sdl_program *sp) |
Init the xrt_system_devices sub struct. More... | |
void | sdl_instance_init (struct sdl_program *sp) |
Init the xrt_instance sub struct. More... | |
struct sdl_program * | sdl_program_plus_create (void) |
Create the SDL program. More... | |
void | sdl_program_plus_render (struct sdl_program_plus *spp) |
Render a frame, called by the compositor when layers have been committed. More... | |
void | sdl_program_plus_destroy (struct sdl_program_plus *spp) |
Destroy the SDL program. More... | |
Internal header for SDL XR system.
#define CHECK_GL | ( | ) |
Check for OpenGL errors, context needs to be current.
xrt_result_t sdl_compositor_create_system | ( | struct sdl_program * | sp, |
struct xrt_system_compositor ** | out_xsysc | ||
) |
Creates the system compositor that wraps the native compositor.
void sdl_compositor_init | ( | struct sdl_program * | sp | ) |
Initializes the compositor part of the SDL program.
References sdl_program::xdev_base.
void sdl_device_init | ( | struct sdl_program * | sp | ) |
Init the xrt_device sub struct.
In sdl_device.c
References ARRAY_SIZE, xrt_device::hmd, sdl_program::hmd, xrt_device::input_count, xrt_device::inputs, sdl_program::inputs, xrt_device::name, sdl_program::origin, xrt_device::tracking_origin, and sdl_program::xdev_base.
void sdl_instance_init | ( | struct sdl_program * | sp | ) |
Init the xrt_instance sub struct.
References xrt_instance::create_system, and sdl_program::xinst_base.
|
inlinestatic |
Makes the OpenGL context current in this thread, takes lock.
References sdl_program::ctx, sdl_program::current_mutex, os_mutex::os_mutex_lock(), and sdl_program::win.
Referenced by sdl_program_plus_render().
|
inlinestatic |
Unmakes the any OpenGL context current in this thread, releases the lock.
References sdl_program::current_mutex, and os_mutex::os_mutex_unlock().
struct sdl_program * sdl_program_plus_create | ( | void | ) |
Create the SDL program.
References sdl_program::current_mutex, sdl_program::log_level, os_mutex::os_mutex_init(), sdl_program::pose, sdl_program::spp, U_LOGGING_INFO, and xrt_pose::XRT_POSE_IDENTITY.
void sdl_program_plus_destroy | ( | struct sdl_program_plus * | spp | ) |
Destroy the SDL program.
References sdl_program::current_mutex, os_mutex::os_mutex_destroy(), and sdl_program::spp.
void sdl_program_plus_render | ( | struct sdl_program_plus * | spp | ) |
Render a frame, called by the compositor when layers have been committed.
References sdl_compositor::base, sdl_program::c, comp_layer::data, comp_base::layer_accum, comp_layer_accum::layer_count, comp_layer_accum::layers, sdl_make_current(), sdl_program::spp, and xrt_layer_data::type.
xrt_result_t sdl_swapchain_create | ( | struct xrt_compositor * | xc, |
const struct xrt_swapchain_create_info * | info, | ||
struct xrt_swapchain ** | out_xsc | ||
) |
Implementation of xrt_compositor::create_swapchain.
xrt_result_t sdl_swapchain_import | ( | struct xrt_compositor * | xc, |
const struct xrt_swapchain_create_info * | info, | ||
struct xrt_image_native * | native_images, | ||
uint32_t | native_image_count, | ||
struct xrt_swapchain ** | out_xsc | ||
) |
Implementation of xrt_compositor::import_swapchain.
void sdl_system_devices_init | ( | struct sdl_program * | sp | ) |
Init the xrt_system_devices sub struct.
References xrt_system_devices::destroy, and sdl_program::xsysd_base.
void sdl_system_init | ( | struct sdl_program * | sp | ) |
Init the xrt_system (and u_system) struct.
References u_system::u_system_create(), and sdl_program::usys.