Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame^] | 1 | #define LOG_TAG "libgvr_controller_shim" |
| 2 | |
| 3 | #include <cutils/log.h> |
| 4 | #include <vr/gvr/capi/include/gvr_controller.h> |
| 5 | #include <vr/gvr/capi/include/gvr_types.h> |
| 6 | |
| 7 | gvr_controller_context* gvr_controller_create_and_init(int32_t options, |
| 8 | gvr_context* context) { |
| 9 | ALOGE("gvr_controller_create_and_init not implemented."); |
| 10 | return nullptr; |
| 11 | } |
| 12 | |
| 13 | gvr_controller_context* gvr_controller_create_and_init_android( |
| 14 | JNIEnv* env, jobject android_context, jobject class_loader, int32_t options, |
| 15 | gvr_context* context) { |
| 16 | ALOGE("gvr_controller_create_and_init_android not implemented."); |
| 17 | return nullptr; |
| 18 | } |
| 19 | |
| 20 | void gvr_controller_destroy(gvr_controller_context** api) { |
| 21 | ALOGE("gvr_controller_destroy not implemented."); |
| 22 | } |
| 23 | |
| 24 | gvr_controller_state* gvr_controller_state_create() { |
| 25 | ALOGE("gvr_controller_state_create not implemented."); |
| 26 | return nullptr; |
| 27 | } |
| 28 | |
| 29 | void gvr_controller_state_destroy(gvr_controller_state** state) { |
| 30 | ALOGE("gvr_controller_state_destroy not implemented."); |
| 31 | } |
| 32 | |
| 33 | void gvr_controller_state_update(gvr_controller_context* api, int32_t flags, |
| 34 | gvr_controller_state* out_state) { |
| 35 | ALOGE("gvr_controller_state_update not implemented."); |
| 36 | } |
| 37 | |
| 38 | int64_t gvr_controller_state_get_last_button_timestamp( |
| 39 | const gvr_controller_state* state) { |
| 40 | ALOGE("gvr_controller_state_get_last_button_timestamp not implemented."); |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | bool gvr_controller_state_get_button_state(const gvr_controller_state* state, |
| 45 | int32_t button) { |
| 46 | ALOGE("gvr_controller_state_get_button_state not implemented."); |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | bool gvr_controller_state_get_button_down(const gvr_controller_state* state, |
| 51 | int32_t button) { |
| 52 | ALOGE("gvr_controller_state_get_button_down not implemented."); |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | bool gvr_controller_state_get_button_up(const gvr_controller_state* state, |
| 57 | int32_t button) { |
| 58 | ALOGE("gvr_controller_state_get_button_up not implemented."); |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | bool gvr_controller_state_is_touching(const gvr_controller_state* state) { |
| 63 | ALOGE("gvr_controller_state_is_touching not implemented."); |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | gvr_vec2f gvr_controller_state_get_touch_pos( |
| 68 | const gvr_controller_state* state) { |
| 69 | ALOGE("gvr_controller_state_get_touch_pos not implemented."); |
| 70 | return {0.0f, 0.0f}; |
| 71 | } |
| 72 | |
| 73 | bool gvr_controller_state_get_touch_down(const gvr_controller_state* state) { |
| 74 | ALOGE("gvr_controller_state_get_touch_down not implemented."); |
| 75 | return false; |
| 76 | } |
| 77 | |
| 78 | bool gvr_controller_state_get_touch_up(const gvr_controller_state* state) { |
| 79 | ALOGE("gvr_controller_state_get_touch_up not implemented."); |
| 80 | return false; |
| 81 | } |
| 82 | |
| 83 | int64_t gvr_controller_state_get_last_touch_timestamp( |
| 84 | const gvr_controller_state* state) { |
| 85 | ALOGE("gvr_controller_state_get_last_touch_timestamp not implemented."); |
| 86 | return 0; |
| 87 | } |
| 88 | |
| 89 | gvr_quatf gvr_controller_state_get_orientation( |
| 90 | const gvr_controller_state* state) { |
| 91 | ALOGE("gvr_controller_state_get_orientation not implemented."); |
| 92 | return {0.0f, 0.0f, 0.0f, 0.0f}; |
| 93 | } |
| 94 | |
| 95 | int64_t gvr_controller_state_get_last_orientation_timestamp( |
| 96 | const gvr_controller_state* state) { |
| 97 | ALOGE("gvr_controller_state_get_last_orientation_timestamp not implemented."); |
| 98 | return 0; |
| 99 | } |
| 100 | |
| 101 | const char* gvr_controller_api_status_to_string(int32_t status) { |
| 102 | ALOGE("gvr_controller_api_status_to_string not implemented."); |
| 103 | return nullptr; |
| 104 | } |
| 105 | |
| 106 | const char* gvr_controller_connection_state_to_string(int32_t state) { |
| 107 | ALOGE("gvr_controller_connection_state_to_string not implemented."); |
| 108 | return nullptr; |
| 109 | } |
| 110 | |
| 111 | const char* gvr_controller_button_to_string(int32_t button) { |
| 112 | ALOGE("gvr_controller_button_to_string not implemented."); |
| 113 | return nullptr; |
| 114 | } |
| 115 | |
| 116 | int32_t gvr_controller_get_default_options() { |
| 117 | ALOGE("gvr_controller_get_default_options not implemented."); |
| 118 | return 0; |
| 119 | } |
| 120 | |
| 121 | void gvr_controller_pause(gvr_controller_context* api) { |
| 122 | ALOGE("gvr_controller_pause not implemented."); |
| 123 | } |
| 124 | |
| 125 | void gvr_controller_resume(gvr_controller_context* api) { |
| 126 | ALOGE("gvr_controller_resume not implemented."); |
| 127 | } |
| 128 | |
| 129 | int32_t gvr_controller_state_get_api_status(const gvr_controller_state* state) { |
| 130 | return GVR_CONTROLLER_API_OK; |
| 131 | } |
| 132 | |
| 133 | int32_t gvr_controller_state_get_connection_state( |
| 134 | const gvr_controller_state* state) { |
| 135 | return GVR_CONTROLLER_CONNECTED; |
| 136 | } |
| 137 | |
| 138 | gvr_vec3f gvr_controller_state_get_gyro(const gvr_controller_state* state) { |
| 139 | ALOGE("gvr_controller_state_get_gyro not implemented."); |
| 140 | return {0.0, 0.0, 0.0}; |
| 141 | } |
| 142 | |
| 143 | gvr_vec3f gvr_controller_state_get_accel(const gvr_controller_state* state) { |
| 144 | ALOGE("gvr_controller_state_get_accel not implemented."); |
| 145 | return {0.0, 0.0, 0.0}; |
| 146 | } |
| 147 | |
| 148 | int64_t gvr_controller_state_get_last_gyro_timestamp( |
| 149 | const gvr_controller_state* state) { |
| 150 | ALOGE("gvr_controller_state_get_last_gyro_timestamp not implemented."); |
| 151 | return 0; |
| 152 | } |
| 153 | |
| 154 | int64_t gvr_controller_state_get_last_accel_timestamp( |
| 155 | const gvr_controller_state* state) { |
| 156 | ALOGE("gvr_controller_state_get_last_accel_timestamp not implemented."); |
| 157 | return 0; |
| 158 | } |
| 159 | |
| 160 | bool gvr_controller_state_get_recentered(const gvr_controller_state* state) { |
| 161 | ALOGE("gvr_controller_state_get_recentered not implemented."); |
| 162 | return false; |
| 163 | } |
| 164 | |
| 165 | bool gvr_controller_state_get_recentering(const gvr_controller_state* state) { |
| 166 | ALOGE("gvr_controller_state_get_recentering not implemented."); |
| 167 | return false; |
| 168 | } |