From 0aa6e65ea6ef044cf877ed6df8f3bf00141e0b23 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Mon, 24 Apr 2023 15:19:45 -0400 Subject: i made a swapchain --- src/screen.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/screen.h') diff --git a/src/screen.h b/src/screen.h index e1d80d1..423af7e 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,13 +1,28 @@ #pragma once -#define _POSIX_C_SOURCE 200809L +#define _XOPEN_SOURCE 600 +#define _POSIX_C_SOURCE 200112L +// #define _POSIX_C_SOURCE 200809L #include #include +#include -struct Screen { +typedef struct { uint16_t width; uint16_t height; - uint32_t* pixels; + uint8_t image_count; // amount of frames in flight + uint8_t image_front; // image being drawn to screen + uint8_t image_recent; // last image that finished drawing + uint8_t image_current; // current image being drawn + pthread_mutex_t lock; + uint32_t** images; +} Swapchain; + +void swapchain_next(Swapchain* swapchain); +void swapchain_submit(Swapchain* swapchain); + +struct Screen { + Swapchain swapchain; float delta; void* internal; }; -- cgit v1.2.3-freya