Skip to content
This repository was archived by the owner on Apr 15, 2023. It is now read-only.

Commit 7340fcd

Browse files
committed
Updated repo for the API changes
Replaced bruh moment pointers with chad std::functions
1 parent 11a67df commit 7340fcd

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

device_KinectBasis_Full_Settings/DeviceHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class DeviceHandler : public ktvr::K2TrackingDeviceBase_KinectBasis
3232
// You can put anything here,
3333
// from textblocks (labels) to numberboxes
3434
// Just remember to register handlers
35-
// and optionally cache the pointers ash shared
35+
// and optionally cache the pointers as shared
3636
layoutRoot->AppendSingleElement(
3737
CreateTextBlock(
3838
"In the beginning was the Word."));

external/vendor/KinectToVR_API_Devices.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ namespace ktvr
189189
}
190190

191191
// Function handlers for plugin to use
192-
void (*OnClick)(Button* this_button);
192+
std::function<void(Button*)> OnClick;
193+
//void (*OnClick)(Button* this_button);
193194
};
194195

195196
// NumberBox Class : (SpinBox, Same as XAMLs)
@@ -216,7 +217,8 @@ namespace ktvr
216217
}
217218

218219
// Function handlers for plugin to use
219-
void (*OnValueChanged)(NumberBox* this_number_box, int const& new_value);
220+
std::function<void(NumberBox*, int const&)> OnValueChanged;
221+
//void (*OnValueChanged)(NumberBox* this_number_box, int const& new_value);
220222
};
221223

222224
// CheckBox Class : (Same as XAMLs)
@@ -243,8 +245,10 @@ namespace ktvr
243245
}
244246

245247
// Function handlers for plugin to use
246-
void (*OnChecked)(CheckBox* this_check_box);
247-
void (*OnUnchecked)(CheckBox* this_check_box);
248+
std::function<void(CheckBox*)> OnChecked;
249+
std::function<void(CheckBox*)> OnUnchecked;
250+
//void (*OnChecked)(CheckBox* this_check_box);
251+
//void (*OnUnchecked)(CheckBox* this_check_box);
248252
};
249253

250254
// ToggleSwitch Class : (A bit altered XAMLs)
@@ -271,8 +275,10 @@ namespace ktvr
271275
}
272276

273277
// Function handlers for plugin to use
274-
void (*OnChecked)(ToggleSwitch* this_toggle_switch);
275-
void (*OnUnchecked)(ToggleSwitch* this_toggle_switch);
278+
std::function<void(ToggleSwitch*)> OnChecked;
279+
std::function<void(ToggleSwitch*)> OnUnchecked;
280+
//void (*OnChecked)(ToggleSwitch* this_toggle_switch);
281+
//void (*OnUnchecked)(ToggleSwitch* this_toggle_switch);
276282
};
277283

278284
// TextBox Class : (Same as XAMLs, Text Input)
@@ -292,7 +298,8 @@ namespace ktvr
292298
}
293299

294300
// Function handlers for plugin to use
295-
void (*OnEnterKeyDown)(TextBox* this_text_box);
301+
std::function<void(TextBox*)> OnEnterKeyDown;
302+
//void (*OnEnterKeyDown)(TextBox* this_text_box);
296303
};
297304

298305
// LayoutRoot appending enum:

0 commit comments

Comments
 (0)