Exemplo n.º 1
0
        public HolofunkForm(bool isSecondaryForm)
        {
            _isSecondaryForm = isSecondaryForm;
            if (!isSecondaryForm)
            {
                _primaryForm = this;
            }

            // Hardcode to 1080p size of Kinect color buffer for now
            Size = new Size(1920, 1080);

            FormClosing += new FormClosingEventHandler(WindowClosing);

            InitializeComponent();

            if (!_isSecondaryForm)
            {
                new Thread(GameThread).Start();

                while (!_gameStarted)
                {
                    Thread.Sleep(10);
                }
            }

            Panel gamePanel = new Panel();
            gamePanel.Bounds = System.Drawing.Rectangle.FromLTRB(0, 0, ClientSize.Width, ClientSize.Height);
            gamePanel.Dock = DockStyle.Fill;
            Controls.Add(gamePanel);

            // set window
            {
                _holofunkGame.Window.IsBorderlessEXT = true;

                SDL.SDL_SysWMinfo info = new SDL.SDL_SysWMinfo();
                SDL.SDL_GetWindowWMInfo(_holofunkGame.Window.Handle, ref info);

                IntPtr winHandle = info.info.win.window;

                SetWindowPos(
                    winHandle,
                    Handle,
                    0,
                    0,
                    0,
                    0,
                    0x0401 // NOSIZE | SHOWWINDOW

                );

                SetParent(winHandle, gamePanel.Handle);

                ShowWindow(winHandle, 1); // SHOWNORMAL
            }
        }
Exemplo n.º 2
0
        public HolofunkGame(HolofunkForm primaryForm)
        {
            m_clock = new Clock(MagicNumbers.InitialBpm, MagicNumbers.BeatsPerMeasure, HolofunkBassAsio.InputChannelCount);
            m_primaryForm = primaryForm;

            // Setup the relative directory to the executable directory
            // for loading contents with the ContentManager
            Content.RootDirectory = "TextureContent";

            m_graphicsDeviceManager = new GraphicsDeviceManager(this);
            //m_graphicsDeviceManager.IsFullScreen = true;
            //m_graphicsDeviceManager.PreferredFullScreenOutputIndex = 0;
            m_graphicsDeviceManager.SynchronizeWithVerticalRetrace = false;

            m_graphicsDeviceManager.PreferredBackBufferWidth = 1920;
            m_graphicsDeviceManager.PreferredBackBufferHeight = 1080;

            m_lastCollectionCounts = new int[GC.MaxGeneration + 1];

            base.IsFixedTimeStep = true;
        }