コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: ImNode.cs プロジェクト: tesfabpel/BurningKnight
        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);
        }
コード例 #3
0
 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);
コード例 #4
0
 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);
 }
コード例 #5
0
ファイル: ImGuizmo.gen.cs プロジェクト: Zexyp/CrossEngine
        public static void SetDrawlist()
        {
            ImDrawList *drawlist = null;

            ImGuizmoNative.ImGuizmo_SetDrawlist(drawlist);
        }
コード例 #6
0
 public static extern void ImGuizmo_SetDrawlist(ImDrawList *drawlist);
コード例 #7
0
 public abstract void ImDrawList_PathBezierCurveTo(ImDrawList *self, Vector2 p1, Vector2 p2, Vector2 p3, int num_segments);
コード例 #8
0
 public abstract void ImFont_RenderChar(ImFont *self, ImDrawList *draw_list, float size, Vector2 pos, uint col, ushort c);
コード例 #9
0
 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);
コード例 #10
0
 public abstract Vector2 ImDrawList_GetClipRectMax(ImDrawList *self);
コード例 #11
0
 public abstract void ImDrawList_PrimWriteVtx(ImDrawList *self, Vector2 pos, Vector2 uv, uint col);
コード例 #12
0
 public abstract void ImDrawList_AddPolyline(ImDrawList *self, Vector2 *points, int num_points, uint col, byte closed, float thickness);
コード例 #13
0
 public abstract void ImDrawList_ImDrawList(ImDrawList *self, IntPtr shared_data);
コード例 #14
0
 public abstract void ImDrawList_PopTextureID(ImDrawList *self);
コード例 #15
0
 public abstract void ImDrawList_AddLine(ImDrawList *self, Vector2 a, Vector2 b, uint col, float thickness);
コード例 #16
0
 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);
コード例 #17
0
 public abstract void ImDrawList_PopClipRect(ImDrawList *self);
コード例 #18
0
 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);
コード例 #19
0
 public abstract void ImDrawList_PushClipRect(ImDrawList *self, Vector2 clip_rect_min, Vector2 clip_rect_max, byte intersect_with_current_clip_rect);
コード例 #20
0
 public abstract void ImDrawList_PathClear(ImDrawList *self);
コード例 #21
0
 public abstract void ImDrawList_PrimWriteIdx(ImDrawList *self, ushort idx);
コード例 #22
0
 public abstract void ImDrawList_PushClipRectFullScreen(ImDrawList *self);
コード例 #23
0
ファイル: ImFont.gen.cs プロジェクト: ShadowBrian/7DFPS
        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);
        }
コード例 #24
0
 public abstract void ImDrawList_ChannelsMerge(ImDrawList *self);
コード例 #25
0
ファイル: ImGuizmo.gen.cs プロジェクト: Zexyp/CrossEngine
        public static void SetDrawlist(ImDrawListPtr drawlist)
        {
            ImDrawList *native_drawlist = drawlist.NativePtr;

            ImGuizmoNative.ImGuizmo_SetDrawlist(native_drawlist);
        }
コード例 #26
0
 public abstract void ImDrawList_PathLineTo(ImDrawList *self, Vector2 pos);
コード例 #27
0
 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);
 }
コード例 #28
0
 public abstract void ImDrawList_PrimRectUV(ImDrawList *self, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col);
コード例 #29
0
 public ImDrawListPtr(ImDrawList *nativePtr) => NativePtr = nativePtr;
コード例 #30
0
 public abstract void ImDrawList_PrimReserve(ImDrawList *self, int idx_count, int vtx_count);