forked from AllenDang/imgui-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDrawCommandWrapper.cpp
40 lines (33 loc) · 1.16 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 "imguiWrappedHeader.h"
#include "DrawCommandWrapper.h"
#include "WrapperConverter.h"
void iggDrawCommandGetElementCount(IggDrawCmd handle, unsigned int *count)
{
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
*count = cmd->ElemCount;
}
void iggDrawCommandGetVertexOffset(IggDrawCmd handle, unsigned int *count) {
ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
*count = cmd->VtxOffset;
}
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);
}