Browse Source

remove and rename code.

pull/9028/head
Dan Walmsley 4 years ago
parent
commit
43017d1590
  1. 2
      src/Web/Avalonia.Web.Sample/Program.cs
  2. 2
      src/Web/Avalonia.Web.Sample/interop.js
  3. 20
      src/Web/Avalonia.Web/AvaloniaRuntime.cs

2
src/Web/Avalonia.Web.Sample/Program.cs

@ -14,12 +14,12 @@ internal class Program
Console.WriteLine("Hello, Browser!");
Console.WriteLine();
foreach(var arg in args)
{
Console.WriteLine(arg);
}
AvaloniaRuntime.Init();
}
}

2
src/Web/Avalonia.Web.Sample/interop.js

@ -4,7 +4,7 @@ var LibraryExample = {
internal_func: function () {
}
},
example_initialize: function () {
InterceptGLObject: function () {
globalThis.AvaloniaGL = GL
}
}

20
src/Web/Avalonia.Web/AvaloniaRuntime.cs

@ -1,7 +1,6 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.JavaScript;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace Avalonia.Web;
@ -10,32 +9,24 @@ public partial class AvaloniaRuntime
public record GLInfo(int ContextId, uint FboId, int Stencils, int Samples, int Depth);
[DllImport("libSkiaSharp", CallingConvention = CallingConvention.Cdecl)]
static extern JSObject example_initialize();
static extern JSObject InterceptGLObject();
[JSExport]
internal static void StartAvaloniaView(JSObject canvas)
{
example_initialize();
InterceptGLObject();
// setup, get gl context...
var info = InitGL(canvas, "testCanvas");
/* var glInfo = new GLInfo(
var glInfo = new GLInfo(
info.GetPropertyAsInt32("context"),
(uint)info.GetPropertyAsInt32("fboId"),
info.GetPropertyAsInt32("stencil"),
info.GetPropertyAsInt32("sample"),
info.GetPropertyAsInt32("depth"));
Console.WriteLine($"{glInfo.ContextId}, {glInfo.FboId}");*/
}
public static void Init ()
{
if (false)
{
SkiaSharp.GRGlInterface.Create();
}
Console.WriteLine($"{glInfo.ContextId}, {glInfo.FboId}");
}
[JSImport("Canvas.Foo", "avalonia.ts")]
@ -47,8 +38,5 @@ public partial class AvaloniaRuntime
[JSImport("StorageProvider.isFileApiSupported", "storage.ts")]
public static partial bool IsFileApiSupported();
//[DllImport("__Internal")]
//public
}

Loading…
Cancel
Save