diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-11 13:43:04 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-12 15:45:52 +0100 |
| commit | a0c774e4963945b9a0d94e5b2cc7420960741a8b (patch) | |
| tree | c26c92eda37c03a1016a36724fad3f955373a7a0 /miniLibX/mlx_mouse.m | |
| parent | 2fdb9ad1d66e28e056f31bc6321d2c198db33290 (diff) | |
| download | cub3d-a0c774e4963945b9a0d94e5b2cc7420960741a8b.tar.gz cub3d-a0c774e4963945b9a0d94e5b2cc7420960741a8b.tar.bz2 cub3d-a0c774e4963945b9a0d94e5b2cc7420960741a8b.zip | |
Refactoring render.c
Diffstat (limited to 'miniLibX/mlx_mouse.m')
| -rw-r--r-- | miniLibX/mlx_mouse.m | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/miniLibX/mlx_mouse.m b/miniLibX/mlx_mouse.m deleted file mode 100644 index 94ce0a9..0000000 --- a/miniLibX/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); -} |
