예제 #1
0
        public static Vk.DebugReportCallbackExt RegisterDebugReportCallback(Vk.Instance instance,
                                                                            Vk.DebugReportFlagsExt flag, DebugCallback callback)
        {
            LowLevelDebugCallback container = BuildCallbackContainer(callback);
            IntPtr callbackPointer          = Marshal.GetFunctionPointerForDelegate <LowLevelDebugCallback>(container);

            var callbackInfo = new Vk.DebugReportCallbackCreateInfoExt();

            callbackInfo.PfnCallback = callbackPointer;
            callbackInfo.Flags       = flag;
            callbackInfo.UserData    = IntPtr.Zero;

            return(instance.CreateDebugReportCallbackEXT(callbackInfo));
        }
예제 #2
0
        public void RegisterDebugReportCallback(VkHelper.DebugCallback callback,
                                                Vk.DebugReportFlagsExt flags)
        {
            if (!this.validationLayersEnabled)
            {
                Console.Error.WriteLine("Attempted to register debug callback without Validation Layers enabled.");
                return;
            }

            var callbackData = new DebugCallbackData();

            callbackData.callback = callback;
            callbackData.flags    = flags;
            this.debugCallbacks.Add(callbackData);
        }