Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/src/pc/gfx/gfx_window_manager_api.h
7861 views
1
#ifndef GFX_WINDOW_MANAGER_API_H
2
#define GFX_WINDOW_MANAGER_API_H
3
4
#include <stdint.h>
5
#include <stdbool.h>
6
#include <PR/ultratypes.h>
7
8
struct GfxWindowManagerAPI {
9
void (*init)(const char *game_name, bool start_in_fullscreen);
10
void (*set_keyboard_callbacks)(bool (*on_key_down)(int scancode), bool (*on_key_up)(int scancode), void (*on_all_keys_up)(void), void (*on_mouse_move)(long x, long y), void (*on_mouse_press)(s8 left, s8 right, s8 middle, s8 wheel));
11
void (*set_fullscreen_changed_callback)(void (*on_fullscreen_changed)(bool is_now_fullscreen));
12
void (*set_fullscreen)(bool enable);
13
void (*set_vsync)(bool enable);
14
void (*set_window_size)(uint32_t width, uint32_t height);
15
void (*set_monitor)(uint32_t monitor_index);
16
int (*get_num_display_modes)(void);
17
void (*main_loop)(void (*run_one_game_iter)(void));
18
void (*get_dimensions)(uint32_t *width, uint32_t *height);
19
void (*handle_events)(void);
20
bool (*start_frame)(void);
21
void (*swap_buffers_begin)(void);
22
void (*swap_buffers_end)(void);
23
double (*get_time)(void); // For debug
24
};
25
26
#endif
27
28