Exemplo n.º 1
0
        public static AlphaTestEffect GetAlphaTestEffect(this IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            throw new ArgumentNullException("graphicsService");

              const string key = "__WrappedAlphaTestEffect";
              object effect;
              graphicsService.Data.TryGetValue(key, out effect);
              var instance = effect as WrappedAlphaTestEffect;
              if (instance == null)
              {
            instance = new WrappedAlphaTestEffect(graphicsService.GraphicsDevice);
            graphicsService.Data[key] = instance;
              }
              return instance;
        }
Exemplo n.º 2
0
        public static AlphaTestEffect GetAlphaTestEffect(this IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            {
                throw new ArgumentNullException("graphicsService");
            }

            const string key = "__WrappedAlphaTestEffect";
            object       effect;

            graphicsService.Data.TryGetValue(key, out effect);
            var instance = effect as WrappedAlphaTestEffect;

            if (instance == null)
            {
                instance = new WrappedAlphaTestEffect(graphicsService.GraphicsDevice);
                graphicsService.Data[key] = instance;
            }
            return(instance);
        }