Update upstream source from tag 'upstream/0.14.1'
Update to upstream version '0.14.1'
with Debian dir 4f175cb93c7e492a4527ced1b2249f72c1424c13
Andrew Lee (李健秋)
4 years ago
151 | 151 |
}
|
152 | 152 |
|
153 | 153 |
static GxrContext *
|
154 | |
_create_gxr_context ()
|
|
154 |
_create_gxr_context (GxrAppType app_type)
|
155 | 155 |
{
|
156 | 156 |
GSList *instance_ext_list =
|
157 | 157 |
gulkan_client_get_external_memory_instance_extensions ();
|
|
162 | 162 |
GSettings *settings = xrd_settings_get_instance ();
|
163 | 163 |
GxrApi api = (guint) g_settings_get_enum (settings, "default-api");
|
164 | 164 |
|
165 | |
GxrContext *context = gxr_context_new_full (GXR_APP_SCENE,
|
|
165 |
GxrContext *context = gxr_context_new_full (app_type,
|
166 | 166 |
api,
|
167 | 167 |
instance_ext_list,
|
168 | 168 |
device_ext_list);
|
|
172 | 172 |
return context;
|
173 | 173 |
}
|
174 | 174 |
|
|
175 |
static GxrAppType
|
|
176 |
_xrd_mode_to_gxr_app_type (XrdClientMode mode)
|
|
177 |
{
|
|
178 |
switch (mode)
|
|
179 |
{
|
|
180 |
case XRD_CLIENT_MODE_OVERLAY:
|
|
181 |
return GXR_APP_OVERLAY;
|
|
182 |
case XRD_CLIENT_MODE_SCENE:
|
|
183 |
return GXR_APP_SCENE;
|
|
184 |
default:
|
|
185 |
g_printerr ("Unknown client mode: %d\n", mode);
|
|
186 |
return GXR_APP_OVERLAY;
|
|
187 |
}
|
|
188 |
}
|
|
189 |
|
175 | 190 |
XrdClient *
|
176 | 191 |
xrd_client_new_with_mode (XrdClientMode mode)
|
177 | 192 |
{
|
178 | |
|
179 | |
GxrContext *context = _create_gxr_context ();
|
|
193 |
GxrAppType app_type = _xrd_mode_to_gxr_app_type (mode);
|
|
194 |
|
|
195 |
GxrContext *context = _create_gxr_context (app_type);
|
180 | 196 |
if (!context)
|
181 | 197 |
{
|
182 | 198 |
g_error ("Could not init VR runtime.\n");
|
|
2193 | 2209 |
gboolean to_scene = XRD_IS_OVERLAY_CLIENT (self);
|
2194 | 2210 |
g_object_unref (self);
|
2195 | 2211 |
|
2196 | |
GxrContext *context = _create_gxr_context ();
|
|
2212 |
GxrAppType new_app_type = to_scene ? GXR_APP_SCENE : GXR_APP_OVERLAY;
|
|
2213 |
|
|
2214 |
GxrContext *context = _create_gxr_context (new_app_type);
|
2197 | 2215 |
if (!context)
|
2198 | 2216 |
{
|
2199 | 2217 |
g_error ("Could not init VR runtime.\n");
|
48 | 48 |
self->grab_state.transform_lock = XRD_TRANSFORM_LOCK_NONE;
|
49 | 49 |
graphene_matrix_init_identity (&self->pose_pointer);
|
50 | 50 |
graphene_matrix_init_identity (&self->pose_hand_grip);
|
|
51 |
self->pointer_ray = NULL;
|
|
52 |
self->pointer_tip = NULL;
|
51 | 53 |
self->ignore_input = FALSE;
|
52 | 54 |
self->context = NULL;
|
53 | 55 |
}
|
|
67 | 69 |
xrd_controller_finalize (GObject *gobject)
|
68 | 70 |
{
|
69 | 71 |
XrdController *self = XRD_CONTROLLER (gobject);
|
70 | |
g_object_unref (self->pointer_ray);
|
71 | |
g_object_unref (self->pointer_tip);
|
72 | |
(void) self;
|
|
72 |
if (self->pointer_ray)
|
|
73 |
g_object_unref (self->pointer_ray);
|
|
74 |
if (self->pointer_tip)
|
|
75 |
g_object_unref (self->pointer_tip);
|
73 | 76 |
}
|
74 | 77 |
|
75 | 78 |
XrdPointer *
|
198 | 198 |
_test_scene_client ()
|
199 | 199 |
{
|
200 | 200 |
/* _create_gxr_context() imported from xrd-client.c */
|
201 | |
GxrContext *context = _create_gxr_context ();
|
|
201 |
GxrContext *context = _create_gxr_context (GXR_APP_SCENE);
|
202 | 202 |
if (!context)
|
203 | 203 |
{
|
204 | 204 |
g_error ("Could not init VR runtime.\n");
|
143 | 143 |
_test_scene_client ()
|
144 | 144 |
{
|
145 | 145 |
/* _create_gxr_context() imported from xrd-client.c */
|
146 | |
GxrContext *context = _create_gxr_context ();
|
|
146 |
GxrContext *context = _create_gxr_context (GXR_APP_SCENE);
|
147 | 147 |
if (!context)
|
148 | 148 |
{
|
149 | 149 |
g_error ("Could not init VR runtime.\n");
|