using System.IO; namespace Kav { internal class Resources { public static byte[] DeferredPBR_AmbientLightEffect { get { if (ambientLightEffect == null) { ambientLightEffect = GetResource("DeferredPBR_AmbientLightEffect.fxb"); } return ambientLightEffect; } } public static byte[] DeferredPBR_PointLightEffect { get { if (pointLightEffect == null) { pointLightEffect = GetResource("DeferredPBR_PointLightEffect.fxb"); } return pointLightEffect; } } public static byte[] DeferredPBR_DirectionalLightEffect { get { if (directionalLightEffect == null) { directionalLightEffect = GetResource("DeferredPBR_DirectionalLightEffect.fxb"); } return directionalLightEffect; } } public static byte[] DeferredPBR_GBufferEffect { get { if (gBufferEffect == null) { gBufferEffect = GetResource("DeferredPBR_GBufferEffect.fxb"); } return gBufferEffect; } } public static byte[] ToneMapEffect { get { if (toneMapEffect == null) { toneMapEffect = GetResource("ToneMapEffect.fxb"); } return toneMapEffect; } } public static byte[] Deferred_ToonEffect { get { if (deferredToonEffect == null) { deferredToonEffect = GetResource("Deferred_ToonEffect.fxb"); } return deferredToonEffect; } } public static byte[] DeferredPBREffect { get { if (deferredPBREffect == null) { deferredPBREffect = GetResource("DeferredPBREffect.fxb"); } return deferredPBREffect; } } public static byte[] PBREffect { get { if (pbrEffect == null) { pbrEffect = GetResource("PBREffect.fxb"); } return pbrEffect; } } public static byte[] SimpleDepthEffect { get { if (simpleDepthEffect == null) { simpleDepthEffect = GetResource("SimpleDepthEffect.fxb"); } return simpleDepthEffect; } } public static byte[] SkyboxEffect { get { if (skyboxEffect == null) { skyboxEffect = GetResource("SkyboxEffect.fxb"); } return skyboxEffect; } } public static byte[] UnitCubeModel { get { if (unitCubeModel == null) { unitCubeModel = GetResource("UnitCube.glb"); } return unitCubeModel; } } private static byte[] ambientLightEffect; private static byte[] pointLightEffect; private static byte[] directionalLightEffect; private static byte[] gBufferEffect; private static byte[] toneMapEffect; private static byte[] deferredToonEffect; private static byte[] deferredPBREffect; private static byte[] pbrEffect; private static byte[] simpleDepthEffect; private static byte[] skyboxEffect; private static byte[] unitCubeModel; private static byte[] GetResource(string name) { Stream stream = typeof(Resources).Assembly.GetManifestResourceStream( "Kav.Resources." + name ); using (MemoryStream ms = new MemoryStream()) { stream.CopyTo(ms); return ms.ToArray(); } } } }