From cb74ffacedb3c1bc4a5398d665d1f4dc12f69a4a Mon Sep 17 00:00:00 2001 From: Clément Sibille Date: Sun, 16 Mar 2025 19:13:09 +0100 Subject: Add the renderer's foundations --- src/platform.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/platform.h') diff --git a/src/platform.h b/src/platform.h index baf0165..2f8bc19 100644 --- a/src/platform.h +++ b/src/platform.h @@ -1,6 +1,16 @@ #ifndef VGLTF_PLATFORM_H #define VGLTF_PLATFORM_H +#include "log.h" +#include +#include + +#define VGLTF_PANIC(...) \ + do { \ + VGLTF_LOG_ERR("panic: " __VA_ARGS__); \ + exit(1); \ + } while (0) + enum vgltf_event_type { VGLTF_EVENT_QUIT, VGLTF_EVENT_KEY_DOWN, @@ -49,11 +59,27 @@ struct vgltf_event { }; }; +struct vgltf_window_size { + int width; + int height; +}; + struct vgltf_platform; bool vgltf_platform_init(struct vgltf_platform *platform); void vgltf_platform_deinit(struct vgltf_platform *platform); bool vgltf_platform_poll_event(struct vgltf_platform *platform, struct vgltf_event *event); +bool vgltf_platform_get_window_size(struct vgltf_platform *platform, + struct vgltf_window_size *window_size); + +// Vulkan specifics +#include "vulkan/vulkan_core.h" +char const *const * +vgltf_platform_get_vulkan_instance_extensions(struct vgltf_platform *platform, + uint32_t *count); +bool vgltf_platform_create_vulkan_surface(struct vgltf_platform *platform, + VkInstance instance, + VkSurfaceKHR *surface); #include "platform_sdl.h" -- cgit v1.2.3