Debian Codegraph @

modules/webxr/godot_webxr.h

raw symbols SCIP
1 /**************************************************************************/
2 /* godot_webxr.h */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #pragma once
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 enum WebXRInputEvent {
38 WEBXR_INPUT_EVENT_SELECTSTART,
39 WEBXR_INPUT_EVENT_SELECTEND,
40 WEBXR_INPUT_EVENT_SQUEEZESTART,
41 WEBXR_INPUT_EVENT_SQUEEZEEND,
42 };
43
44 typedef void (*GodotWebXRSupportedCallback)(char *p_session_mode, int p_supported);
45 typedef void (*GodotWebXRStartedCallback)(char *p_reference_space_type, char *p_enabled_features, char *p_environment_blend_mode);
46 typedef void (*GodotWebXREndedCallback)();
47 typedef void (*GodotWebXRFailedCallback)(char *p_message);
48 typedef void (*GodotWebXRInputEventCallback)(int p_event_type, int p_input_source_id);
49 typedef void (*GodotWebXRSimpleEventCallback)(char *p_signal_name);
50
51 extern int godot_webxr_is_supported();
52 extern void godot_webxr_is_session_supported(const char *p_session_mode, GodotWebXRSupportedCallback p_callback);
53
54 extern void godot_webxr_initialize(
55 const char *p_session_mode,
56 const char *p_required_features,
57 const char *p_optional_features,
58 const char *p_requested_reference_space_types,
59 GodotWebXRStartedCallback p_on_session_started,
60 GodotWebXREndedCallback p_on_session_ended,
61 GodotWebXRFailedCallback p_on_session_failed,
62 GodotWebXRInputEventCallback p_on_input_event,
63 GodotWebXRSimpleEventCallback p_on_simple_event);
64 extern void godot_webxr_uninitialize();
65
66 extern int godot_webxr_get_view_count();
67 extern bool godot_webxr_get_render_target_size(int *r_size);
68 extern bool godot_webxr_get_transform_for_view(int p_view, float *r_transform);
69 extern bool godot_webxr_get_projection_for_view(int p_view, float *r_transform);
70 extern unsigned int godot_webxr_get_color_texture();
71 extern unsigned int godot_webxr_get_depth_texture();
72 extern unsigned int godot_webxr_get_velocity_texture();
73
74 extern bool godot_webxr_update_input_source(
75 int p_input_source_id,
76 float *r_target_pose,
77 int *r_target_ray_mode,
78 int *r_touch_index,
79 int *r_has_grip_pose,
80 float *r_grip_pose,
81 int *r_has_standard_mapping,
82 int *r_button_count,
83 float *r_buttons,
84 int *r_axes_count,
85 float *r_axes,
86 int *r_has_hand_data,
87 float *r_hand_joints,
88 float *r_hand_radii);
89
90 extern char *godot_webxr_get_visibility_state();
91 extern int godot_webxr_get_bounds_geometry(float **r_points);
92
93 extern float godot_webxr_get_frame_rate();
94 extern void godot_webxr_update_target_frame_rate(float p_frame_rate);
95 extern int godot_webxr_get_supported_frame_rates(float **r_frame_rates);
96
97 #ifdef __cplusplus
98 }
99 #endif