Example #1
0
 public void Render(TimeSpan elapsedGameTime, TimeSpan totalGameTime)
 {
     try
     {
         _editorHostGame?.Render(totalGameTime, elapsedGameTime);
     }
     finally
     {
         FlushLogs();
     }
 }
Example #2
0
        private void DoDraw(GameTime gameTime)
        {
            /*if (_gameLoader == null || _renderTargetSize == null || !_hasRunGameUpdate)
             * {
             *  return;
             * }*/

            if (_delayAssignSharedResourceHandles)
            {
                _consoleHandle.LogInfo("Delay assigning shared textures from editor for game hosting...");
                _consoleHandle.LogInfo("Shared texture count: " + (_sharedResourceHandles == null ? "<null>" : _sharedResourceHandles.Length.ToString()));
                _consoleHandle.LogInfo("Shared memory mapped filename: " + _sharedMmapName);

                _editorHostGame.SetSharedResourceHandles(_sharedResourceHandles, _sharedMmapName);
                _delayAssignSharedResourceHandles = false;
            }

            if (State != LoadedGameState.Playing)
            {
                return;
            }

            try
            {
                _editorHostGame?.Render(gameTime.TotalGameTime, gameTime.ElapsedGameTime);
            }
            finally
            {
                FlushLogs();
            }

            _editorHostGame?.IncrementWritableTextureIfPossible();

            if (_playingStartTime == null)
            {
                _playingStartTime = DateTime.UtcNow;

                SyncPlaybackStateToEditor();
            }
        }