Esempio n. 1
0
        private Texture2d LoadImage(string character, string sprite, ImageType type)
        {
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);

            GL.Enable(EnableCap.DepthTest);
            GL.DepthFunc(DepthFunction.Lequal);

            GL.Enable(EnableCap.Texture2D);
            GL.Enable(EnableCap.AlphaTest);
            GL.AlphaFunc(AlphaFunction.Gequal, 0.5f);

            switch (type)
            {
            case ImageType.Character:
                return(contentManager.LoadTexture(contentManager.GetCharacterImage(character, sprite, GameState.Instance.GetImageFormat())));

            case ImageType.Scene:
                return(contentManager.LoadTexture(contentManager.GetSceneImage(sprite, GameState.Instance.GetImageFormat())));

            default:
                throw new ArgumentOutOfRangeException($"Load Texture for {type} does not exist");
            }
        }