refactor SDL out of core files

This commit is contained in:
asrael 2025-10-17 17:54:33 -05:00
parent 82ed6b4ea9
commit 9d183341ae
21 changed files with 1419 additions and 1028 deletions

21
src/pxl8_hal.h Normal file
View file

@ -0,0 +1,21 @@
#pragma once
#include "pxl8_types.h"
typedef struct pxl8_atlas pxl8_atlas;
typedef struct pxl8_game pxl8_game;
typedef struct pxl8_hal {
void* (*create)(pxl8_color_mode mode, pxl8_resolution res,
const char* title, i32 win_w, i32 win_h);
void (*destroy)(void* platform_data);
u64 (*get_ticks)(void);
void (*present)(void* platform_data);
void (*upload_atlas)(void* platform_data, const pxl8_atlas* atlas,
const u32* palette, pxl8_color_mode mode);
void (*upload_framebuffer)(void* platform_data, const u8* fb,
i32 w, i32 h, const u32* palette,
pxl8_color_mode mode);
} pxl8_hal;