pxl8/src/pxl8_hal.h

25 lines
899 B
C
Raw Normal View History

2025-10-17 17:54:33 -05:00
#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_pixel_mode mode, pxl8_resolution res,
2025-10-17 17:54:33 -05:00
const char* title, i32 win_w, i32 win_h);
void (*destroy)(void* platform_data);
u64 (*get_ticks)(void);
void (*center_cursor)(void* platform_data);
2025-10-17 17:54:33 -05:00
void (*present)(void* platform_data);
void (*set_cursor)(void* platform_data, pxl8_cursor cursor);
2025-11-19 22:18:08 -06:00
void (*set_relative_mouse_mode)(void* platform_data, bool enabled);
2025-10-17 17:54:33 -05:00
void (*upload_atlas)(void* platform_data, const pxl8_atlas* atlas,
const u32* palette, pxl8_pixel_mode mode);
2025-10-17 17:54:33 -05:00
void (*upload_framebuffer)(void* platform_data, const u8* fb,
i32 w, i32 h, const u32* palette,
pxl8_pixel_mode mode);
2025-10-17 17:54:33 -05:00
} pxl8_hal;