72typedef enum modifier_key
77 MLX_SUPERKEY = 0x0008,
78 MLX_CAPSLOCK = 0x0010,
90 MLX_MOUSE_BUTTON_LEFT = 0,
91 MLX_MOUSE_BUTTON_RIGHT = 1,
92 MLX_MOUSE_BUTTON_MIDDLE = 2,
101typedef enum mouse_mode
103 MLX_MOUSE_NORMAL = 0x00034001,
104 MLX_MOUSE_HIDDEN = 0x00034002,
105 MLX_MOUSE_DISABLED = 0x00034003,
119 MLX_CURSOR_ARROW = 0x00036001,
120 MLX_CURSOR_IBEAM = 0x00036002,
121 MLX_CURSOR_CROSSHAIR = 0x00036003,
122 MLX_CURSOR_HAND = 0x00036004,
123 MLX_CURSOR_HRESIZE = 0x00036005,
124 MLX_CURSOR_VRESIZE = 0x00036006,
135 MLX_KEY_APOSTROPHE = 39,
150 MLX_KEY_SEMICOLON = 59,
178 MLX_KEY_LEFT_BRACKET = 91,
179 MLX_KEY_BACKSLASH = 92,
180 MLX_KEY_RIGHT_BRACKET = 93,
181 MLX_KEY_GRAVE_ACCENT = 96,
182 MLX_KEY_ESCAPE = 256,
185 MLX_KEY_BACKSPACE = 259,
186 MLX_KEY_INSERT = 260,
187 MLX_KEY_DELETE = 261,
192 MLX_KEY_PAGE_UP = 266,
193 MLX_KEY_PAGE_DOWN = 267,
196 MLX_KEY_CAPS_LOCK = 280,
197 MLX_KEY_SCROLL_LOCK = 281,
198 MLX_KEY_NUM_LOCK = 282,
199 MLX_KEY_PRINT_SCREEN = 283,
236 MLX_KEY_KP_DECIMAL = 330,
237 MLX_KEY_KP_DIVIDE = 331,
238 MLX_KEY_KP_MULTIPLY = 332,
239 MLX_KEY_KP_SUBTRACT = 333,
240 MLX_KEY_KP_ADD = 334,
241 MLX_KEY_KP_ENTER = 335,
242 MLX_KEY_KP_EQUAL = 336,
243 MLX_KEY_LEFT_SHIFT = 340,
244 MLX_KEY_LEFT_CONTROL = 341,
245 MLX_KEY_LEFT_ALT = 342,
246 MLX_KEY_LEFT_SUPER = 343,
247 MLX_KEY_RIGHT_SHIFT = 344,
248 MLX_KEY_RIGHT_CONTROL = 345,
249 MLX_KEY_RIGHT_ALT = 346,
250 MLX_KEY_RIGHT_SUPER = 347,
267 uint8_t bytes_per_pixel;
325 modifier_key_t modifier;
342 const uint32_t width;
343 const uint32_t height;
370typedef enum mlx_errno
392extern mlx_errno_t mlx_errno;
397typedef enum mlx_settings
399 MLX_STRETCH_IMAGE = 0,
414typedef void (*mlx_scrollfunc)(
double xdelta,
double ydelta,
void* param);
424typedef void (*mlx_mousefunc)(mouse_key_t button, action_t action, modifier_key_t mods,
void* param);
433typedef void (*mlx_cursorfunc)(
double xpos,
double ypos,
void* param);
453typedef void (*mlx_resizefunc)(int32_t width, int32_t height,
void* param);
462typedef void (*mlx_closefunc)(
void* param);
471typedef void mlx_win_cursor_t;
481const char* mlx_strerror(mlx_errno_t val);
494mlx_t* mlx_init(int32_t width, int32_t height,
const char* title,
bool resize);
503void mlx_set_setting(mlx_settings_t setting, int32_t value);
548double mlx_get_time(
void);
570void mlx_get_monitor_size(int32_t index, int32_t* width, int32_t* height);
582void mlx_set_window_pos(
mlx_t*
mlx, int32_t xpos, int32_t ypos);
591void mlx_get_window_pos(
mlx_t*
mlx, int32_t* xpos, int32_t* ypos);
601void mlx_set_window_size(
mlx_t*
mlx, int32_t new_width, int32_t new_height);
616void mlx_set_window_limit(
mlx_t*
mlx, int32_t min_w, int32_t min_h, int32_t max_w, int32_t max_h);
624void mlx_set_window_title(
mlx_t*
mlx,
const char* title);
635bool mlx_is_key_down(
mlx_t*
mlx, keys_t key);
644bool mlx_is_mouse_down(
mlx_t*
mlx, mouse_key_t key);
657void mlx_get_mouse_pos(
mlx_t*
mlx, int32_t* x, int32_t* y);
665void mlx_set_mouse_pos(
mlx_t*
mlx, int32_t x, int32_t y);
673void mlx_set_cursor_mode(
mlx_t*
mlx, mouse_mode_t mode);
681mlx_win_cursor_t* mlx_create_std_cursor(cursor_t type);
699void mlx_destroy_cursor(mlx_win_cursor_t* cursor);
707void mlx_set_cursor(
mlx_t*
mlx, mlx_win_cursor_t* cursor);
719void mlx_scroll_hook(
mlx_t*
mlx, mlx_scrollfunc func,
void* param);
729void mlx_mouse_hook(
mlx_t*
mlx, mlx_mousefunc func,
void* param);
739void mlx_cursor_hook(
mlx_t*
mlx, mlx_cursorfunc func,
void* param);
749void mlx_key_hook(
mlx_t*
mlx, mlx_keyfunc func,
void* param);
759void mlx_close_hook(
mlx_t*
mlx, mlx_closefunc func,
void* param);
769void mlx_resize_hook(
mlx_t*
mlx, mlx_resizefunc func,
void* param);
780bool mlx_loop_hook(
mlx_t*
mlx,
void (*f)(
void*),
void* param);
798xpm_t* mlx_load_xpm42(
const char* path);
839void mlx_put_pixel(
mlx_image_t* image, uint32_t x, uint32_t y, uint32_t color);
892bool mlx_resize_image(
mlx_image_t* img, uint32_t nwidth, uint32_t nheight);
904void mlx_set_instance_depth(
mlx_instance_t* instance, int32_t zdepth);
935int32_t mlx_get_texoffset(
char c);