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

Commit

Permalink
Updated repo for the API changes
Browse files Browse the repository at this point in the history
Replaced bruh moment pointers with chad std::functions
  • Loading branch information
KimihikoAkayasaki committed Apr 14, 2022
1 parent 11a67df commit 7340fcd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion device_KinectBasis_Full_Settings/DeviceHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DeviceHandler : public ktvr::K2TrackingDeviceBase_KinectBasis
// You can put anything here,
// from textblocks (labels) to numberboxes
// Just remember to register handlers
// and optionally cache the pointers ash shared
// and optionally cache the pointers as shared
layoutRoot->AppendSingleElement(
CreateTextBlock(
"In the beginning was the Word."));
Expand Down
21 changes: 14 additions & 7 deletions external/vendor/KinectToVR_API_Devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ namespace ktvr
}

// Function handlers for plugin to use
void (*OnClick)(Button* this_button);
std::function<void(Button*)> OnClick;
//void (*OnClick)(Button* this_button);
};

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

// Function handlers for plugin to use
void (*OnValueChanged)(NumberBox* this_number_box, int const& new_value);
std::function<void(NumberBox*, int const&)> OnValueChanged;
//void (*OnValueChanged)(NumberBox* this_number_box, int const& new_value);
};

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

// Function handlers for plugin to use
void (*OnChecked)(CheckBox* this_check_box);
void (*OnUnchecked)(CheckBox* this_check_box);
std::function<void(CheckBox*)> OnChecked;
std::function<void(CheckBox*)> OnUnchecked;
//void (*OnChecked)(CheckBox* this_check_box);
//void (*OnUnchecked)(CheckBox* this_check_box);
};

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

// Function handlers for plugin to use
void (*OnChecked)(ToggleSwitch* this_toggle_switch);
void (*OnUnchecked)(ToggleSwitch* this_toggle_switch);
std::function<void(ToggleSwitch*)> OnChecked;
std::function<void(ToggleSwitch*)> OnUnchecked;
//void (*OnChecked)(ToggleSwitch* this_toggle_switch);
//void (*OnUnchecked)(ToggleSwitch* this_toggle_switch);
};

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

// Function handlers for plugin to use
void (*OnEnterKeyDown)(TextBox* this_text_box);
std::function<void(TextBox*)> OnEnterKeyDown;
//void (*OnEnterKeyDown)(TextBox* this_text_box);
};

// LayoutRoot appending enum:
Expand Down

0 comments on commit 7340fcd

Please sign in to comment.