コード例 #1
0
        /// <summary>
        /// Parameterless constructor.
        /// Initializes references and identifies the run mode.
        /// </summary>
        public Core()
        {
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            Application.ThreadException        += new ThreadExceptionEventHandler(UIThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException);
            ctorParams = new object[] { this };

#if DEBUG
            runMode = RunMode.Debug;
#else
            runMode = RunMode.Release;
#endif

            Atmosphere        = new TVAtmosphere();
            CameraFactory     = new TVCameraFactory();
            Globals           = new TVGlobals();
            InputEngine       = new TVInputEngine();
            InternalObjects   = new TVInternalObjects();
            LightEngine       = new TVLightEngine();
            MathLibrary       = new TVMathLibrary();
            Physics           = new TVPhysics();
            Scene             = new TVScene();
            Screen2DImmediate = new TVScreen2DImmediate();
            Screen2DText      = new TVScreen2DText();
            TextureFactory    = new TVTextureFactory();
            MaterialFactory   = new TVMaterialFactory();
            GameControllers   = new TVGameControllers();
            DeviceInfo        = new TVDeviceInfo();
            GraphicEffect     = new TVGraphicEffect();
        }
コード例 #2
0
        /// <summary>
        /// Gets the available video modes.
        /// </summary>
        /// <returns></returns>
        public static List <TV_MODEFORMAT> GetAvailableVideoModes()
        {
            var modes      = new List <TV_MODEFORMAT>();
            var deviceInfo = new TVDeviceInfo();

            for (int i = 0; i < deviceInfo.GetDisplayModeCount(); i++)
            {
                TV_MODEFORMAT mode = deviceInfo.GetDisplayMode(i);
                if (mode.Format == 32 && !modes.Any(m => m.Width == mode.Width && m.Height == mode.Height))
                {
                    modes.Add(mode);
                }
            }
            modes.Sort((a, b) => ((b.Width - a.Width) << 16) + b.Height - a.Height);

            return(modes);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: zulis/Cubica
        protected override void Initialize()
        {
            ContentRoot = Path.Combine(Application.StartupPath, "Data");
            Settings.RenderForm.Text = "Cubica";
            var deviceInfo = new TVDeviceInfo();
            Engine.SetAngleSystem(CONST_TV_ANGLE.TV_ANGLE_DEGREE);
            Scene.SetViewFrustum(65f, 2000f);

            CreateAndLoadComponent<DebuggingBag>();
            //CreateAndLoadComponent<ScriptManager>();
            CreateAndLoadComponent<Keyboard>();
            CreateAndLoadComponent<Mouse>();
            CreateAndLoadComponent<JoyStick>();
            CreateAndLoadComponent<Gamepads>();
            //CreateAndLoadComponent<PersistentThreadPool>();
            //CreateAndLoadComponent<SoundPlayer>();
            //CreateAndLoadComponent<GameManager>();

            base.Initialize();
        }
コード例 #4
0
        protected override void Initialize()
        {
            ContentRoot = Path.Combine(Application.StartupPath, "Data");
            Settings.RenderForm.Text = "Cubica";
            var deviceInfo = new TVDeviceInfo();

            Engine.SetAngleSystem(CONST_TV_ANGLE.TV_ANGLE_DEGREE);
            Scene.SetViewFrustum(65f, 2000f);

            CreateAndLoadComponent <DebuggingBag>();
            //CreateAndLoadComponent<ScriptManager>();
            CreateAndLoadComponent <Keyboard>();
            CreateAndLoadComponent <Mouse>();
            CreateAndLoadComponent <JoyStick>();
            CreateAndLoadComponent <Gamepads>();
            //CreateAndLoadComponent<PersistentThreadPool>();
            //CreateAndLoadComponent<SoundPlayer>();
            //CreateAndLoadComponent<GameManager>();

            base.Initialize();
        }