-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRenderer.cs
22 lines (18 loc) · 877 Bytes
/
Renderer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System.Runtime.InteropServices.JavaScript;
using System.Runtime.Versioning;
namespace BlazorDoom
{
// declare the JS signature
// Class and JS renderutils did not work. Weird ???
// https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/import-export-interop
[SupportedOSPlatform("browser")]
public partial class Renderer
{
[JSImport("renderWithColorsAndScreenDataUnmarshalled", "blazorDoom/renderer.js")]
internal static partial string renderOnJS(byte[] screenData, int[] colors);
[JSImport("playSound", "blazorDoom/renderer.js")]
internal static partial string playSoundOnJS(int[] samples, int sampleRate, int channel);
[JSImport("playMusic", "blazorDoom/renderer.js")]
internal static partial string playMusicOnJS(int[] samples, int sampleRate, int channel);
}
}