Пример #1
0
        public Result CreateWin32SurfaceKHR(MgWin32SurfaceCreateInfoKHR pCreateInfo, IMgAllocationCallbacks allocator, out IMgSurfaceKHR pSurface)
        {
            if (pCreateInfo == null)
            {
                throw new ArgumentNullException(nameof(pCreateInfo));
            }

            Debug.Assert(!mIsDisposed);

            var allocatorHandle = GetAllocatorHandle(allocator);

            var createInfo = new VkWin32SurfaceCreateInfoKHR
            {
                sType     = VkStructureType.StructureTypeWin32SurfaceCreateInfoKhr,
                pNext     = IntPtr.Zero,
                flags     = pCreateInfo.Flags,
                hinstance = pCreateInfo.Hinstance,
                hwnd      = pCreateInfo.Hwnd,
            };

            // TODO : MIGHT NEED GetInstanceProcAddr INSTEAD

            var surfaceHandle = 0UL;
            var result        = Interops.vkCreateWin32SurfaceKHR(Handle, ref createInfo, allocatorHandle, ref surfaceHandle);

            pSurface = new VkSurfaceKHR(surfaceHandle);

            return(result);
        }
Пример #2
0
        public void Initialize(uint width, uint height)
        {
            mWindow.ClientRectangle = new System.Drawing.Rectangle
                                          (mWindow.ClientRectangle.X, mWindow.ClientRectangle.Y, (int)width, (int)height);

            var createInfo = new MgWin32SurfaceCreateInfoKHR {
                // DOUBLE CHECK
                Hinstance = Process.GetCurrentProcess().Handle,
                Hwnd      = mWindow.WindowInfo.Handle,
            };
            var err = mDriverContext.Instance.CreateWin32SurfaceKHR(createInfo, null, out mSurface);

            Debug.Assert(err == Result.SUCCESS);
        }
Пример #3
0
 public Result CreateWin32SurfaceKHR(MgWin32SurfaceCreateInfoKHR pCreateInfo, IMgAllocationCallbacks allocator, out IMgSurfaceKHR pSurface)
 {
     throw new NotImplementedException();
 }