Пример #1
0
        public static bool Render()
        {
            graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.0f);
            graphics.Clear();

            uint[] colorTable = { 0xffff0000,
                                  0xff00ff00,
                                  0xff0000ff,
                                  0xffffff00 };

            foreach (var touchData in Touch.GetData(0))
            {
                if (touchData.Status == TouchStatus.Down ||
                    touchData.Status == TouchStatus.Move)
                {
                    int pointX  = (int)((touchData.X + 0.5f) * SampleDraw.Width);
                    int pointY  = (int)((touchData.Y + 0.5f) * SampleDraw.Height);
                    int colorId = touchData.ID % colorTable.Length;

                    SampleDraw.FillCircle(colorTable[colorId], pointX, pointY, 96);
                }
            }

            SampleDraw.DrawText("Touch Sample", 0xffffffff, 0, 0);
            graphics.SwapBuffers();

            return(true);
        }