2020-05-07 20:21:22 +02:00
|
|
|
#ifndef GFX_WINDOW_MANAGER_API_H
|
|
|
|
#define GFX_WINDOW_MANAGER_API_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2020-06-11 05:17:14 +02:00
|
|
|
// special value for window position that signifies centered position
|
|
|
|
#define WAPI_WIN_CENTERPOS 0xFFFFFFFF
|
|
|
|
|
2020-06-11 02:44:08 +02:00
|
|
|
typedef bool (*kb_callback_t)(int code);
|
|
|
|
|
2020-05-07 20:21:22 +02:00
|
|
|
struct GfxWindowManagerAPI {
|
2020-06-11 02:44:08 +02:00
|
|
|
void (*init)(const char *window_title);
|
|
|
|
void (*set_keyboard_callbacks)(kb_callback_t on_key_down, kb_callback_t on_key_up, void (*on_all_keys_up)(void));
|
2020-05-07 20:21:22 +02:00
|
|
|
void (*main_loop)(void (*run_one_game_iter)(void));
|
|
|
|
void (*get_dimensions)(uint32_t *width, uint32_t *height);
|
|
|
|
void (*handle_events)(void);
|
|
|
|
bool (*start_frame)(void);
|
|
|
|
void (*swap_buffers_begin)(void);
|
|
|
|
void (*swap_buffers_end)(void);
|
|
|
|
double (*get_time)(void); // For debug
|
2020-05-16 21:23:23 +02:00
|
|
|
void (*shutdown)(void);
|
2020-05-07 20:21:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|