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

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

            const string key = "__WrappedEnvironmentMapEffect";
            object       effect;

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

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