forked from AllenDang/imgui-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDragDropWrapper.cpp
32 lines (25 loc) · 904 Bytes
/
DragDropWrapper.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "imguiWrappedHeader.h"
#include "DragDropWrapper.h"
void* iggPayloadGetData(IggPayload handle) {
ImGuiPayload *payload = reinterpret_cast<ImGuiPayload*>(handle);
return payload->Data;
}
IggBool iggBeginDragDropSource(int flags) {
return ImGui::BeginDragDropSource(flags) != 0 ? 1 : 0;
}
IggBool iggSetDragDropPayload(const char* type, const void* data, unsigned int sz, int cond) {
return ImGui::SetDragDropPayload(type, data, sz, cond) != 0 ? 1 : 0;
}
void iggEndDragDropSource() {
ImGui::EndDragDropSource();
}
IggBool iggBeginDragDropTarget() {
return ImGui::BeginDragDropTarget() != 0 ? 1 : 0;
}
IggPayload iggAcceptDragDropPayload(const char *type, int flags) {
const ImGuiPayload *payload = ImGui::AcceptDragDropPayload(type, flags);
return static_cast<IggPayload>(const_cast<ImGuiPayload*>(payload));
}
void iggEndDragDropTarget() {
ImGui::EndDragDropTarget();
}