public void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text, float wrap_width = 0.0f, bool cpu_fine_clip = false) { ImDrawList *native_draw_list = draw_list.NativePtr; byte * native_text; int text_byteCount = 0; if (text != null) { text_byteCount = Encoding.UTF8.GetByteCount(text); if (text_byteCount > Util.StackAllocationSizeLimit) { native_text = Util.Allocate(text_byteCount + 1); } else { byte *native_text_stackBytes = stackalloc byte[text_byteCount + 1]; native_text = native_text_stackBytes; } int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); native_text[native_text_offset] = 0; } else { native_text = null; } byte *native_text_end = null; ImGuiNative.ImFont_RenderText(NativePtr, native_draw_list, size, Helper.V2f(pos), col, Helper.V4f(clip_rect), native_text, native_text_end, wrap_width, cpu_fine_clip ? (byte)1 : (byte)0); if (text_byteCount > Util.StackAllocationSizeLimit) { Util.Free(native_text); } }
public static unsafe void DrawHermite(ImDrawList *drawList, Vector2 p1, Vector2 p2, int steps, Color color) { var t1 = new Vector2(80.0f, 0.0f); var t2 = new Vector2(80.0f, 0.0f); for (var step = 0; step <= steps; step++) { var t = (float)step / steps; var h1 = +2 * t * t * t - 3 * t * t + 1.0f; var h2 = -2 * t * t * t + 3 * t * t; var h3 = t * t * t - 2 * t * t + t; var h4 = t * t * t - t * t; ImGuiNative.ImDrawList_PathLineTo(drawList, new Vector2(h1 * p1.X + h2 * p2.X + h3 * t1.X + h4 * t2.X, h1 * p1.Y + h2 * p2.Y + h3 * t1.Y + h4 * t2.Y)); } ImGuiNative.ImDrawList_PathStroke(drawList, color.PackedValue, 0, 3.0f); }
public abstract void ImDrawList_AddRectFilledMultiColor(ImDrawList *self, Vector2 a, Vector2 b, uint col_upr_left, uint col_upr_right, uint col_bot_right, uint col_bot_left);
public static unsafe void AddDrawListImageRounded(ImDrawList *list, Texture texture, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col, float rounding, int rounding_corners) { AddTexture(texture); ImGuiNative.ImDrawList_AddImageRounded(list, texture.GetNativeTexturePtr(), a, b, uv_a, uv_b, col, rounding, rounding_corners); }
public static void SetDrawlist() { ImDrawList *drawlist = null; ImGuizmoNative.ImGuizmo_SetDrawlist(drawlist); }
public static extern void ImGuizmo_SetDrawlist(ImDrawList *drawlist);
public abstract void ImDrawList_PathBezierCurveTo(ImDrawList *self, Vector2 p1, Vector2 p2, Vector2 p3, int num_segments);
public abstract void ImFont_RenderChar(ImFont *self, ImDrawList *draw_list, float size, Vector2 pos, uint col, ushort c);
public abstract void ImDrawList_AddImageRounded(ImDrawList *self, IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col, float rounding, int rounding_corners);
public abstract Vector2 ImDrawList_GetClipRectMax(ImDrawList *self);
public abstract void ImDrawList_PrimWriteVtx(ImDrawList *self, Vector2 pos, Vector2 uv, uint col);
public abstract void ImDrawList_AddPolyline(ImDrawList *self, Vector2 *points, int num_points, uint col, byte closed, float thickness);
public abstract void ImDrawList_ImDrawList(ImDrawList *self, IntPtr shared_data);
public abstract void ImDrawList_PopTextureID(ImDrawList *self);
public abstract void ImDrawList_AddLine(ImDrawList *self, Vector2 a, Vector2 b, uint col, float thickness);
public abstract void ImFont_RenderText(ImFont *self, ImDrawList *draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, byte *text_begin, byte *text_end, float wrap_width, byte cpu_fine_clip);
public abstract void ImDrawList_PopClipRect(ImDrawList *self);
public abstract void ImDrawList_PrimQuadUV(ImDrawList *self, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c, Vector2 uv_d, uint col);
public abstract void ImDrawList_PushClipRect(ImDrawList *self, Vector2 clip_rect_min, Vector2 clip_rect_max, byte intersect_with_current_clip_rect);
public abstract void ImDrawList_PathClear(ImDrawList *self);
public abstract void ImDrawList_PrimWriteIdx(ImDrawList *self, ushort idx);
public abstract void ImDrawList_PushClipRectFullScreen(ImDrawList *self);
public void RenderChar(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, ushort c) { ImDrawList *native_draw_list = draw_list.NativePtr; ImGuiNative.ImFont_RenderChar(NativePtr, native_draw_list, size, pos, col, c); }
public abstract void ImDrawList_ChannelsMerge(ImDrawList *self);
public static void SetDrawlist(ImDrawListPtr drawlist) { ImDrawList *native_drawlist = drawlist.NativePtr; ImGuizmoNative.ImGuizmo_SetDrawlist(native_drawlist); }
public abstract void ImDrawList_PathLineTo(ImDrawList *self, Vector2 pos);
public static unsafe void AddDrawListImage(ImDrawList *list, Texture texture, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col) { AddTexture(texture); ImGuiNative.ImDrawList_AddImage(list, texture.GetNativeTexturePtr(), a, b, uv_a, uv_b, col); }
public abstract void ImDrawList_PrimRectUV(ImDrawList *self, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col);
public ImDrawListPtr(ImDrawList *nativePtr) => NativePtr = nativePtr;
public abstract void ImDrawList_PrimReserve(ImDrawList *self, int idx_count, int vtx_count);