summaryrefslogtreecommitdiff
path: root/plat.h
blob: 8b23eead48d2a80c9886e8aa9551d82d1e367c6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef plat_h

#include "render.h"
#include "error.h"

int get_mouse_x();
int get_mouse_y();

typedef enum {
	mbtn_left,
	mbtn_middle,
	mbtn_right,
	mbtn_count
} MBtn;
int mbtn_pressed(MBtn btn);
int mbtn_just_pressed(MBtn btn);
int mbtn_just_released(MBtn btn);
int get_mscroll_x(void);
int get_mscroll_y(void);
int get_mouse_x(void);
int get_mouse_y(void);

const char* get_text_input(int* len);

void print(const char* fmt, ...);
void print_err(const char* fmt, ...);
void print_war(const char* fmt, ...);
void pbreak(Error code);

Colour* get_fb(void);

unsigned long get_current_time();
void sleep_ns(unsigned long ns);

void plat_present(int x, int y, int w, int h);
int get_render_w(void);
int get_render_h(void);

unsigned char* load_binary(const char* n, int* size);
void free_file(void* p);

typedef void (*Dir_Iter)(void* uptr, const char* path);
void iter_dir(const char* path, Dir_Iter fn, void* u);

#endif