Codebase list xrdesktop / 2f6c1da
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
4 changed file(s) with 31 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
151151 }
152152
153153 static GxrContext *
154 _create_gxr_context ()
154 _create_gxr_context (GxrAppType app_type)
155155 {
156156 GSList *instance_ext_list =
157157 gulkan_client_get_external_memory_instance_extensions ();
162162 GSettings *settings = xrd_settings_get_instance ();
163163 GxrApi api = (guint) g_settings_get_enum (settings, "default-api");
164164
165 GxrContext *context = gxr_context_new_full (GXR_APP_SCENE,
165 GxrContext *context = gxr_context_new_full (app_type,
166166 api,
167167 instance_ext_list,
168168 device_ext_list);
172172 return context;
173173 }
174174
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
175190 XrdClient *
176191 xrd_client_new_with_mode (XrdClientMode mode)
177192 {
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);
180196 if (!context)
181197 {
182198 g_error ("Could not init VR runtime.\n");
21932209 gboolean to_scene = XRD_IS_OVERLAY_CLIENT (self);
21942210 g_object_unref (self);
21952211
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);
21972215 if (!context)
21982216 {
21992217 g_error ("Could not init VR runtime.\n");
4848 self->grab_state.transform_lock = XRD_TRANSFORM_LOCK_NONE;
4949 graphene_matrix_init_identity (&self->pose_pointer);
5050 graphene_matrix_init_identity (&self->pose_hand_grip);
51 self->pointer_ray = NULL;
52 self->pointer_tip = NULL;
5153 self->ignore_input = FALSE;
5254 self->context = NULL;
5355 }
6769 xrd_controller_finalize (GObject *gobject)
6870 {
6971 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);
7376 }
7477
7578 XrdPointer *
198198 _test_scene_client ()
199199 {
200200 /* _create_gxr_context() imported from xrd-client.c */
201 GxrContext *context = _create_gxr_context ();
201 GxrContext *context = _create_gxr_context (GXR_APP_SCENE);
202202 if (!context)
203203 {
204204 g_error ("Could not init VR runtime.\n");
143143 _test_scene_client ()
144144 {
145145 /* _create_gxr_context() imported from xrd-client.c */
146 GxrContext *context = _create_gxr_context ();
146 GxrContext *context = _create_gxr_context (GXR_APP_SCENE);
147147 if (!context)
148148 {
149149 g_error ("Could not init VR runtime.\n");