diff options
author | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-09 14:31:57 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-09 14:31:57 +0100 |
commit | 4fa8a129e6ecfa168604568673cfbdaa2c8e34b0 (patch) | |
tree | 6e97965f1a32c007533eadb15becb4b9405867ea /libmlx/mlx_mouse.m | |
parent | Reverted map to normal size (diff) | |
download | 42-cub3d-4fa8a129e6ecfa168604568673cfbdaa2c8e34b0.tar.gz 42-cub3d-4fa8a129e6ecfa168604568673cfbdaa2c8e34b0.tar.bz2 42-cub3d-4fa8a129e6ecfa168604568673cfbdaa2c8e34b0.tar.xz 42-cub3d-4fa8a129e6ecfa168604568673cfbdaa2c8e34b0.tar.zst 42-cub3d-4fa8a129e6ecfa168604568673cfbdaa2c8e34b0.zip |
Renamed minilibx
Diffstat (limited to 'libmlx/mlx_mouse.m')
-rw-r--r-- | libmlx/mlx_mouse.m | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/libmlx/mlx_mouse.m b/libmlx/mlx_mouse.m deleted file mode 100644 index 94ce0a9..0000000 --- a/libmlx/mlx_mouse.m +++ /dev/null @@ -1,52 +0,0 @@ -#include <stdio.h> - -#import <Cocoa/Cocoa.h> -#import <OpenGL/gl3.h> - -#include "mlx_int.h" -#include "mlx_new_window.h" - -int mlx_mouse_hide() -{ - // CGDisplayHideCursor(kCGDirectMainDisplay); - [NSCursor hide]; - return (0); -} - -int mlx_mouse_show() -{ - // CGDisplayShowCursor(kCGDirectMainDisplay); - [NSCursor unhide]; - return (0); -} - -int mlx_mouse_move(mlx_win_list_t *win, int x, int y) -{ - CGPoint point; - NSRect pos; - id thewin; - - thewin = [(id)(win->winid) win]; - pos = [thewin frame]; - // printf("got win pos %f %f\n", pos.origin.x, pos.origin.y); - point.x = pos.origin.x + x; - point.y = NSHeight([[thewin screen] frame]) - NSHeight([(id)(win->winid) frame]) - pos.origin.y + 1 + y; - CGWarpMouseCursorPosition(point); - CGAssociateMouseAndMouseCursorPosition(true); - return (0); -} - - -int mlx_mouse_get_pos(mlx_win_list_t *win, int *x, int *y) -{ - CGPoint point; - id thewin; - NSRect pos; - - thewin = [(id)(win->winid) win]; - pos = [(id)(win->winid) frame]; - point = [thewin mouseLocationOutsideOfEventStream]; - *x = point.x; - *y = NSHeight(pos) - 1 - point.y; - return (0); -} |