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; }
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); }