DrawCommandWrapper.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "DrawCommandWrapper.h"
  2. #include "WrapperConverter.h"
  3. #include "imguiWrappedHeader.h"
  4. unsigned int iggDrawCommandIdxOffset(IggDrawCmd handle) {
  5. ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
  6. return cmd->IdxOffset;
  7. }
  8. void iggDrawCommandGetVertexOffset(IggDrawCmd handle, unsigned int *count) {
  9. ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
  10. *count = cmd->VtxOffset;
  11. }
  12. void iggDrawCommandGetElementCount(IggDrawCmd handle, unsigned int *count) {
  13. ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
  14. *count = cmd->ElemCount;
  15. }
  16. void iggDrawCommandGetClipRect(IggDrawCmd handle, IggVec4 *rect) {
  17. ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
  18. exportValue(*rect, cmd->ClipRect);
  19. }
  20. void iggDrawCommandGetTextureID(IggDrawCmd handle, IggTextureID *id) {
  21. ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
  22. *id = reinterpret_cast<IggTextureID>(cmd->TextureId);
  23. }
  24. IggBool iggDrawCommandHasUserCallback(IggDrawCmd handle) {
  25. ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
  26. return (cmd->UserCallback != 0) ? 1 : 0;
  27. }
  28. void iggDrawCommandCallUserCallback(IggDrawCmd handle, IggDrawList listHandle) {
  29. ImDrawCmd *cmd = reinterpret_cast<ImDrawCmd *>(handle);
  30. ImDrawList *list = reinterpret_cast<ImDrawList *>(listHandle);
  31. cmd->UserCallback(list, cmd);
  32. }