示例#1
0
        public FormsWindow(Settings settings)
            : this(new NativeMessageForm())
        {
            var form = panel as Form;

            if (settings.StartInFullscreen)
            {
                IsFullscreen         = settings.StartInFullscreen;
                form.FormBorderStyle = FormBorderStyle.None;
                form.TopMost         = true;
                form.StartPosition   = FormStartPosition.Manual;
                form.DesktopLocation = new SystemPoint(0, 0);
            }
            else
            {
                form.FormBorderStyle = FormBorderStyle.Sizable;
                form.StartPosition   = FormStartPosition.CenterScreen;
            }
            form.ClientSize = new SystemSize((int)settings.Resolution.Width,
                                             (int)settings.Resolution.Height);
            form.MinimumSize = new SystemSize(1, 1);
            form.Text        = StackTraceExtensions.GetEntryName();
            BackgroundColor  = Color.Black;
            Icon appIcon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            if (appIcon != null)
            {
                form.Icon = appIcon;
            }
            form.SizeChanged += OnSizeChanged;
            form.Show();
        }
示例#2
0
        public GLFW3Window(Settings settings)
        {
            if (!StackTraceExtensions.StartedFromNCrunchOrNunitConsole)
            {
                Glfw.SetErrorCallback(ErrorCallback);
            }
            if (!Glfw.Init())
            {
                throw new UnableToInitializeGLFW();
            }
            if (GetGlfwMajorVersion() < 3)
            {
                throw new UnableToInitializeShadersForGLFW();
            }
            this.settings = settings;
            CreateWindow(settings.Resolution, settings.StartInFullscreen);
            new GLFW3Time();
            Title           = StackTraceExtensions.GetEntryName();
            BackgroundColor = Color.Black;
            hwnd            = GetForegroundWindow();
            Icon appIcon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            if (appIcon != null && hwnd != IntPtr.Zero)
            {
                SetIcon(appIcon);
            }
        }
示例#3
0
 public XnaWindow(Game game)
 {
     this.game                      = game;
     game.Window.Title              = StackTraceExtensions.GetEntryName();
     game.Window.AllowUserResizing  = true;
     game.IsMouseVisible            = true;
     game.Window.ClientSizeChanged += OnViewportSizeChanged;
 }
示例#4
0
 public XnaWindow(Game game)
 {
     this.game = game;
     Title     = StackTraceExtensions.GetEntryName();
     game.Window.AllowUserResizing   = true;
     game.IsMouseVisible             = true;
     game.Window.ClientSizeChanged  += OnViewportSizeChanged;
     game.Window.OrientationChanged +=
         (sender, args) => OnOrientationChanged(GetOrientation(game.Window.CurrentOrientation));
     game.Exiting   += (sender, args) => { IsClosing = true; };
     BackgroundColor = Color.Black;
 }
示例#5
0
        public FormsWindow()
        {
            form = new Form
            {
                Text            = StackTraceExtensions.GetEntryName(),
                Size            = new Size(800, 600),
                FormBorderStyle = FormBorderStyle.Sizable,
                StartPosition   = FormStartPosition.CenterScreen
            };
            Icon appIcon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            if (appIcon != null)
            {
                form.Icon = appIcon;
            }
            form.SizeChanged += OnSizeChanged;
            form.Show();
            closeAfterOneFrameIfInIntegrationTest = !StackTraceExtensions.ContainsNoTestOrIsVisualTest();
        }
示例#6
0
 public void Main()
 {
     // Because this method is named "Main" we will get the namespace name instead!
     Assert.AreEqual("DeltaEngine.Tests.Extensions", StackTraceExtensions.GetEntryName());
 }
示例#7
0
 public void GetEntryName()
 {
     Assert.AreEqual("GetEntryName", StackTraceExtensions.GetEntryName());
 }