Example #1
0
        public unsafe Result SetDevice(IDXGIDevice device)
        {
            Result result = LocalInterop.CalliStdCallint(_nativePointer, device.NativePointer.ToPointer(), (*(void ***)_nativePointer)[3]);

            GC.KeepAlive(device);
            return(result);
        }
Example #2
0
        public unsafe Result SetSwapChain(IDXGISwapChain swapChain)
        {
            Result result = LocalInterop.CalliStdCallint(_nativePointer, (void *)swapChain.NativePointer.ToPointer(), (*(void ***)_nativePointer)[3]);

            GC.KeepAlive(swapChain);
            return(result);
        }
Example #3
0
        /// <summary>
        /// No documentation.
        /// </summary>
        /// <param name = "callback">No documentation.</param>
        /// <returns>No documentation.</returns>
        /// <unmanaged>HRESULT IVirtualSurfaceImageSourceNative::RegisterForUpdatesNeeded([In, Optional] IVirtualSurfaceUpdatesCallbackNative* callback)</unmanaged>
        /// <unmanaged-short>IVirtualSurfaceImageSourceNative::RegisterForUpdatesNeeded</unmanaged-short>
        public unsafe void RegisterForUpdatesNeeded(Vortice.DXGI.IVirtualSurfaceUpdatesCallbackNative callback)
        {
            Result result = LocalInterop.CalliStdCallint(_nativePointer, (void *)callback.NativePointer.ToPointer(), (*(void ***)_nativePointer)[10]);

            System.GC.KeepAlive(callback);
            result.CheckError();
        }
Example #4
0
 private unsafe int GetCountNative(out int propertyCount)
 {
     fixed(void *ppc = &propertyCount)
     {
         return(LocalInterop.Calli(UnsafeBasePtr, ppc, ((void **)(*(void **)UnsafeBasePtr))[3]));
     }
 }
Example #5
0
 private unsafe int GetValueNative(PropertyKey key, out PropertyVariant value)
 {
     fixed(void *pvalue = &value)
     {
         return(LocalInterop.Calli(UnsafeBasePtr, &key, pvalue, ((void **)(*(void **)UnsafeBasePtr))[5]));
     }
 }
        public unsafe Result SetDevice(IUnknown device)
        {
            IntPtr devicePtr = CppObject.ToCallbackPtr <SharpGen.Runtime.IUnknown>(device);
            Result result    = LocalInterop.CalliStdCallint(_nativePointer, devicePtr.ToPointer(), (*(void ***)_nativePointer)[3]);

            GC.KeepAlive(device);
            return(result);
        }
Example #7
0
 private unsafe int GetAtNative(int propertyIndex, out PropertyKey propertyKey)
 {
     propertyKey = new PropertyKey();
     fixed(void *ppk = &propertyKey)
     {
         return(LocalInterop.Calli(UnsafeBasePtr, propertyIndex, ppk, ((void **)(*(void **)UnsafeBasePtr))[4]));
     }
 }
        public unsafe Result FlushAllSurfacesWithDevice(IUnknown device)
        {
            IntPtr devicePtr = ToCallbackPtr <IUnknown>(device);
            Result result    = LocalInterop.CalliStdCallint(_nativePointer, devicePtr.ToPointer(), (*(void ***)_nativePointer)[3]);

            GC.KeepAlive(device);
            return(result);
        }
Example #9
0
        private unsafe Result GetUpdateRects(RawRect[] updates, int count)
        {
            Result result;

            fixed(void *updates_ = updates)
            {
                result = LocalInterop.CalliStdCallint(_nativePointer, updates_, count, (*(void ***)_nativePointer)[8]);
            }

            return(result);
        }
Example #10
0
        private unsafe Result GetUpdateRectCount(out int count)
        {
            Result result;

            fixed(void *count_ = &count)
            {
                result = LocalInterop.CalliStdCallint(_nativePointer, count_, (*(void ***)_nativePointer)[7]);
            }

            return(result);
        }
Example #11
0
        private unsafe void GetVisibleBounds(out RawRect bounds)
        {
            bounds = default;
            Result result;

            fixed(void *bounds_ = &bounds)
            {
                result = LocalInterop.CalliStdCallint(_nativePointer, bounds_, (*(void ***)_nativePointer)[9]);
            }

            result.CheckError();
        }
Example #12
0
        /// <summary>
        ///     Sets the effects parameters.
        /// <seealso cref="Parameters"/>
        /// </summary>
        /// <param name="parameters">Object that contains the new parameters of the effect.</param>
        /// <returns>HRESULT</returns>
        /// <remarks>Use the <see cref="Parameters"/> property instead.</remarks>
        public unsafe int SetAllParametersNative(T parameters)
        {
            IntPtr p = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(T)));

            try
            {
                Marshal.StructureToPtr(parameters, p, true);
                return(LocalInterop.CalliMethodPtr(UnsafeBasePtr, p.ToPointer(), ((void **)(*(void **)UnsafeBasePtr))[3]));
            }
            finally
            {
                Marshal.FreeCoTaskMem(p);
            }
        }
Example #13
0
        /// <summary>
        ///     Retrieves the effects parameters.
        /// <seealso cref="Parameters"/>
        /// </summary>
        /// <param name="parameters">A variable which retrieves the set parameters of the effect.</param>
        /// <returns>HRESULT</returns>
        /// <remarks>Use the <see cref="Parameters"/> property instead.</remarks>
        public unsafe int GetAllParametersNative(out T parameters)
        {
            IntPtr p = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(T)));

            try
            {
                int hresult = LocalInterop.CalliMethodPtr(UnsafeBasePtr, p.ToPointer(), ((void **)(*(void **)UnsafeBasePtr))[4]);

                parameters = (T)Marshal.PtrToStructure(p, typeof(T));
                return(hresult);
            }
            finally
            {
                Marshal.FreeCoTaskMem(p);
            }
        }
        private unsafe Result BeginDraw(RawRect?updateRect, Guid iid, out IntPtr updateObject, out Point offset)
        {
            RawRect updateRectCall = updateRect.GetValueOrDefault();

            offset = default;
            Result result;

            fixed(void *offset_ = &offset)
            {
                fixed(void *updateObject_ = &updateObject)
                {
                    result = LocalInterop.CalliStdCallint(_nativePointer, updateRect.HasValue ? &updateRectCall : (void *)0, &iid, updateObject_, offset_, (*(void ***)_nativePointer)[4]);
                }
            }

            return(result);
        }
Example #15
0
        public unsafe Result BeginDraw(RawRect updateRect, out IDXGISurface surface, out Point offset)
        {
            IntPtr surfacePtr = IntPtr.Zero;
            Result result;

            fixed(void *offset_ = &offset)
            {
                result = LocalInterop.CalliStdCallint0(_nativePointer, updateRect, &surfacePtr, offset_, (*(void ***)_nativePointer)[4]);
            }

            if (result.Failure)
            {
                surface = default;
                offset  = default;
                return(result);
            }

            surface = new IDXGISurface(surfacePtr);
            return(result);
        }
        protected override void UpdateBackgroundColor(bool initialize)
        {
            if (Element.BackgroundColor != default(Xamarin.Forms.Color))
            {
                _roundRectangle.Color = Element.BackgroundColor.ToNative();
            }
            var pancake = Element as PancakeView;

            if ((pancake.BackgroundGradientStartColor != default(Xamarin.Forms.Color) && pancake.BackgroundGradientEndColor != default(Xamarin.Forms.Color)))
            {
                _evasMap = LocalInterop.evas_map_new(4);
                LocalInterop.evas_map_util_points_populate_from_object_full(_evasMap, _roundRectangle.Handle, 0);
                ElmSharp.Color startColor = pancake.BackgroundGradientStartColor.ToNative();
                ElmSharp.Color endColor   = pancake.BackgroundGradientEndColor.ToNative();
                LocalInterop.evas_map_point_color_set(_evasMap, 0, startColor.R, startColor.G, startColor.B, startColor.A);
                LocalInterop.evas_map_point_color_set(_evasMap, 1, startColor.R, startColor.G, startColor.B, startColor.A);
                LocalInterop.evas_map_point_color_set(_evasMap, 2, endColor.R, endColor.G, endColor.B, endColor.A);
                LocalInterop.evas_map_point_color_set(_evasMap, 3, endColor.R, endColor.G, endColor.B, endColor.A);
                //LocalInterop.evas_map_util_points_color_set(_evasMap, 255, 0, 0, 255);
                LocalInterop.evas_object_map_set(_roundRectangle.Handle, _evasMap);
                LocalInterop.evas_object_map_enable_set(_roundRectangle.Handle, true);
            }
        }
Example #17
0
 public unsafe Result Invalidate(RawRect updateRect)
 {
     return(LocalInterop.CalliStdCallint0(_nativePointer, updateRect, (*(void ***)_nativePointer)[6]));
 }
Example #18
0
 public unsafe Result Resize(int newWidth, int newHeight)
 {
     return(LocalInterop.CalliStdCallint(_nativePointer, newWidth, newHeight, (*(void ***)_nativePointer)[11]));
 }
Example #19
0
 private unsafe int SetValueNative(PropertyKey key, PropertyVariant value)
 {
     return(LocalInterop.Calli(UnsafeBasePtr, &key, &value, ((void **)(*(void **)UnsafeBasePtr))[6]));
 }
 public unsafe Result SetSwapChainHandle(IntPtr swapChainHandle)
 {
     return(LocalInterop.CalliStdCallint(_nativePointer, (void *)swapChainHandle, (*(void ***)_nativePointer)[4]));
 }
Example #21
0
 public unsafe Result EndDraw()
 {
     return(LocalInterop.CalliStdCallint(_nativePointer, (*(void ***)_nativePointer)[5]));
 }
Example #22
0
 private unsafe int CommitNative()
 {
     return(LocalInterop.Calli(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[7]));
 }
 public unsafe Result UpdatesNeeded()
 {
     return(LocalInterop.CalliStdCallint(_nativePointer, (*(void ***)_nativePointer)[3]));
 }