示例#1
0
        public void AfterUpdate(MyTimeSpan?updateTimestamp)
        {
            using (m_lock.Acquire())
            {
                if (updateTimestamp.HasValue)
                {
                    m_inputRenderMessages.CurrentUpdateFrame.UpdateTimestamp = updateTimestamp.Value;
                }

                m_inputRenderMessages.CommitUpdateFrame();
                m_inputBillboards.CommitWrite();
                m_inputBillboards.Write.Clear();
                m_inputTriangleBillboards.CommitWrite();
                m_inputTriangleBillboards.Write.Clear();
            }
        }
示例#2
0
 public void AfterRender()
 {
     using (m_lock.Acquire())
     {
         m_outputVisibleObjects.CommitWrite();
         m_outputVisibleObjects.Write.Clear();
     }
 }
示例#3
0
        public void AfterUpdate(MyRenderSettings inputSettings, MyTimeSpan?updateTimestamp)
        {
            using (m_lock.Acquire())
            {
                if (updateTimestamp.HasValue)
                {
                    m_inputRenderMessages.CurrentUpdateFrame.UpdateTimestamp = updateTimestamp.Value;
                }

                m_inputRenderMessages.CommitUpdateFrame();
                m_inputRenderSettings.Synchronize(inputSettings); // TODO: OP! Better settings synchronization
                m_inputBillboards.CommitWrite();
                m_inputBillboards.Write.Clear();
                m_inputTriangleBillboards.CommitWrite();
                m_inputTriangleBillboards.Write.Clear();
            }
        }
示例#4
0
        /// <summary>
        /// Required public callback from DirectShow SampleGrabber. Do not call this method.
        /// </summary>
        public int BufferCB(double SampleTime, IntPtr pBuffer, int BufferLen)
        {
            //using (MyRenderStats.Measure("Video grab frame", MyStatTypeEnum.Max))
            {
                byte[] write = m_videoDataRgba.Write;
                byte   alpha = alphaTransparency;

                Marshal.Copy(pBuffer, write, 0, BufferLen);

                // This takes around 5ms for 1080p on i5-2500 CPU
                for (int i = 3; i < BufferLen; i += 4)
                {
                    write[i] = alpha;
                }

                m_videoDataRgba.CommitWrite();
            }

            // Return S_OK
            return(0);
        }