diff options
| author | Clément Sibille <clements@lisible.xyz> | 2025-03-16 19:13:09 +0100 |
|---|---|---|
| committer | Clément Sibille <clements@lisible.xyz> | 2025-03-18 21:25:10 +0100 |
| commit | cb74ffacedb3c1bc4a5398d665d1f4dc12f69a4a (patch) | |
| tree | 23c91e34fd0a5dafb47beac7e7e0c6f6bd26457f /src/platform.h | |
| parent | 038c0c44d26a45554e3cc6257bc67d3fecb291cd (diff) | |
Add the renderer's foundations
Diffstat (limited to '')
| -rw-r--r-- | src/platform.h | 26 |
1 files changed, 26 insertions, 0 deletions
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 <stdint.h> +#include <stdlib.h> + +#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" |
