Use spans in RaylibRenderer's LoadFont instead of byte array.
This commit is contained in:
@@ -234,8 +234,8 @@ namespace DaggerFramework.Rendering
|
||||
{
|
||||
Raylib_cs.Font fontRay;
|
||||
|
||||
string ext = ".ttf";
|
||||
byte[] extBytes = new byte[Encoding.Default.GetByteCount(ext) + 1];
|
||||
ReadOnlySpan<char> ext = ".ttf"; // TODO: don't use a hardcoded extension.
|
||||
Span<byte> extBytes = new byte[Encoding.Default.GetByteCount(ext) + 1];
|
||||
Encoding.Default.GetBytes(ext, extBytes);
|
||||
int fontChars = 2048; // TODO: control this dynamically to not load the entire font.
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace DaggerFramework.Rendering
|
||||
}
|
||||
}
|
||||
|
||||
// Raylib.GenTextureMipmaps(ref fontRay.texture);
|
||||
Raylib.GenTextureMipmaps(ref fontRay.texture);
|
||||
Raylib.SetTextureFilter(fontRay.texture, TextureFilter.TEXTURE_FILTER_BILINEAR);
|
||||
|
||||
_fontPool.Add(fontRay);
|
||||
|
||||
Reference in New Issue
Block a user