Beispiel #1
0
 /// <summary>
 /// Register a thread to be monitored and tracked by this <see cref="GameHost"/>
 /// </summary>
 /// <param name="thread">The thread.</param>
 public void RegisterThread(AppThread thread)
 {
     threads.Add(thread);
     thread.IsActive.BindTo(IsActive);
     thread.UnhandledException = unhandledExceptionHandler;
     thread.Monitor.EnablePerformanceProfiling = performanceLogging.Value;
 }
Beispiel #2
0
        public FrameTimeDisplay(ThrottledFrameClock clock, AppThread thread)
        {
            this.clock  = clock;
            this.thread = thread;

            Masking      = true;
            CornerRadius = 5;

            AddRange(new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Black,
                    Alpha            = 0.75f
                },
                counter = new CounterText
                {
                    Anchor  = Anchor.TopRight,
                    Origin  = Anchor.TopRight,
                    Spacing = new Vector2(-1, 0),
                    Text    = @"...",
                }
            });
        }
Beispiel #3
0
        /// <summary>
        /// Unregister a previously registered thread.<see cref="GameHost"/>
        /// </summary>
        /// <param name="thread">The thread.</param>
        public void UnregisterThread(AppThread thread)
        {
            if (!threads.Remove(thread))
            {
                return;
            }

            IsActive.UnbindFrom(thread.IsActive);
            thread.UnhandledException = null;
        }