Kav/Resources.cs

34 lines
768 B
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;
}
}
private static byte[] pbrEffect;
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();
}
}
}
}