Skip to content

Commit

Permalink
Add conditional compilation to fix Mono build
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBombSquad committed Apr 8, 2023
1 parent c3fffa3 commit f9a791d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GxUtils/GxModelViewer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ namespace GxModelViewer

class MainClass
{
#if !__MonoCS__
[DllImport("kernel32.dll")]
private static extern IntPtr GetConsoleWindow();

[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
#endif

private const int SW_HIDE = 0;
private const int SW_SHOW = 5;
Expand Down Expand Up @@ -50,8 +52,10 @@ public static void Main (string[] args)

if (args.Length == 0)
{
#if !__MonoCS__
var handle = GetConsoleWindow();
ShowWindow(handle, SW_HIDE);
#endif
Application.Run(modelViewer);
}
else
Expand Down

0 comments on commit f9a791d

Please sign in to comment.