forked from inkyblackness/imgui-go
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDrawCommandWrapper.cpp
39 lines (32 loc) · 1.29 KB
/
DrawCommandWrapper.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
33
34
35
36
37
38
39
#include "DrawCommandWrapper.h"
#include "WrapperConverter.h"
#include "imguiWrappedHeader.h"
unsigned int iggDrawCommandIdxOffset(IggDrawCmd handle) {
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
return cmd->IdxOffset;
}
void iggDrawCommandGetVertexOffset(IggDrawCmd handle, unsigned int *count) {
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
*count = cmd->VtxOffset;
}
void iggDrawCommandGetElementCount(IggDrawCmd handle, unsigned int *count) {
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
*count = cmd->ElemCount;
}
void iggDrawCommandGetClipRect(IggDrawCmd handle, IggVec4 *rect) {
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
exportValue(*rect, cmd->ClipRect);
}
void iggDrawCommandGetTextureID(IggDrawCmd handle, IggTextureID *id) {
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
*id = reinterpret_cast<IggTextureID>(cmd->TextureId);
}
IggBool iggDrawCommandHasUserCallback(IggDrawCmd handle) {
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
return (cmd->UserCallback != 0) ? 1 : 0;
}
void iggDrawCommandCallUserCallback(IggDrawCmd handle, IggDrawList listHandle) {
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
ImDrawList *list = reinterpret_cast<ImDrawList *>(listHandle);
cmd->UserCallback(list, cmd);
}