Esempio n. 1
0
 public static extern bool WriteConsoleOutput(
     IntPtr handle,
     [MarshalAs(UnmanagedType.LPArray), In]
     BufferUnitInfo[,] lpBuffer,
     COORD dwBufferSize,
     COORD dwBufferCoord, 
     ref SMALL_RECT lpWriteRegion);
Esempio n. 2
0
        private static void GraphicsRenderThread()
        {
            int        w     = Console.BufferWidth;
            int        h     = Console.BufferHeight;
            COORD      cFrom = new COORD(0, 0);
            COORD      cTo   = new COORD((short)w, (short)h);
            SMALL_RECT rect  = new SMALL_RECT(0, 0, (short)w, (short)h);
            var        bb    = backBuffer.Buffer;
            var        fb    = frontBuffer.Buffer;

            while (enabled)
            {
                fpsCounter.Restart();
                Native.WriteConsoleOutput(stdOutHandle, fb, cTo, cFrom, ref rect);
                Thread.Sleep(refreshInterval);
                fpsCounter.Stop();
            }
        }
Esempio n. 3
0
 private static void GraphicsRenderThread()
 {
     int w = Console.BufferWidth;
     int h = Console.BufferHeight;
     COORD cFrom = new COORD(0, 0);
     COORD cTo = new COORD((short)w, (short)h);
     SMALL_RECT rect = new SMALL_RECT(0, 0, (short)w, (short)h);
     var bb = backBuffer.Buffer;
     var fb = frontBuffer.Buffer;
     while (enabled)
     {
         fpsCounter.Restart();
         Native.WriteConsoleOutput(stdOutHandle, fb, cTo, cFrom, ref rect);
         Thread.Sleep(refreshInterval);
         fpsCounter.Stop();
     }
 }