pawengine/kitty.h

40 lines
1.4 KiB
C
Raw Normal View History

2025-02-09 18:48:25 +01:00
#ifndef INCLUDE_KITTY
#define INCLUDE_KITTY
#include <vulkan/vulkan.h>
struct Kitty;
struct Kitty *kitty_make();
void kitty_set_vertex_shader(struct Kitty *thingy, const char *path);
void kitty_set_fragment_shader(struct Kitty *thingy, const char *path);
2025-02-16 17:16:16 +01:00
// 'data' can be freed after 'kitty_finalise' is called, ownership is not
// transferred
2025-02-09 18:48:25 +01:00
void kitty_set_vertex_buffer(struct Kitty *thingy, void *data, uint32_t count,
int vertex_size);
void kitty_add_vertex_buffer_format(struct Kitty *thingy, enum VkFormat format);
2025-02-16 17:16:16 +01:00
// 'data' can be freed after 'kitty_finalise' is called, ownership is not
// transferred
void kitty_add_index_buffer(struct Kitty *kitty, void *data, uint32_t count);
void kitty_set_push_constant_size(struct Kitty *thingy, uint32_t size);
// the returned number can be used in 'kitty_set_next_ubo' to update the content
// of the buffer
2025-02-09 18:48:25 +01:00
int kitty_attatch_ubo(struct Kitty *thingy, uint32_t size);
2025-02-16 17:16:16 +01:00
void kitty_attatch_image(struct Kitty *thingy, const char *path);
2025-02-09 18:48:25 +01:00
void kitty_finalise(struct Vk *state, struct Kitty *thingy);
void kitty_set_next_push_constant(struct Kitty *thingy, void *data);
void kitty_set_next_ubo(struct Vk *state, struct Kitty *thingy, int index,
void *data);
2025-02-16 17:16:16 +01:00
2025-02-09 18:48:25 +01:00
void kitty_draw(struct Vk *state, uint32_t image_index, struct Kitty *thingy);
void free_kitty(struct Vk *state, struct Kitty *kitty);
#endif // INCLUDE_KITTY