forked from inkyblackness/imgui-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawCommandWrapper.cpp
35 lines (29 loc) · 994 Bytes
/
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
#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 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 = 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);
}