Exemplo n.º 1
0
    public static bool SetOverlayQuad(bool onTop, bool headLocked, IntPtr texture, IntPtr device, Posef pose, Vector3f scale, int layerIndex = 0)
    {
        if (version >= OVRP_1_6_0.version)
        {
            uint flags = (uint)OverlayFlag.None;
            if (onTop)
            {
                flags |= (uint)OverlayFlag.OnTop;
            }
            if (headLocked)
            {
                flags |= (uint)OverlayFlag.HeadLocked;
            }

            return(OVRP_1_6_0.ovrp_SetOverlayQuad3(flags, texture, IntPtr.Zero, device, pose, scale, layerIndex) == Bool.True);
        }

        if (layerIndex != 0)
        {
            return(false);
        }

        if (version >= OVRP_0_1_1.version)
        {
            return(OVRP_0_1_1.ovrp_SetOverlayQuad2(ToBool(onTop), ToBool(headLocked), texture, device, pose, scale) == Bool.True);
        }
        else
        {
            return(OVRP_0_1_0.ovrp_SetOverlayQuad(ToBool(onTop), texture, device, pose, scale) == Bool.True);
        }
    }
Exemplo n.º 2
0
    public static bool SetOverlayQuad(bool onTop, bool headLocked, IntPtr leftTexture, IntPtr rightTexture, IntPtr device, Posef pose, Vector3f scale, int layerIndex = 0, OverlayShape shape = OverlayShape.Quad)
    {
        if (version >= OVRP_1_6_0.version)
        {
            uint flags = (uint)OverlayFlag.None;
            if (onTop)
            {
                flags |= (uint)OverlayFlag.OnTop;
            }
            if (headLocked)
            {
                flags |= (uint)OverlayFlag.HeadLocked;
            }

            if (shape == OverlayShape.Cylinder || shape == OverlayShape.Cubemap)
            {
#if UNITY_ANDROID
                if (version >= OVRP_1_7_0.version)
                {
                    flags |= (uint)(shape) << OverlayShapeFlagShift;
                }
                else
#else
                if (shape == OverlayShape.Cubemap && version >= OVRP_1_10_0.version)
                {
                    flags |= (uint)(shape) << OverlayShapeFlagShift;
                }
                else
#endif
                { return(false); }
            }

            if (shape == OverlayShape.OffcenterCubemap)
            {
#if UNITY_ANDROID
                if (version >= OVRP_1_11_0.version)
                {
                    flags |= (uint)(shape) << OverlayShapeFlagShift;
                }
                else
#endif
                return(false);
            }

            return(OVRP_1_6_0.ovrp_SetOverlayQuad3(flags, leftTexture, rightTexture, device, pose, scale, layerIndex) == Bool.True);
        }

        if (layerIndex != 0)
        {
            return(false);
        }

        return(OVRP_0_1_1.ovrp_SetOverlayQuad2(ToBool(onTop), ToBool(headLocked), leftTexture, device, pose, scale) == Bool.True);
    }
Exemplo n.º 3
0
 public static bool SetOverlayQuad(bool onTop, bool headLocked, IntPtr texture, IntPtr device, Posef pose, Vector3f scale)
 {
     if (version >= OVRP_0_1_1.version)
     {
         return(OVRP_0_1_1.ovrp_SetOverlayQuad2(ToBool(onTop), ToBool(headLocked), texture, device, pose, scale) == Bool.True);
     }
     else
     {
         return(OVRP_0_1_0.ovrp_SetOverlayQuad(ToBool(onTop), texture, device, pose, scale) == Bool.True);
     }
 }