Exemplo n.º 1
0
        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                #region In-game settings
            case Keys.R:
            {
                break;
            }

            case Keys.M:
            {
                if (EngineStatics.Mode == PrimitiveType.Triangles)
                {
                    EngineStatics.Mode = PrimitiveType.Lines;
                }
                else
                {
                    EngineStatics.Mode = PrimitiveType.Triangles;
                }
                break;
            }

            case Keys.Escape: this.Close(); break;    //Exit

            case Keys.Add:
            {
                GameWorld.GetWorldInstance().GetLevel().Water.GetData().WaveSpeed += 0.1f;
                GameWorld.GetWorldInstance().GetLevel().Water.GetData().WaveStrength += 0.1f;
                break;
            }

            case Keys.Subtract:
            {
                GameWorld.GetWorldInstance().GetLevel().Water.GetData().WaveSpeed -= 0.1f;
                GameWorld.GetWorldInstance().GetLevel().Water.GetData().WaveStrength -= 0.1f;
                break;
            }

            case Keys.Insert:
            {
                GameWorld.GetWorldInstance().GetUiFrameCreator().PushFrame((new ObtainRenderTargetPool().GetPool() as RenderTargetPool).GetRenderTargetAt(renderTargetIndex));
                Int32 count = PoolProxy.GetResourceCountInPool <ObtainRenderTargetPool>();
                if (renderTargetIndex + 1 >= count)
                {
                    renderTargetIndex = 0;
                }
                else
                {
                    ++renderTargetIndex;
                }
                break;
            }
                #endregion
            }
        }