2023-07-30 19:18:50 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// window framework
|
|
|
|
// - rlyeh, public domain
|
|
|
|
//
|
|
|
|
// @todo: window_cursor(ico);
|
|
|
|
// @todo: if WINDOW_PORTRAIT && exist portrait monitor, use that instead of primary one
|
|
|
|
// @todo: WINDOW_TRAY
|
|
|
|
|
|
|
|
enum WINDOW_FLAGS {
|
|
|
|
WINDOW_MSAA2 = 0x02,
|
|
|
|
WINDOW_MSAA4 = 0x04,
|
|
|
|
WINDOW_MSAA8 = 0x08,
|
|
|
|
|
|
|
|
WINDOW_SQUARE = 0x20,
|
|
|
|
WINDOW_PORTRAIT = 0x40,
|
|
|
|
WINDOW_LANDSCAPE = 0x80,
|
|
|
|
WINDOW_ASPECT = 0x100, // keep aspect
|
|
|
|
WINDOW_FIXED = 0x200, // disable resizing
|
2023-09-21 10:45:42 +00:00
|
|
|
WINDOW_TRANSPARENT = 0x400,
|
2023-11-15 19:14:14 +00:00
|
|
|
WINDOW_BORDERLESS = 0x800,
|
2023-07-30 19:18:50 +00:00
|
|
|
|
2024-02-11 10:57:05 +00:00
|
|
|
WINDOW_VSYNC_DISABLED = 0,
|
2023-07-30 19:18:50 +00:00
|
|
|
WINDOW_VSYNC_ADAPTIVE = 0x1000,
|
2024-02-11 10:57:05 +00:00
|
|
|
WINDOW_VSYNC = 0x2000,
|
2023-07-30 19:18:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
API bool window_create(float scale, unsigned flags);
|
|
|
|
API bool window_create_from_handle(void *handle, float scale, unsigned flags);
|
|
|
|
API void window_reload();
|
|
|
|
|
|
|
|
API int window_frame_begin();
|
|
|
|
API void window_frame_end();
|
|
|
|
API void window_frame_swap();
|
|
|
|
API int window_swap(); // single function that combines above functions (desktop only)
|
|
|
|
|
|
|
|
API void window_loop(void (*function)(void* loopArg), void* loopArg ); // run main loop function continuously (emscripten only)
|
|
|
|
API void window_loop_exit(); // exit from main loop function (emscripten only)
|
|
|
|
|
|
|
|
API void window_title(const char *title);
|
|
|
|
API void window_color(unsigned color);
|
|
|
|
API vec2 window_canvas();
|
|
|
|
API void* window_handle();
|
|
|
|
API char* window_stats();
|
|
|
|
|
|
|
|
API uint64_t window_frame();
|
|
|
|
API int window_width();
|
|
|
|
API int window_height();
|
|
|
|
API double window_time();
|
|
|
|
API double window_delta();
|
|
|
|
|
|
|
|
// API bool window_hook(void (*func)(), void* userdata); // deprecated
|
|
|
|
// API void window_unhook(void (*func)()); // deprecated
|
|
|
|
|
|
|
|
API void window_focus(); // window attribute api using haz catz language for now
|
|
|
|
API int window_has_focus();
|
|
|
|
API void window_fullscreen(int enabled);
|
|
|
|
API int window_has_fullscreen();
|
|
|
|
API void window_cursor(int visible);
|
|
|
|
API int window_has_cursor();
|
|
|
|
API void window_pause(int paused);
|
|
|
|
API int window_has_pause();
|
|
|
|
API void window_visible(int visible);
|
|
|
|
API int window_has_visible();
|
2023-09-21 10:45:42 +00:00
|
|
|
API void window_maximize(int enabled);
|
|
|
|
API int window_has_maximize();
|
|
|
|
API void window_transparent(int enabled);
|
|
|
|
API int window_has_transparent();
|
2023-10-14 19:47:24 +00:00
|
|
|
API void window_icon(const char *file_icon);
|
|
|
|
API int window_has_icon();
|
2024-02-16 17:41:02 +00:00
|
|
|
API void window_debug(int visible);
|
|
|
|
API int window_has_debug();
|
2023-07-30 19:18:50 +00:00
|
|
|
|
|
|
|
API double window_aspect();
|
|
|
|
API void window_aspect_lock(unsigned numer, unsigned denom);
|
|
|
|
API void window_aspect_unlock();
|
|
|
|
|
|
|
|
API double window_fps();
|
|
|
|
API double window_fps_target();
|
|
|
|
API void window_fps_lock(float fps);
|
|
|
|
API void window_fps_unlock();
|
|
|
|
|
|
|
|
API void window_screenshot(const char* outfile_png); // , bool record_cursor
|
|
|
|
API int window_record(const char *outfile_mp4); // , bool record_cursor
|
|
|
|
|
2023-10-11 19:01:06 +00:00
|
|
|
API vec2 window_dpi();
|
|
|
|
|
2023-07-30 19:18:50 +00:00
|
|
|
enum CURSOR_SHAPES {
|
|
|
|
CURSOR_NONE,
|
|
|
|
CURSOR_HW_ARROW, // default
|
|
|
|
CURSOR_HW_IBEAM, // i-beam text cursor
|
|
|
|
CURSOR_HW_HDRAG, // horizontal drag/resize
|
|
|
|
CURSOR_HW_VDRAG, // vertical drag/resize
|
2023-11-05 15:30:11 +00:00
|
|
|
CURSOR_HW_HAND, // hand, clickable
|
|
|
|
CURSOR_HW_CROSS, // crosshair
|
2023-07-30 19:18:50 +00:00
|
|
|
CURSOR_SW_AUTO, // software cursor, ui driven. note: this is the only icon that may be recorded or snapshotted
|
|
|
|
};
|
|
|
|
|
|
|
|
API void window_cursor_shape(unsigned shape);
|
2023-11-05 15:30:11 +00:00
|
|
|
|
|
|
|
API const char *window_clipboard();
|
|
|
|
API void window_setclipboard(const char *text);
|