01-30-2017 07:23 AM
01-31-2017 06:56 AM
02-07-2017 06:00 AM
03-26-2017 04:21 PM
07-23-2017 07:55 AM
@imperativity
Hi,
I recently updated to Unity 2017 and now the following line is failing:
nativeTexture = Texture2D.CreateExternalTexture(textureWidth, textureHeight,TextureFormat.RGBA32, true, false, IntPtr.Zero);
The message I get is: ArgumentException: nativeTex can not be null
This is my full code:
OVR_Media_Surface_Init();
mediaRenderer = GetComponent<Renderer>();
if (mediaRenderer.material == null || mediaRenderer.material.mainTexture == null)
{
Utils.Log("No material for movie surface");
}
nativeTexture = Texture2D.CreateExternalTexture(textureWidth, textureHeight,TextureFormat.RGBA32, true, false,IntPtr.Zero);
IssuePluginEvent(MediaSurfaceEventType.Initialize);
_androidSurface = OVR_Media_Surface_GetObject();
_playbackEnvironment.SetSurface(_androidSurface);
OVR_Media_Surface_SetTextureParms(textureWidth, textureHeight);
mediaRenderer.material.mainTexture = nativeTexture;