示例#1
0
        public static void Build_RightPolygon(RightPolygonData cicle, double heightScale, AnimationData param)
        {
            var    points = new SDL.SDL_Point[cicle.N];
            double omega  = Math.PI * 2 / cicle.N;
            int    i;

            for (i = 0; i < cicle.N; i++)
            {
                points[i].x = (int)Math.Floor((cicle.X0 + cicle.R * Math.Cos(omega * i + cicle.Phi)) * heightScale + param.CiclOffsetX);
                points[i].y = (int)Math.Floor((cicle.Y0 - cicle.R * Math.Sin(omega * i + cicle.Phi)) * heightScale + param.CiclOffSetY);
            }

            cicle.Points = points;
        }
示例#2
0
        private void SdlWorker()
        {
            OnInit();

            int clippingWindowWidth  = SCREEN_WIDTH - 100;
            int clippingWindowHeight = SCREEN_HEIGHT - 25;

            mouseClicked = false;
            fi           = 0;

            clippingWindow = new RectangleData(50, 50, clippingWindowWidth, clippingWindowHeight);
            cicle          = new RightPolygonData(100, clippingWindow.X0 + 100, clippingWindow.Y0 + 100, 50, 0.4);
            rectangle      = new RectangleData(clippingWindow.X0 + 400, clippingWindow.Y0 + 200, 200, 70);
            animParams     = new AnimationData();

            OnLoop();

            OnCleanup();
        }