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