Vulkan2D
2D renderer written in C using Vulkan and SDL2
Texture.h
Go to the documentation of this file.
1 #pragma once
5 #include <vulkan/vulkan.h>
6 #include "VK2D/Structs.h"
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
16 VK2DTexture vk2dTextureLoadFromImage(VK2DImage image);
17 
22 VK2DTexture vk2dTextureLoad(const char *filename);
23 
29 VK2DTexture vk2dTextureFrom(void *data, int size);
30 
37 VK2DTexture vk2dTextureCreate(float w, float h);
38 
42 float vk2dTextureWidth(VK2DTexture tex);
43 
47 float vk2dTextureHeight(VK2DTexture tex);
48 
52 bool vk2dTextureIsTarget(VK2DTexture tex);
53 
57 VK2DImage vk2dTextureGetImage(VK2DTexture tex);
58 
64 uint32_t vk2dTextureGetID(VK2DTexture tex);
65 
68 void vk2dTextureFree(VK2DTexture tex);
69 
70 #ifdef __cplusplus
71 };
72 #endif
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.
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
VK2DTexture vk2dTextureFrom(void *data, int size)
Same as vk2dTextureLoad but it uses a byte buffer instead of pulling from a file.
uint32_t vk2dTextureGetID(VK2DTexture tex)
Returns a unique ID for this texture.
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.
float vk2dTextureHeight(VK2DTexture tex)
Gets the height in pixels of a texture.