summaryrefslogtreecommitdiff
path: root/src/screen.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/screen.h21
1 files changed, 18 insertions, 3 deletions
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 <stdint.h>
#include <stdbool.h>
+#include <pthread.h>
-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;
};