/// <summary> /// Initializes pool /// </summary> /// <param name="graphics">Device</param> public static void Initialize(Graphics graphics) { EffectNull = CreateEffect <EffectNull>(graphics, Resources.ShaderNullFxo, Resources.ShaderNullFx); EffectDefaultSprite = CreateEffect <EffectDefaultSprite>(graphics, Resources.ShaderDefaultSpriteFxo, Resources.ShaderDefaultSpriteFxo); EffectDefaultFont = CreateEffect <EffectDefaultFont>(graphics, Resources.ShaderDefaultFontFxo, Resources.ShaderDefaultFontFxo); EffectDefaultCubemap = CreateEffect <EffectDefaultCubemap>(graphics, Resources.ShaderDefaultCubemapFxo, Resources.ShaderDefaultCubemapFx); EffectDefaultBillboard = CreateEffect <EffectDefaultBillboard>(graphics, Resources.ShaderDefaultBillboardFxo, Resources.ShaderDefaultBillboardFx); EffectDefaultFoliage = CreateEffect <EffectDefaultFoliage>(graphics, Resources.ShaderDefaultFoliageFxo, Resources.ShaderDefaultFoliageFx); EffectDefaultClouds = CreateEffect <EffectDefaultClouds>(graphics, Resources.ShaderDefaultCloudsFxo, Resources.ShaderDefaultCloudsFx); EffectDefaultBasic = CreateEffect <EffectDefaultBasic>(graphics, Resources.ShaderDefaultBasicFxo, Resources.ShaderDefaultBasicFx); EffectDefaultTerrain = CreateEffect <EffectDefaultTerrain>(graphics, Resources.ShaderDefaultTerrainFxo, Resources.ShaderDefaultTerrainFx); EffectDefaultSkyScattering = CreateEffect <EffectDefaultSkyScattering>(graphics, Resources.ShaderDefaultSkyScatteringFxo, Resources.ShaderDefaultSkyScatteringFx); EffectDefaultCPUParticles = CreateEffect <EffectDefaultCpuParticles>(graphics, Resources.ShaderDefaultCPUParticlesFxo, Resources.ShaderDefaultCPUParticlesFx); EffectDefaultGPUParticles = CreateEffect <EffectDefaultGpuParticles>(graphics, Resources.ShaderDefaultGPUParticlesFxo, Resources.ShaderDefaultGPUParticlesFx); EffectDefaultWater = CreateEffect <EffectDefaultWater>(graphics, Resources.ShaderDefaultWaterFxo, Resources.ShaderDefaultWaterFx); EffectDeferredComposer = CreateEffect <EffectDeferredComposer>(graphics, Resources.ShaderDeferredComposerFxo, Resources.ShaderDeferredComposerFx); EffectDeferredBasic = CreateEffect <EffectDeferredBasic>(graphics, Resources.ShaderDeferredBasicFxo, Resources.ShaderDeferredBasicFxo); EffectDeferredTerrain = CreateEffect <EffectDeferredTerrain>(graphics, Resources.ShaderDeferredTerrainFxo, Resources.ShaderDeferredTerrainFx); EffectShadowBillboard = CreateEffect <EffectShadowBillboard>(graphics, Resources.ShaderShadowBillboardFxo, Resources.ShaderShadowBillboardFx); EffectShadowFoliage = CreateEffect <EffectShadowFoliage>(graphics, Resources.ShaderShadowFoliageFxo, Resources.ShaderShadowFoliageFx); EffectShadowBasic = CreateEffect <EffectShadowBasic>(graphics, Resources.ShaderShadowBasicFxo, Resources.ShaderShadowBasicFx); EffectShadowTerrain = CreateEffect <EffectShadowTerrain>(graphics, Resources.ShaderShadowTerrainFxo, Resources.ShaderShadowTerrainFx); EffectShadowPoint = CreateEffect <EffectShadowPoint>(graphics, Resources.ShaderShadowPointFxo, Resources.ShaderShadowPointFx); EffectShadowCascade = CreateEffect <EffectShadowCascade>(graphics, Resources.ShaderShadowCascadeFxo, Resources.ShaderShadowCascadeFx); EffectPostBlur = CreateEffect <EffectPostBlur>(graphics, Resources.ShaderPostBlurFxo, Resources.ShaderPostBlurFx); }
/// <summary> /// Dispose of used resources /// </summary> public static void DisposeResources() { EffectNull?.Dispose(); EffectNull = null; EffectDefaultSprite?.Dispose(); EffectDefaultSprite = null; EffectDefaultFont?.Dispose(); EffectDefaultFont = null; EffectDefaultCubemap?.Dispose(); EffectDefaultCubemap = null; EffectDefaultBillboard?.Dispose(); EffectDefaultBillboard = null; EffectDefaultFoliage?.Dispose(); EffectDefaultFoliage = null; EffectDefaultClouds?.Dispose(); EffectDefaultClouds = null; EffectDefaultBasic?.Dispose(); EffectDefaultBasic = null; EffectDefaultTerrain?.Dispose(); EffectDefaultTerrain = null; EffectDefaultSkyScattering?.Dispose(); EffectDefaultSkyScattering = null; EffectDefaultCPUParticles?.Dispose(); EffectDefaultCPUParticles = null; EffectDefaultGPUParticles?.Dispose(); EffectDefaultGPUParticles = null; EffectDefaultWater?.Dispose(); EffectDefaultWater = null; EffectDeferredComposer?.Dispose(); EffectDeferredComposer = null; EffectDeferredBasic?.Dispose(); EffectDeferredBasic = null; EffectDeferredTerrain?.Dispose(); EffectDeferredTerrain = null; EffectShadowBillboard?.Dispose(); EffectShadowBillboard = null; EffectShadowFoliage?.Dispose(); EffectShadowFoliage = null; EffectShadowBasic?.Dispose(); EffectShadowBasic = null; EffectShadowTerrain?.Dispose(); EffectShadowTerrain = null; EffectShadowPoint?.Dispose(); EffectShadowPoint = null; EffectShadowCascade?.Dispose(); EffectShadowCascade = null; EffectPostBlur?.Dispose(); EffectPostBlur = null; }