Skip to content

Commit

Permalink
ready to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin MARCHAUD committed Jan 20, 2016
1 parent 92f59e2 commit 9e642f8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions fdf/auteur
@@ -0,0 +1 @@
vmarchau
4 changes: 2 additions & 2 deletions fdf/includes/fdf.h
Expand Up @@ -6,7 +6,7 @@
/* By: vmarchau <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/22 13:36:01 by vmarchau #+# #+# */
/* Updated: 2016/01/07 14:48:13 by vmarchau ### ########.fr */
/* Updated: 2016/01/20 15:08:37 by vmarchau ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -54,5 +54,5 @@ void render(t_env *env);
void recompute_position(t_env *env, int oldzoom, int olddiff);

int on_key_press(int keycode, void *param);

int on_expose(void *param);
#endif
11 changes: 10 additions & 1 deletion fdf/srcs/listener.c
Expand Up @@ -6,7 +6,7 @@
/* By: vmarchau <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/29 14:48:05 by vmarchau #+# #+# */
/* Updated: 2016/01/07 14:19:23 by vmarchau ### ########.fr */
/* Updated: 2016/01/20 15:26:49 by vmarchau ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -25,6 +25,15 @@ void clean_exit(t_env *env)
exit(0);
}

int on_expose(void *param)
{
t_env *env;

env = (t_env *)param;
refresh(env, env->zoom, env->diff);
return (0);
}

int on_key_press(int key, void *param)
{
t_env *env;
Expand Down
3 changes: 2 additions & 1 deletion fdf/srcs/main.c
Expand Up @@ -6,7 +6,7 @@
/* By: vmarchau <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/22 13:48:17 by vmarchau #+# #+# */
/* Updated: 2016/01/07 14:19:11 by vmarchau ### ########.fr */
/* Updated: 2016/01/20 15:03:44 by vmarchau ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -64,6 +64,7 @@ int main(int size, char **args)
if (env->mlx == NULL || env->display == NULL)
return (ft_error("ERROR"));
mlx_key_hook(env->display, &on_key_press, env);
mlx_expose_hook(env->display, &on_expose, env);
render(env);
mlx_loop(env->mlx);
return (0);
Expand Down

0 comments on commit 9e642f8

Please sign in to comment.