Ejemplo n.º 1
0
        /// <summary>
        /// Refresh data from render (visible objects, render messages)
        /// </summary>
        public void BeforeUpdate()
        {
            using (m_lock.Acquire())
            {
                m_outputVisibleObjects.RefreshRead();

                // TODO: OP! This is wrong sync, but it's enough for existing output messages (we can get only half of these messages and second half next frame)
                m_outputRenderMessages.Commit();
            }
        }
Ejemplo n.º 2
0
 public MyUpdateFrame GetRenderFrame(out bool isPreFrame)
 {
     using (m_lock.Acquire())
     {
         MyUpdateFrame result = m_inputRenderMessages.GetRenderFrame(out isPreFrame);
         if (!isPreFrame)
         {
             m_inputBillboards.RefreshRead();
             m_inputTriangleBillboards.RefreshRead();
         }
         return(result);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Updates the Output Frame data using data from the video stream. Call this in Game.Update().
 /// </summary>
 public void Update()
 {
     //using (MyRenderStats.Measure("VideoUpdate-CopyTexture", MyStatTypeEnum.Max))
     {
         // Set video data into the Output Frame
         if (m_videoDataRgba.RefreshRead())
         {
         }
         // now for some reason after changing to fullscreen it's not refreshed, so we will always call it
         {
             OnFrame(m_videoDataRgba.Read);
         }
         // Update current position read-out
         m_mediaSeeking.GetCurrentPosition(out currentPosition);
         if (currentPosition >= videoDuration)
         {
             currentState = VideoState.Stopped;
         }
     }
 }