Commit 141bdf98 authored by Christoph Haag's avatar Christoph Haag

client: Use OpenVR overlay mode for running in overlay mode

parent b7d4e0da
Pipeline #136507 failed with stage
in 4 minutes and 35 seconds
......@@ -152,7 +152,7 @@ xrd_client_class_init (XrdClientClass *klass)
}
static GxrContext *
_create_gxr_context ()
_create_gxr_context (GxrAppType app_type)
{
GSList *instance_ext_list =
gulkan_client_get_external_memory_instance_extensions ();
......@@ -163,7 +163,7 @@ _create_gxr_context ()
GSettings *settings = xrd_settings_get_instance ();
GxrApi api = (guint) g_settings_get_enum (settings, "default-api");
GxrContext *context = gxr_context_new_full (GXR_APP_SCENE,
GxrContext *context = gxr_context_new_full (app_type,
api,
instance_ext_list,
device_ext_list);
......@@ -173,11 +173,27 @@ _create_gxr_context ()
return context;
}
static GxrAppType
_xrd_mode_to_gxr_app_type (XrdClientMode mode)
{
switch (mode)
{
case XRD_CLIENT_MODE_OVERLAY:
return GXR_APP_OVERLAY;
case XRD_CLIENT_MODE_SCENE:
return GXR_APP_SCENE;
default:
g_printerr ("Unknown client mode: %d\n", mode);
return GXR_APP_OVERLAY;
}
}
XrdClient *
xrd_client_new_with_mode (XrdClientMode mode)
{
GxrAppType app_type = _xrd_mode_to_gxr_app_type (mode);
GxrContext *context = _create_gxr_context ();
GxrContext *context = _create_gxr_context (app_type);
if (!context)
{
g_error ("Could not init VR runtime.\n");
......@@ -2194,7 +2210,9 @@ _replace_client (XrdClient *self)
gboolean to_scene = XRD_IS_OVERLAY_CLIENT (self);
g_object_unref (self);
GxrContext *context = _create_gxr_context ();
GxrAppType new_app_type = to_scene ? GXR_APP_SCENE : GXR_APP_OVERLAY;
GxrContext *context = _create_gxr_context (new_app_type);
if (!context)
{
g_error ("Could not init VR runtime.\n");
......
......@@ -199,7 +199,7 @@ static int
_test_scene_client ()
{
/* _create_gxr_context() imported from xrd-client.c */
GxrContext *context = _create_gxr_context ();
GxrContext *context = _create_gxr_context (GXR_APP_SCENE);
if (!context)
{
g_error ("Could not init VR runtime.\n");
......
......@@ -144,7 +144,7 @@ static int
_test_scene_client ()
{
/* _create_gxr_context() imported from xrd-client.c */
GxrContext *context = _create_gxr_context ();
GxrContext *context = _create_gxr_context (GXR_APP_SCENE);
if (!context)
{
g_error ("Could not init VR runtime.\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment