Kav/Resources.cs

47 lines
1.1 KiB
C#
Raw Normal View History

2020-08-05 03:50:44 +00:00
using System.IO;
namespace Kav
{
internal class Resources
{
public static byte[] PBREffect
{
get
{
if (pbrEffect == null)
{
pbrEffect = GetResource("PBREffect");
}
return pbrEffect;
}
}
2020-08-07 00:58:50 +00:00
public static byte[] SimpleDepthEffect
{
get
{
if (simpleDepthEffect == null)
{
simpleDepthEffect = GetResource("SimpleDepthEffecT");
}
return simpleDepthEffect;
}
}
2020-08-05 03:50:44 +00:00
private static byte[] pbrEffect;
2020-08-07 00:58:50 +00:00
private static byte[] simpleDepthEffect;
2020-08-05 03:50:44 +00:00
private static byte[] GetResource(string name)
{
Stream stream = typeof(Resources).Assembly.GetManifestResourceStream(
2020-08-06 07:10:23 +00:00
"Kav.Resources." + name + ".fxb"
2020-08-05 03:50:44 +00:00
);
using (MemoryStream ms = new MemoryStream())
{
stream.CopyTo(ms);
return ms.ToArray();
}
}
}
}