コード例 #1
0
ファイル: MainForm.cs プロジェクト: MoysheBenRabi/setp
        /// <summary>
        /// All application initialization is performed here, before the main loop thread is executed and the render panel is displayed for the first time.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RenderForm_Load(object sender, EventArgs e)
        {
            LogUtil.Info("MainForm startup begin.");
            try
            {
                //renderPanel.MakeCurrent();
                if (!Horde3DUtils.initOpenGL(GetDC(renderPanel.Handle).ToInt32()))
                {
                    throw new Exception("Failed to initialize OpenGL");
                }

                if (!DeckProgram.DeckRenderer.Startup())
                {
                    MessageBox.Show(
                        "Failed to init application.\nMake sure you have an OpenGL 2.0 compatible graphics card with the latest drivers installed!\nAlso verify if the pipeline config file exists.",
                        "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    h3d.release();
                    Environment.Exit(0);
                }

                LogUtil.Debug("Initial panel size: " + renderPanel.ClientSize.Width + "," + renderPanel.ClientSize.Height);


                //ResizeChildren();
            }
            catch (Exception ex)
            {
                LogUtil.Error("Error in MainForm initialization: " + ex.ToString());
            }
            LogUtil.Info("MainForm startup end.");
        }
コード例 #2
0
        /// <summary>
        /// All application initialization is performed here, before the main loop thread is executed and the render panel is displayed for the first time.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RenderForm_Load(object sender, EventArgs e)
        {
            if (!Horde3DUtils.initOpenGL(GetDC(renderPanel.Handle).ToInt32()))
            {
                throw new Exception("Failed to initialize OpenGL");
            }

            if (!app.init())
            {
                MessageBox.Show("Failed to init application\nMake sure you have an OpenGL 2.0 compatible graphics card with the latest drivers installed!\nAlso verify if the pipeline config file exists.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                h3d.release();
                Horde3DUtils.releaseOpenGL();
                Environment.Exit(0);
            }

            app.resize(renderPanel.Size.Width, renderPanel.Size.Height);
        }