Exemple #1
0
        public static void InitDraw()
        {
            switch (CConfig.Renderer)
            {
            case ERenderer.TR_CONFIG_SOFTWARE:
                _Draw = new CDrawWinForm();
                break;

            case ERenderer.TR_CONFIG_OPENGL:
                try
                {
                    _Draw = new COpenGL();
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message + " - Error in initializing of OpenGL. Please check whether" +
                                    " your graphic card drivers are up to date.");
                    CLog.LogError(e.Message + " - Error in initializing of OpenGL. Please check whether" +
                                  " your graphic card drivers are up to date.");
                    Environment.Exit(Environment.ExitCode);
                }
                break;

#if WIN
            case ERenderer.TR_CONFIG_DIRECT3D:
                try
                {
                    _Draw = new CDirect3D();
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message + " - Error in initializing of Direct3D. Please check if " +
                                    "your DirectX redistributables and graphic card drivers are up to date. You can " +
                                    "download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109",
                                    CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    CLog.LogError(e.Message + " - Error in initializing of Direct3D. Please check if " +
                                  "your DirectX redistributables and graphic card drivers are up to date. You can " +
                                  "download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109");
                    Environment.Exit(Environment.ExitCode);
                }
                break;
#endif

            default:
                _Draw = new CDrawWinForm();
                break;
            }
            _Draw.Init();
        }
Exemple #2
0
        public static void InitDraw()
        {
            switch (CConfig.Renderer)
            {
                case ERenderer.TR_CONFIG_SOFTWARE:
                    _Draw = new CDrawWinForm();
                    break;

                case ERenderer.TR_CONFIG_OPENGL:
                    try
                    {
                        _Draw = new COpenGL();
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(e.Message + " - Error in initializing of OpenGL. Please check whether" +
                            " your graphic card drivers are up to date.");
                        CLog.LogError(e.Message + " - Error in initializing of OpenGL. Please check whether" +
                            " your graphic card drivers are up to date.");
                        Environment.Exit(Environment.ExitCode);
                    }
                    break;

#if WIN
                case ERenderer.TR_CONFIG_DIRECT3D:
                    try
                    {
                        _Draw = new CDirect3D();
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(e.Message + " - Error in initializing of Direct3D. Please check if " +
                            "your DirectX redistributables and graphic card drivers are up to date. You can " +
                            "download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109",
                    CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        CLog.LogError(e.Message + " - Error in initializing of Direct3D. Please check if " +
                            "your DirectX redistributables and graphic card drivers are up to date. You can " +
                            "download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109");
                        Environment.Exit(Environment.ExitCode);
                    }
                    break;
#endif

                default:
                    _Draw = new CDrawWinForm();
                    break;
            }
            _Draw.Init();
        }
Exemple #3
0
        /// <summary>
        ///     Initializes the Driver selected in the config
        /// </summary>
        /// <returns></returns>
        public static bool Init()
        {
            if (_Draw != null)
            {
                return(false);
            }
            switch (CConfig.Config.Graphics.Renderer)
            {
            case ERenderer.TR_CONFIG_SOFTWARE:
                _Draw = new CDrawWinForm();
                break;

            case ERenderer.TR_CONFIG_OPENGL:
                try
                {
                    _Draw = new COpenGL();
                }
                catch (Exception e)
                {
                    CLog.LogError(e.Message + " - Error in initializing of OpenGL. Please check whether" +
                                  " your graphic card drivers are up to date.", true, true);
                    return(false);
                }
                break;

#if WIN
            case ERenderer.TR_CONFIG_DIRECT3D:
                try
                {
                    _Draw = new CDirect3D();
                }
                catch (Exception e)
                {
                    CLog.LogError(e.Message + " - Error in initializing of Direct3D. Please check if " +
                                  "your DirectX redistributables and graphic card drivers are up to date. You can " +
                                  "download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109", true, true);
                    return(false);
                }
                break;
#endif

            default:
                _Draw = new CDrawWinForm();
                break;
            }
            return(_Draw.Init());
        }
Exemple #4
0
        public static void InitDraw()
        {
            switch (CConfig.Renderer)
            {
                case ERenderer.TR_CONFIG_SOFTWARE:
                    _Draw = new CDrawWinForm();
                    break;
                case ERenderer.TR_CONFIG_OPENGL:
                    _Draw = new COpenGL();
                    break;
                case ERenderer.TR_CONFIG_DIRECT3D:
                    _Draw = new CDirect3D();
                    break;

                default:
                    _Draw = new CDrawWinForm();
                    break;
            }
            _Draw.Init();
        }