org.lwjgl.vulkan.VkInternalFreeNotification Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lwjgl-vulkan Show documentation
Show all versions of lwjgl-vulkan Show documentation
A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* Application-defined memory free notification function.
*
* C Specification
*
* The type of {@code pfnInternalFree} is:
*
*
* typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)(
* void* pUserData,
* size_t size,
* VkInternalAllocationType allocationType,
* VkSystemAllocationScope allocationScope);
*
* See Also
*
* {@link VkAllocationCallbacks}
*/
public abstract class VkInternalFreeNotification extends Callback implements VkInternalFreeNotificationI {
/**
* Creates a {@code VkInternalFreeNotification} instance from the specified function pointer.
*
* @return the new {@code VkInternalFreeNotification}
*/
public static VkInternalFreeNotification create(long functionPointer) {
VkInternalFreeNotificationI instance = Callback.get(functionPointer);
return instance instanceof VkInternalFreeNotification
? (VkInternalFreeNotification)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static VkInternalFreeNotification createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code VkInternalFreeNotification} instance that delegates to the specified {@code VkInternalFreeNotificationI} instance. */
public static VkInternalFreeNotification create(VkInternalFreeNotificationI instance) {
return instance instanceof VkInternalFreeNotification
? (VkInternalFreeNotification)instance
: new Container(instance.address(), instance);
}
protected VkInternalFreeNotification() {
super(SIGNATURE);
}
private VkInternalFreeNotification(long functionPointer) {
super(functionPointer);
}
private static final class Container extends VkInternalFreeNotification {
private final VkInternalFreeNotificationI delegate;
Container(long functionPointer, VkInternalFreeNotificationI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long pUserData, long size, int allocationType, int allocationScope) {
delegate.invoke(pUserData, size, allocationType, allocationScope);
}
}
}