Beispiel #1
0
        static void Main()
        {
            PixelManager.Init(640, 480);
            ConnectionManager.Init();

            new PixelflutWindow().Run();
        }
Beispiel #2
0
        private static string execCommand(string v)
        {
            var cmdSplit = v.Split(' ');

            if (string.Equals(cmdSplit[0], "SIZE", StringComparison.OrdinalIgnoreCase))
            {
                // return size
                return($"SIZE {PixelManager.H} {PixelManager.V}\r\n");
            }
            else if (string.Equals(cmdSplit[0], "PX", StringComparison.OrdinalIgnoreCase))
            {
                // set pixel
                var x   = fastIntParse(cmdSplit[1]);
                var y   = fastIntParse(cmdSplit[2]);
                var rgb = Fast.FromHexString(cmdSplit[3]);
                var r   = rgb[0];
                var g   = rgb[1];
                var b   = rgb[2];
                PixelManager.SetPixel(x, y, r, g, b);
                return(string.Empty);
            }
            else
            {
                // send help
                return("This server supports: SIZE, PX.\r\n");
            }
        }