コード例 #1
0
        public static bool Begin(string name, ImGuiWindowFlags flags)
        {
            int   utf8NameByteCount = Encoding.UTF8.GetByteCount(name);
            byte *utf8NameBytes;

            if (utf8NameByteCount > Util.StackAllocationSizeLimit)
            {
                utf8NameBytes = Util.Allocate(utf8NameByteCount + 1);
            }
            else
            {
                byte *stackPtr = stackalloc byte[utf8NameByteCount + 1];
                utf8NameBytes = stackPtr;
            }
            Util.GetUtf8(name, utf8NameBytes, utf8NameByteCount);

            byte *p_open = null;
            byte  ret    = ImGuiNative.Begin(utf8NameBytes, p_open, flags);

            if (utf8NameByteCount > Util.StackAllocationSizeLimit)
            {
                Util.Free(utf8NameBytes);
            }

            return(ret != 0);
        }