当前位置: 首页>>代码示例>>C#>>正文


C# RenderTexture.GetNativeTextureID方法代码示例

本文整理汇总了C#中UnityEngine.RenderTexture.GetNativeTextureID方法的典型用法代码示例。如果您正苦于以下问题:C# RenderTexture.GetNativeTextureID方法的具体用法?C# RenderTexture.GetNativeTextureID怎么用?C# RenderTexture.GetNativeTextureID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.RenderTexture的用法示例。


在下文中一共展示了RenderTexture.GetNativeTextureID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SFMovieCreationParams

// Allows a rendertexture to be passed in
    public SFMovieCreationParams(String name, int ox, int oy, int width, int height,
        IntPtr pdata, int length, bool initFirstFrame, RenderTexture texture, Color32 bgColor, 
		bool useBackgroundColor = false, ScaleModeType scaleModeType = ScaleModeType.SM_ShowAll, bool bAutoManageVP = true):
       this(name, ox, oy, width, height, pdata, length, initFirstFrame, bgColor, useBackgroundColor, scaleModeType, bAutoManageVP)
	   {
        IsRenderToTexture    = (texture != null);
        TexWidth            = ((texture != null) ? (UInt32)texture.width : 0);
        TexHeight           = ((texture != null) ? (UInt32)texture.height : 0);

#if (UNITY_4_0) || (UNITY_4_1)
        if (texture)
        {
#if UNITY_IPHONE
            TextureId = (uint)texture.GetNativeTextureID();
#else
            IntPtr texPtr = texture.GetNativeTexturePtr();
            TextureId = (uint)(texPtr);
#endif //UNITY_IPHONE
        }
        else
        {
            TextureId = 0;
        }
#else
        TextureId = ((texture != null) ? (UInt32)texture.GetNativeTextureID() : 0);
#if UNITY_STANDALONE_WIN
        if (SystemInfo.graphicsDeviceVersion[0] == 'D')
        {
            // SystemInfo.graphicsDeviceVersion starts with either "Direct3D" or "OpenGL".
            // We need to disable RTT on D3D+Windows because GetNativeTextureID() returns 
            // a garbage value in D3D mode instead of zero, even though 
            // GetNativeTextureID() is only supported in OpenGL mode.
            TextureId = 0;
            IsRenderToTexture = false;
            TexWidth = 0;
            TexHeight = 0;
        }
#endif //UNITY_STANDALONE_WIN
#endif //(UNITY_4_0) || (UNITY_4_1)

    //  pData = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(System.IntPtr)));
    //  Marshal.WriteIntPtr(pData, pdata);
    }
开发者ID:BiDuc,项目名称:Stereoscopic_Scatterplot,代码行数:44,代码来源:SFManager.cs


注:本文中的UnityEngine.RenderTexture.GetNativeTextureID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。