Added image loading

Added some string functions and macros
Added path listing on windows
Added assets
This commit is contained in:
2025-10-04 17:24:30 +01:00
parent 7d55b16c8e
commit b1a805cea8
17 changed files with 617 additions and 5 deletions

View File

@@ -23,6 +23,13 @@
#define function static
#define VK_MAX_FRAMES_IN_FLIGHT 8
#define VK_NUM_SCRATCH 8
typedef struct Vk_CommandBuffer Vk_CommandBuffer;
struct Vk_CommandBuffer {
VkCommandBuffer handle;
VkFence fence;
};
typedef struct Vk_Frame Vk_Frame;
struct Vk_Frame {
@@ -32,9 +39,35 @@ struct Vk_Frame {
VkSemaphore acquire, complete;
VkFence fence;
U32 next_scratch;
Vk_CommandBuffer scratch[VK_NUM_SCRATCH];
U32 image; // swapchain image index
};
typedef struct Vk_Image Vk_Image;
struct Vk_Image {
VkDeviceMemory memory;
VkDeviceSize size;
VkImage handle;
VkImageView view;
VkFormat format;
VkImageUsageFlags usage;
U32 width, height;
};
typedef struct Vk_Buffer Vk_Buffer;
struct Vk_Buffer {
VkDeviceMemory memory;
VkDeviceSize size;
VkBuffer handle;
void *data; // if mapped host visible memory
};
typedef struct Vk_Context Vk_Context;
struct Vk_Context {
void *lib;
@@ -86,4 +119,9 @@ function bool Vk_Setup(SDL_Window *window);
function Vk_Frame *Vk_FrameBegin(SDL_Window *window);
function void Vk_FrameEnd();
function Vk_CommandBuffer *Vk_CommandBufferPush();
function void Vk_CommandBufferSubmit(Vk_CommandBuffer *cmds, B32 wait);
function Vk_Buffer Vk_BufferCreate(U64 size, B32 host_visible);
#endif // LD_VULKAN_CORE_H_