mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-14 17:50:06 +00:00
t/sdl_test: Move system init earlier
This commit is contained in:
parent
7dd45db8ea
commit
6f60116fa9
src/xrt/targets/sdl_test
|
@ -80,13 +80,9 @@ sdl_instance_create_system(struct xrt_instance *xinst,
|
|||
assert(*out_xso == NULL);
|
||||
assert(out_xsysc == NULL || *out_xsysc == NULL);
|
||||
|
||||
// Use system helper.
|
||||
struct u_system *usys = u_system_create();
|
||||
assert(usys != NULL); // Should never fail.
|
||||
|
||||
struct sdl_program *sp = from_xinst(xinst);
|
||||
|
||||
*out_xsys = &usys->base;
|
||||
*out_xsys = &sp->usys->base;
|
||||
*out_xsysd = &sp->xsysd_base;
|
||||
*out_xso = sp->xso;
|
||||
|
||||
|
@ -99,7 +95,7 @@ sdl_instance_create_system(struct xrt_instance *xinst,
|
|||
sdl_compositor_create_system(sp, &xsysc);
|
||||
|
||||
// Tell the system about the system compositor.
|
||||
u_system_set_system_compositor(usys, xsysc);
|
||||
u_system_set_system_compositor(sp->usys, xsysc);
|
||||
|
||||
*out_xsysc = xsysc;
|
||||
|
||||
|
@ -122,6 +118,15 @@ sdl_instance_destroy(struct xrt_instance *xinst)
|
|||
*
|
||||
*/
|
||||
|
||||
void
|
||||
sdl_system_init(struct sdl_program *sp)
|
||||
{
|
||||
struct u_system *usys = u_system_create();
|
||||
assert(usys != NULL); // Should never fail.
|
||||
|
||||
sp->usys = usys;
|
||||
}
|
||||
|
||||
void
|
||||
sdl_system_devices_init(struct sdl_program *sp)
|
||||
{
|
||||
|
|
|
@ -119,6 +119,9 @@ struct sdl_program
|
|||
//! Instance base.
|
||||
struct xrt_instance xinst_base;
|
||||
|
||||
//! System, implemented for now using helper code.
|
||||
struct u_system *usys;
|
||||
|
||||
//! System devices base.
|
||||
struct xrt_system_devices xsysd_base;
|
||||
|
||||
|
@ -352,6 +355,14 @@ sdl_compositor_create_system(struct sdl_program *sp, struct xrt_system_composito
|
|||
*
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Init the @ref xrt_system (and @ref u_system) struct.
|
||||
*
|
||||
* @ingroup sdl_test
|
||||
*/
|
||||
void
|
||||
sdl_system_init(struct sdl_program *sp);
|
||||
|
||||
/*!
|
||||
* Init the @ref xrt_system_devices sub struct.
|
||||
*
|
||||
|
|
|
@ -90,6 +90,7 @@ sdl_program_plus_create()
|
|||
|
||||
// Init sub components.
|
||||
sdl_instance_init(&spp);
|
||||
sdl_system_init(&spp);
|
||||
sdl_device_init(&spp);
|
||||
sdl_system_devices_init(&spp);
|
||||
sdl_compositor_init(&spp); // Needs the window.
|
||||
|
|
Loading…
Reference in a new issue