2026-01-17 22:52:36 -06:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
#include "pxl8_bytes.h"
|
|
|
|
|
#include "pxl8_types.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2026-03-07 07:12:32 -06:00
|
|
|
typedef bool (*pxl8_io_dir_callback)(void* userdata, const char* dir_path, const char* name);
|
|
|
|
|
|
2026-01-17 22:52:36 -06:00
|
|
|
pxl8_result pxl8_io_create_directory(const char* path);
|
2026-03-07 07:12:32 -06:00
|
|
|
bool pxl8_io_enumerate_directory(const char* path, pxl8_io_dir_callback callback, void* userdata);
|
2026-01-17 22:52:36 -06:00
|
|
|
bool pxl8_io_file_exists(const char* path);
|
|
|
|
|
void pxl8_io_free_binary_data(u8* data);
|
2026-03-07 07:12:32 -06:00
|
|
|
char* pxl8_io_get_cwd(void);
|
2026-01-17 22:52:36 -06:00
|
|
|
f64 pxl8_io_get_file_modified_time(const char* path);
|
2026-03-07 07:12:32 -06:00
|
|
|
usize pxl8_io_get_file_size(const char* path);
|
|
|
|
|
char* pxl8_io_get_pref_path(const char* org, const char* app);
|
|
|
|
|
char* pxl8_io_get_real_path(const char* path);
|
|
|
|
|
bool pxl8_io_is_directory(const char* path);
|
|
|
|
|
bool pxl8_io_set_cwd(const char* path);
|
|
|
|
|
void pxl8_io_set_executable(const char* path);
|
2026-01-21 23:19:50 -06:00
|
|
|
pxl8_result pxl8_io_read_binary_file(const char* path, u8** data, usize* size);
|
|
|
|
|
pxl8_result pxl8_io_read_file(const char* path, char** content, usize* size);
|
|
|
|
|
pxl8_result pxl8_io_write_binary_file(const char* path, const u8* data, usize size);
|
|
|
|
|
pxl8_result pxl8_io_write_file(const char* path, const char* content, usize size);
|
2026-01-17 22:52:36 -06:00
|
|
|
|
|
|
|
|
bool pxl8_key_down(const pxl8_input_state* input, const char* key_name);
|
|
|
|
|
bool pxl8_key_pressed(const pxl8_input_state* input, const char* key_name);
|
|
|
|
|
bool pxl8_key_released(const pxl8_input_state* input, const char* key_name);
|
2026-02-27 01:22:35 -06:00
|
|
|
void pxl8_set_key_down(pxl8_input_state* input, const char* key_name, bool down);
|
2026-01-17 22:52:36 -06:00
|
|
|
|
|
|
|
|
i32 pxl8_mouse_dx(const pxl8_input_state* input);
|
|
|
|
|
i32 pxl8_mouse_dy(const pxl8_input_state* input);
|
|
|
|
|
bool pxl8_mouse_pressed(const pxl8_input_state* input, i32 button);
|
|
|
|
|
bool pxl8_mouse_released(const pxl8_input_state* input, i32 button);
|
|
|
|
|
i32 pxl8_mouse_wheel_x(const pxl8_input_state* input);
|
|
|
|
|
i32 pxl8_mouse_wheel_y(const pxl8_input_state* input);
|
|
|
|
|
i32 pxl8_mouse_x(const pxl8_input_state* input);
|
|
|
|
|
i32 pxl8_mouse_y(const pxl8_input_state* input);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|