MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / platform_file_picker

Function platform_file_picker

StereoKitC/tools/file_picker.cpp:117–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115///////////////////////////////////////////
116
117void platform_file_picker(picker_mode_ mode, void *callback_data, void (*on_confirm)(void *callback_data, bool32_t confirmed, const char *filename), const file_filter_t *filters, int32_t filter_count) {
118 // This is basically a manual lambda capture for the wrapper callback
119 struct callback_t {
120 void *callback_data;
121 void (*on_confirm)(void *callback_data, bool32_t confirmed, const char *filename);
122 };
123 callback_t *data = sk_malloc_t(callback_t, 1);
124 data->callback_data = callback_data;
125 data->on_confirm = on_confirm;
126
127 // Call the file picker that does all the real work, and pass the callback
128 // along to _our_ callback.
129 platform_file_picker_sz(mode, data, [](void *callback_data, bool32_t confirmed, const char *filename, int32_t) {
130 callback_t *data = (callback_t *)callback_data;
131 if (data->on_confirm)
132 data->on_confirm(data->callback_data, confirmed, filename);
133 sk_free(data);
134 }, filters, filter_count);
135}
136
137///////////////////////////////////////////
138

Callers 2

demo_picker_updateFunction · 0.85
demo_bvh_updateFunction · 0.85

Calls 1

platform_file_picker_szFunction · 0.85

Tested by

no test coverage detected