The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/gui: Make it possible to enter address and port for remote

+21 -2
+21 -2
src/xrt/state_trackers/gui/gui_scene_remote.c
··· 40 40 struct r_remote_data data; 41 41 42 42 bool cheat_menu; 43 + 44 + char address[1024]; 45 + int port; 43 46 }; 44 47 45 48 const ImVec2 zero_dims = {0, 0}; ··· 314 317 static void 315 318 on_not_connected(struct gui_remote *gr, struct gui_program *p) 316 319 { 317 - if (!igButton("Connect", zero_dims)) { 320 + igInputText("Address", gr->address, sizeof(gr->address), 0, NULL, NULL); 321 + igSliderInt("Port", &gr->port, 0, UINT16_MAX, "%i", 0); 322 + 323 + bool connect = igButton("Connect", zero_dims); 324 + 325 + igSameLine(0, 4.0f); 326 + 327 + if (igButton("Exit", zero_dims)) { 328 + gui_scene_delete_me(p, &gr->base); 318 329 return; 319 330 } 320 331 321 - r_remote_connection_init(&gr->rc, "127.0.0.1", 4242); 332 + if (!connect) { 333 + return; 334 + } 335 + 336 + r_remote_connection_init(&gr->rc, gr->address, gr->port); 322 337 r_remote_connection_read_one(&gr->rc, &gr->reset); 323 338 r_remote_connection_read_one(&gr->rc, &gr->data); 324 339 } ··· 379 394 gr->base.render = scene_render; 380 395 gr->base.destroy = scene_destroy; 381 396 gr->rc.fd = -1; 397 + 398 + // GUI input defaults. 399 + snprintf(gr->address, sizeof(gr->address), "localhost"); 400 + gr->port = 4242; 382 401 383 402 gui_scene_push_front(p, &gr->base); 384 403 }