Esempio n. 1
0
        public GameEngine(EngineMode mode = EngineMode.Synchronous, VideoBackend backend = VideoBackend.Auto)
        {
            ResourcesLoaded = false;
            Properties      = new EngineProperties();
            _resource       = new ResourceManager(IntPtr.Zero); //I don't know if this would work.
            _audio          = new AudioEngine(_resource);

            if (!IsRenderDriverAvailable(backend))
            {
                Debug.Log("GameEngine.GameEngine()", $"Render Driver '{BackendToString(backend)}' is not available. Switched to software fallback.");
                backend = VideoBackend.Software;
            }

            _graphics = new GraphicsEngine(backend);
            _input    = new InputManager();
            _scenes   = new SceneManager();
            _vBackend = backend;

            _input.WindowEvent += InputHandler_WindowEvent;
            _input.EngineEvent += _input_EngineEvent;
        }
Esempio n. 2
0
        public GameEngine(EngineMode mode = EngineMode.Synchronous, VideoBackend backend = VideoBackend.Auto)
        {
            SDL_SetHint(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1");
            // 48px = 1 meter
            ConvertUnits.SetDisplayUnitToSimUnitRatio(48f);
            ResourcesLoaded = false;
            Properties      = new EngineProperties();
            _resource       = new ResourceManager();
            _audio          = new AudioEngine(_resource);

            if (!IsRenderDriverAvailable(backend))
            {
                Debug.Log("GameEngine.GameEngine()", $"Render Driver '{BackendToString(backend)}' is not available. Switched to software fallback.");
                backend = VideoBackend.Software;
            }

            _graphics = new GraphicsEngine(backend);
            _input    = new InputManager();
            _scenes   = new SceneManager();
            _vBackend = backend;

            _input.WindowEvent += InputHandler_WindowEvent;
            _input.EngineEvent += _input_EngineEvent;
        }