本文整理汇总了C#中UnityEngine.Texture.GetNativeTexturePtr方法的典型用法代码示例。如果您正苦于以下问题:C# Texture.GetNativeTexturePtr方法的具体用法?C# Texture.GetNativeTexturePtr怎么用?C# Texture.GetNativeTexturePtr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Texture
的用法示例。
在下文中一共展示了Texture.GetNativeTexturePtr方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateSender
public bool UpdateSender(string sharingName, Texture tex)
{
if(enabled == false || gameObject.activeInHierarchy == false || _isInit == false)return false;
//Debug.Log("Spout.UpdateSender:"+sharingName+"::"+tex.GetNativeTexturePtr().ToInt32());
return updateSenderNative(sharingName, tex.GetNativeTexturePtr());
}
示例2: SetRemoteDisplayTexture
public void SetRemoteDisplayTexture(Texture texture) {
IntPtr texturePointer = texture.GetNativeTexturePtr();
if (texturePointer == IntPtr.Zero) {
Debug.LogError("Couldn't obtain native pointer for the remote display texture.");
return;
}
CastRemoteDisplayiOSUnityBridge.SetRemoteDisplayTexture(texturePointer);
}
示例3: ReplaceTexture
public bool ReplaceTexture(long movieId, String textureName, Texture texture)
{
int texId;
int rt_with = texture.width;
int rt_height = texture.height;
#if (UNITY_4_0) || (UNITY_4_1)
#if UNITY_IPHONE
texId = texture.GetNativeTextureID();
#else
IntPtr texPtr = texture.GetNativeTexturePtr();
texId = (int)(texPtr);
#endif
#else
texId = texture.GetNativeTextureID();
#endif
return SF_ReplaceTexture(movieId, textureName, texId, rt_with, rt_height);
}
示例4: CreateSender
public bool CreateSender(string sharingName, Texture tex, int texFormat = 1)
{
if(!enabled)return false;
if(!_isInit)return false;
#if UNITY_EDITOR
if(!Application.isPlaying && !_isEnabledInEditor ) return false;
#endif
//Debug.Log("Spout.CreateSender");
//Debug.Log("Spout.CreateSender:"+sharingName+"::"+tex.GetNativeTexturePtr().ToInt32());
bool result = createSenderNative(sharingName, tex.GetNativeTexturePtr(), texFormat);
if (!result) Debug.LogWarning (String.Format("Spout sender creation with name {0} failed !",sharingName));
if(result) {
//Debug.Log (String.Format("Spout sender creation with name {0} success !",sharingName));
localSenderNames.Add(sharingName);
}
return result;
}
示例5: SetRemoteDisplayTexture
public void SetRemoteDisplayTexture(Texture texture)
{
IntPtr texturePointer = texture.GetNativeTexturePtr();
if (texturePointer == IntPtr.Zero) {
Debug.LogError("Couldn't obtain native pointer for the remote display texture.");
return;
}
if (bridge != null) {
Debug.Log("Setting texture with ID: " + texturePointer.ToInt64());
bridge.CallStatic(NATIVE_SET_REMOTE_DISPLAY_TEXTURE, texturePointer.ToInt64());
}
}
示例6: OnRenderObject
void OnRenderObject()
{
// The overlay must be specified every eye frame, because it is positioned relative to the
// current head location. If frames are dropped, it will be time warped appropriately,
// just like the eye buffers.
if (Camera.current != Camera.main || Camera.current.cameraType != CameraType.Game || layerIndex == -1 || currentOverlayType == OverlayType.None)
return;
#if !UNITY_ANDROID || UNITY_EDITOR
if (currentOverlayShape == OverlayShape.Cubemap || currentOverlayShape == OverlayShape.Cylinder)
{
Debug.LogWarning("Overlay shape " + currentOverlayShape + " is not supported on current platform");
}
#endif
if (texture != cachedTexture)
{
cachedTexture = texture;
if (cachedTexture)
texNativePtr = cachedTexture.GetNativeTexturePtr();
}
if (cachedTexture == null || texNativePtr == IntPtr.Zero)
return;
if (currentOverlayShape == OverlayShape.Cubemap)
{
if (texture.GetType() != typeof(Cubemap))
{
Debug.LogError("Need Cubemap texture for cube map overlay");
return;
}
}
bool overlay = (currentOverlayType == OverlayType.Overlay);
bool headLocked = false;
for (var t = transform; t != null && !headLocked; t = t.parent)
headLocked |= (t == Camera.current.transform);
OVRPose pose = (headLocked) ? transform.ToHeadSpacePose() : transform.ToTrackingSpacePose();
Vector3 scale = transform.lossyScale;
for (int i = 0; i < 3; ++i)
scale[i] /= Camera.current.transform.lossyScale[i];
// Cylinder overlay sanity checking
if (currentOverlayShape == OverlayShape.Cylinder)
{
float arcAngle = scale.x / scale.z / (float)Math.PI * 180.0f;
if (arcAngle > 180.0f)
{
Debug.LogError("Cylinder overlay's arc angle has to be below 180 degree, current arc angle is " + arcAngle + " degree." );
return ;
}
}
bool isOverlayVisible = OVRPlugin.SetOverlayQuad(overlay, headLocked, texNativePtr, IntPtr.Zero, pose.flipZ().ToPosef(), scale.ToVector3f(), layerIndex, currentOverlayShape);
if (rend)
rend.enabled = !isOverlayVisible;
}
示例7: Awake
void Awake()
{
Debug.Log("Overlay Awake");
rend = GetComponent<Renderer>();
if (texture)
{
cachedTexture = texture;
texNativePtr = texture.GetNativeTexturePtr();
}
else if (rend) // Backward compitability
{
texture = rend.material.mainTexture;
cachedTexture = texture;
texNativePtr = texture.GetNativeTexturePtr();
}
}
示例8: UpdateSender
public static bool UpdateSender(string sharingName, Texture tex)
{
return updateSenderNative(sharingName, tex.GetNativeTexturePtr());
}
示例9: CreateSender
public static bool CreateSender(string sharingName, Texture tex)
{
if(!isInit) Init();
Debug.Log ("Tex Native Pointer :"+tex.GetNativeTexturePtr());
return createSenderNative(sharingName, tex.GetNativeTexturePtr());
}