save state
This commit is contained in:
@@ -6,7 +6,6 @@ using System.Runtime.InteropServices;
|
||||
public class KotlinBridge : MonoBehaviour
|
||||
{
|
||||
static KotlinBridge Instance;
|
||||
Texture2D texture;
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct NativeCallbacks
|
||||
{
|
||||
@@ -16,17 +15,19 @@ public class KotlinBridge : MonoBehaviour
|
||||
public IntPtr OnBufferReady;
|
||||
public IntPtr OnTextureReady;
|
||||
}
|
||||
public delegate void OnMessageDelegate(string message);
|
||||
public delegate void OnServiceInitializedDelegate(bool success);
|
||||
public delegate void OnFrameAvailableDelegate();
|
||||
public delegate void OnBufferReadyDelegate();
|
||||
public delegate void OnTextureReadyDelegate(uint gl_texture);
|
||||
delegate void OnMessageDelegate(string message);
|
||||
delegate void OnServiceInitializedDelegate(bool success);
|
||||
delegate void OnFrameAvailableDelegate();
|
||||
delegate void OnBufferReadyDelegate();
|
||||
delegate void OnTextureReadyDelegate(uint gl_texture);
|
||||
[DllImport("my_native_lib")]
|
||||
private static extern void SetNativeCallbacks(ref NativeCallbacks callbacks);
|
||||
static extern void SetNativeCallbacks(ref NativeCallbacks callbacks);
|
||||
[DllImport("my_native_lib")]
|
||||
private static extern IntPtr InitGLAD();
|
||||
public static extern void SendTouchMove(float u, float v);
|
||||
[DllImport("my_native_lib")]
|
||||
private static extern IntPtr UpdateTexture();
|
||||
static extern IntPtr InitGLAD();
|
||||
[DllImport("my_native_lib")]
|
||||
static extern IntPtr UpdateTexture();
|
||||
|
||||
[AOT.MonoPInvokeCallback(typeof(OnMessageDelegate))]
|
||||
static void OnMessage(string message)
|
||||
@@ -63,7 +64,6 @@ public class KotlinBridge : MonoBehaviour
|
||||
Debug.Log("Texture Ready: " + gl_texture);
|
||||
UnityMainThreadDispatcher.Enqueue(() => {
|
||||
var renderer = Instance.GetComponent<Renderer>();
|
||||
//renderer.material = new Material(Instance.oesShader);
|
||||
renderer.materials[2].mainTexture = Texture2D.CreateExternalTexture(1024, 1024,
|
||||
TextureFormat.RGBA32, false, false, (IntPtr)gl_texture);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user