Esempio n. 1
0
 public void Mainloop(float deltatime)
 {
     OnMainLoopBegin?.Invoke(this, EventArgs.Empty);
     Dethklok.Mainloop(deltatime);
     Age.Mainloop(deltatime);
     OnMainLoopEnd?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 2
0
 public virtual void Mainloop(float deltatime)
 {
     OnMainLoopBegin?.Invoke(this, EventArgs.Empty);
     AgeFrames++;
     ExpireFrames++;
     OnMainLoopEnd?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 3
0
        /// <inheritdoc />
        public void Mainloop(float deltatime)
        {
            OnMainLoopBegin?.Invoke(this, EventArgs.Empty);
            var touchsrc     = Options.IncludeHitting ? AttachedElement.Hitting : AttachedElement.Touching.Where(kvp => kvp.Value != null);
            var inputtouches = touchsrc.Select(kvp =>
            {
                switch (Options.TouchSpaceSource)
                {
                case SubContextOptions.IntersectionSpaceSelection.FromElementSpace:
                    return(kvp.Value.ElementSpace.xy(), kvp.Key.Id, kvp.Key.Force);

                case SubContextOptions.IntersectionSpaceSelection.FromSurfaceSpace:
                    return(kvp.Value.SurfaceSpace.xy(), kvp.Key.Id, kvp.Key.Force);

                default:
                    return(kvp.Value.SurfaceSpace.xy(), kvp.Key.Id, kvp.Key.Force);
                }
            });

            Context.SubmitTouches(inputtouches);
            Context.Mainloop(ParentContext.DeltaTime);

            if (ParentContext.AttachableMouse != null && ParentContext.MouseDelta != null)
            {
                if (Context.Touches.ContainsKey(ParentContext.MouseTouchId))
                {
                    Context.Touches.TryGetValue(ParentContext.MouseTouchId, out var mouseTouch);
                    if (mouseTouch != null && (mouseTouch.AttachadMouse == null || mouseTouch.MouseDelta == null))
                    {
                        mouseTouch.AttachMouse(ParentContext.AttachableMouse, ParentContext.MouseDelta);
                    }
                }
            }

            OnMainLoopEnd?.Invoke(this, EventArgs.Empty);
        }
Esempio n. 4
0
 /// <inheritdoc cref="IMainlooping"/>
 public void Mainloop(float deltatime)
 {
     OnMainLoopBegin?.Invoke(this, EventArgs.Empty);
     _scheduler.Mainloop();
     OnMainLoopEnd?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 5
0
 /// <inheritdoc cref="IMainlooping"/>
 public void Mainloop(float deltatime)
 {
     OnMainLoopBegin?.Invoke(this, EventArgs.Empty);
     ResetAccumulation();
     OnMainLoopEnd?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 6
0
        public void Mainloop(float deltatime)
        {
            OnMainLoopBegin?.Invoke(this, EventArgs.Empty);
            if (Closed)
            {
                return;
            }

            if (CreatedFrame)
            {
                CreatedFrame = false;
            }
            if (_browserReadyFrame)
            {
                OnBrowserReady?.Invoke(this, EventArgs.Empty);
                CreatedFrame       = true;
                _browserReadyFrame = false;
            }

            if (Browser == null)
            {
                return;
            }

            if (LoadedFrame)
            {
                LoadedFrame     = false;
                IsDocumentReady = true;
            }
            Loading = Browser.IsLoading;
            if (_loadedFrame)
            {
                LoadedFrame  = true;
                _loadedFrame = false;
            }

            if (_invalidateAccFrame)
            {
                _newAccFrameReady.Clear();
            }

            if (!TextureSettings.Equals(_prevTextureSettings))
            {
                UpdateSize();
            }

            //if (BrowserSettings.ZoomLevel != Browser.Host.ZoomLevel)
            //{
            //    Browser.Host.ZoomLevel = Math.Abs(BrowserSettings.ZoomLevel) <= 0.0001 ? 0.0001 : BrowserSettings.ZoomLevel;
            //    //Browser.Host.ZoomLevel = BrowserSettings.ZoomLevel;
            //}

            Browser.Host.ZoomLevel = BrowserSettings.ZoomLevel;

            if (DocumentSizeBaseSelector != null)
            {
                DocumentSizeBaseSelector.Selector = BrowserSettings.DocumentSizeElementSelector;
            }

            if (LivePageActive != BrowserSettings.UseLivePage)
            {
                ExecuteJavascript(BrowserSettings.UseLivePage ? Globals.LivePageLoader : Globals.LivePageUnloader);
                LivePageActive = BrowserSettings.UseLivePage;
            }

            SubmittedTouches.Clear();

            if (Enabled)
            {
                try
                {
                    Operations?.InvokeRecursive(this);
                }
                catch (Exception e)
                {
                    LogError(e);
                }

                if (InitSettings.FrameRequestFromVvvv && AllowFrameRequest)
                {
                    Browser.Host.SendExternalBeginFrame();
                }
            }

            ProcessTouches();

            _prevTextureSettings = TextureSettings;
            _prevBrowserSettings = BrowserSettings;

            OnMainLoopEnd?.Invoke((object)this, EventArgs.Empty);
        }
Esempio n. 7
0
 /// <inheritdoc cref="IMainlooping"/>
 public void Mainloop(float deltatime)
 {
     OnMainLoopBegin?.Invoke(this, EventArgs.Empty);
     DelayedDeltas.Submit(new Vector4(DeltaPos, DeltaAngle, DeltaSize));
     OnMainLoopEnd?.Invoke(this, EventArgs.Empty);
 }