refactor: add helpers for file I/O, main script detection, safe strncpy, & make hal generic
This commit is contained in:
parent
a33d4c0068
commit
db82efe269
19 changed files with 327 additions and 457 deletions
|
|
@ -2,23 +2,15 @@
|
|||
|
||||
#include "pxl8_types.h"
|
||||
|
||||
typedef struct pxl8_atlas pxl8_atlas;
|
||||
typedef struct pxl8_game pxl8_game;
|
||||
|
||||
typedef struct pxl8_hal {
|
||||
void* (*create)(pxl8_pixel_mode mode, pxl8_resolution res,
|
||||
void* (*create)(i32 render_w, i32 render_h,
|
||||
const char* title, i32 win_w, i32 win_h);
|
||||
void (*destroy)(void* platform_data);
|
||||
|
||||
u64 (*get_ticks)(void);
|
||||
|
||||
void (*center_cursor)(void* platform_data);
|
||||
void (*present)(void* platform_data);
|
||||
void (*set_cursor)(void* platform_data, pxl8_cursor cursor);
|
||||
void (*set_cursor)(void* platform_data, u32 cursor);
|
||||
void (*set_relative_mouse_mode)(void* platform_data, bool enabled);
|
||||
void (*upload_atlas)(void* platform_data, const pxl8_atlas* atlas,
|
||||
const u32* palette, pxl8_pixel_mode mode);
|
||||
void (*upload_framebuffer)(void* platform_data, const u8* fb,
|
||||
i32 w, i32 h, const u32* palette,
|
||||
pxl8_pixel_mode mode);
|
||||
void (*upload_texture)(void* platform_data, const u8* pixels, u32 w, u32 h,
|
||||
const u32* palette, u32 bpp);
|
||||
} pxl8_hal;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue