5#include <vulkan/vulkan.h>
Forward declares struct typedefs.
VK2DTexture vk2dTextureLoad(const char *filename)
Loads a texture from a file (png, bmp, jpg, tiff).
void vk2dTextureFree(VK2DTexture tex)
Frees a texture from memory.
bool vk2dTextureUpdate(VK2DTexture tex, const void *pixels)
Replaces all pixels of a texture.
VK2DTexture vk2dTextureFrom(const void *data, int size)
Same as vk2dTextureLoad but it uses a byte buffer instead of pulling from a file.
VK2DImage vk2dTextureGetImage(VK2DTexture tex)
Returns a texture's internal image.
VK2DTexture vk2dTextureCreate(float w, float h)
Creates a texture meant as a drawing target - see vk2dRendererSetTarget.
uint32_t vk2dTextureGetID(VK2DTexture tex)
Returns a unique ID for this texture.
bool vk2dTextureCopyPixels(VK2DTexture tex, void *outPixels)
Reads a texture's pixels back from the GPU.
float vk2dTextureWidth(VK2DTexture tex)
Gets the width in pixels of a texture.
bool vk2dTextureIsTarget(VK2DTexture tex)
Checks if a texture was created as a target or not.
VK2DTexture vk2dTextureLoadFromImage(VK2DImage image)
Creates a texture from an image.
bool vk2dTextureUpdateRegion(VK2DTexture tex, const void *pixels, int x, int y, int w, int h)
Replaces a rectangle of pixels in a texture.
float vk2dTextureHeight(VK2DTexture tex)
Gets the height in pixels of a texture.