1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
/*
* gxr
* Copyright 2018 Collabora Ltd.
* Author: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
* SPDX-License-Identifier: MIT
*/
#include <glib.h>
#include <gulkan.h>
#include "gxr.h"
static void
_test_load_action_manifest ()
{
GxrContext *context = gxr_context_new (GXR_APP_SCENE, "Test Actions", 1);
g_assert_nonnull (context);
GulkanClient *gc = gulkan_client_new ();
g_assert_nonnull (gc);
if (gxr_context_get_api (context) == GXR_API_OPENVR)
{
if (!gxr_context_load_action_manifest (
context,
"xrdesktop.openvr",
"/res/bindings/openvr",
"actions.json",
"bindings_vive_controller.json",
"bindings_knuckles_controller.json",
NULL))
{
g_print ("Failed to load action bindings!\n");
return;
}
}
else
{
{
if (!gxr_context_load_action_manifest (
context,
"xrdesktop.openxr",
"/res/bindings/openxr",
"actions.json",
"bindings_khronos_simple_controller.json",
"bindings_valve_index_controller.json",
NULL))
{
g_print ("Failed to load action bindings!\n");
return;
}
}
}
g_object_unref (context);
}
int
main ()
{
_test_load_action_manifest ();
gxr_backend_shutdown ();
return 0;
}
|