Пример #1
0
        public static DualTextureEffect GetDualTextureEffect(this IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            throw new ArgumentNullException("graphicsService");

              const string key = "__WrappedDualTextureEffect";
              object effect;
              graphicsService.Data.TryGetValue(key, out effect);
              var instance = effect as WrappedDualTextureEffect;
              if (instance == null)
              {
            instance = new WrappedDualTextureEffect(graphicsService.GraphicsDevice);
            graphicsService.Data[key] = instance;
              }
              return instance;
        }
Пример #2
0
        public static DualTextureEffect GetDualTextureEffect(this IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            {
                throw new ArgumentNullException("graphicsService");
            }

            const string key = "__WrappedDualTextureEffect";
            object       effect;

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

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