private void Update(int bufferIndex, TimeSpan elapsed)
        {
            renderHandle[bufferIndex].WaitOne();

            //Update
            RotationInfo rotationInfo = RubikManager.GetRotationInfo();

            if (rotationInfo.Rotating)
            {
                double rotationStep = (double)rotationInfo.Target / (double)((double)(rotationInfo.Milliseconds / 1000.0) * (double)(Fps));

                RubikManager.RubikCube.LayerRotation[RubikManager.rotationLayer] += rotationStep;
                if ((rotationInfo.Target > 0 && RubikManager.RubikCube.LayerRotation[rotationInfo.Layer] >= rotationInfo.Target) || (rotationInfo.Target < 0 && RubikManager.RubikCube.LayerRotation[rotationInfo.Layer] <= rotationInfo.Target))
                {
                    RubikManager.resetFlags(true);
                }
            }
            RenderInfo newRenderInfo = RubikManager.RubikCube.GetRenderInfo(screen, scale);

            buffer[bufferIndex] = newRenderInfo;

            updateHandle[bufferIndex].Set();
        }
Exemplo n.º 2
0
 public RenderEventArgs(RenderInfo renderInfo)
 {
     RenderInfo = renderInfo;
 }