| @@ -58,6 +58,7 @@ static const struct wlr_output_impl output_impl = { | |||||||
| struct openxr_backend { | struct openxr_backend { | ||||||
| 	wlr_backend base; | 	wlr_backend base; | ||||||
| 	wl_display* display; | 	wl_display* display; | ||||||
|  | 	wl_event_loop* event_loop; | ||||||
| 	XrInstance instance {}; | 	XrInstance instance {}; | ||||||
| 	XrSession session {}; | 	XrSession session {}; | ||||||
| 	bool started = false; | 	bool started = false; | ||||||
| @@ -158,8 +159,10 @@ static bool backend_start(wlr_backend* backend) | |||||||
|  |  | ||||||
| 	xr->output = static_cast<wlr_output*>(calloc(1, sizeof(wlr_output))); | 	xr->output = static_cast<wlr_output*>(calloc(1, sizeof(wlr_output))); | ||||||
| 	if (xr->output) { | 	if (xr->output) { | ||||||
| 		wlr_output_init(xr->output, &xr->base, &output_impl, "OpenXR"); | 		wlr_output_init( | ||||||
| 		wlr_output_create_global(xr->output); | 		    xr->output, &xr->base, &output_impl, xr->event_loop, nullptr); | ||||||
|  | 		wlr_output_set_name(xr->output, "OpenXR"); | ||||||
|  | 		wlr_output_create_global(xr->output, xr->display); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	xr->started = true; | 	xr->started = true; | ||||||
| @@ -193,11 +196,12 @@ static wlr_backend_impl const backend_impl = { | |||||||
|  |  | ||||||
| wlr_backend* wlr_openxr_backend_create(wl_display* display, wl_event_loop* loop) | wlr_backend* wlr_openxr_backend_create(wl_display* display, wl_event_loop* loop) | ||||||
| { | { | ||||||
| 	(void)loop; | 	openxr_backend* b = static_cast<openxr_backend*>(calloc(1, sizeof(*b))); | ||||||
| 	auto* b = static_cast<openxr_backend*>(calloc(1, sizeof(*b))); |  | ||||||
| 	if (!b) | 	if (!b) | ||||||
| 		return nullptr; | 		return nullptr; | ||||||
| 	b->display = display; | 	b->display = display; | ||||||
|  | 	b->event_loop = loop; | ||||||
| 	wlr_backend_init(&b->base, &backend_impl); | 	wlr_backend_init(&b->base, &backend_impl); | ||||||
| 	return &b->base; | 	return &b->base; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user