Esempio n. 1
0
        private void InputHandler_WindowEvent(InputCallbackEventArg eventArg)
        {
            switch (eventArg.CallbackType)
            {
            case InputCallbackType.WindowClose:
                if (_allowClose)
                {
                    if (_handleClose)
                    {
                        ForceStop();
                    }
                    else
                    {
                        OnWindowClose?.Invoke(new GameEngineEventArgs()
                        {
                            EventType = GameEngineEventType.WindowClose
                        });
                    }
                }
                break;

            case InputCallbackType.FocusGained:
                if (_vBackend == VideoBackend.OpenGL || _vBackend == VideoBackend.OpenGL_ES || _vBackend == VideoBackend.OpenGL_ES2)
                {
                    _resource.RebuildTextures();
                }
                break;
            }
        }
Esempio n. 2
0
 private void _input_EngineEvent(InputCallbackEventArg eventArg)
 {
     switch (eventArg.CallbackType)
     {
     case InputCallbackType.RenderDeviceReset:
         _resource.RebuildTextures();
         break;
     }
 }