Exemple #1
0
    // Returns the texture info associated with the current video background
    public VideoTextureInfo GetVideoTextureInfo()
    {
        IntPtr ptr = Marshal.AllocHGlobal(
            Marshal.SizeOf(typeof(VideoTextureInfo)));

        rendererGetVideoBackgroundTextureInfo(ptr);

        VideoTextureInfo info = (VideoTextureInfo)Marshal.PtrToStructure
                                    (ptr, typeof(VideoTextureInfo));

        Marshal.FreeHGlobal(ptr);
        return(info);
    }
    // Returns the texture info associated with the current video background
    public override VideoTextureInfo GetVideoTextureInfo()
    {
        if (QCARRuntimeUtilities.IsPlayMode())
        {
            CameraDeviceImpl cameraDeviceImpl = (CameraDeviceImpl)CameraDevice.Instance;
            return(cameraDeviceImpl.WebCam.GetVideoTextureInfo());
        }
        else
        {
            IntPtr ptr = Marshal.AllocHGlobal(
                Marshal.SizeOf(typeof(VideoTextureInfo)));

            QCARWrapper.Instance.RendererGetVideoBackgroundTextureInfo(ptr);

            VideoTextureInfo info = (VideoTextureInfo)Marshal.PtrToStructure
                                        (ptr, typeof(VideoTextureInfo));

            Marshal.FreeHGlobal(ptr);

            return(info);
        }
    }