UrhoConsole.cs 583 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Urho
  4. {
  5. partial class UrhoConsole
  6. {
  7. [DllImport(Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  8. internal static extern void Console_OpenConsoleWindow();
  9. [DllImport(Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  10. internal static extern IntPtr Console_GetConsoleInput();
  11. public static void OpenConsoleWindow()
  12. {
  13. Console_OpenConsoleWindow();
  14. }
  15. public static string GetConsoleInput()
  16. {
  17. return Marshal.PtrToStringAnsi(Console_GetConsoleInput());
  18. }
  19. }
  20. }