コード例 #1
0
ファイル: Native.cs プロジェクト: TheBerkin/StdPaint
 public static extern bool WriteConsoleOutput(
     IntPtr handle,
     [MarshalAs(UnmanagedType.LPArray), In]
     BufferUnitInfo[,] lpBuffer,
     COORD dwBufferSize,
     COORD dwBufferCoord, 
     ref SMALL_RECT lpWriteRegion);
コード例 #2
0
ファイル: Painter.cs プロジェクト: TheBerkin/StdPaint
 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();
     }
 }