static int expose_hook(t_env *env) { debug_stdout("INIT", FILE_LINE_FUN); ++NB_FRAME; if (SCOP_DEBUG) fprintf(stdout, "nb_frame = %d\n", NB_FRAME); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); if (fig_draw(env) != EXIT_SUCCESS) return (ft_error(env, __FUNCTION__, "fig_draw error")); mlx_opengl_swap_buffers(WIN); test_opengl_error("ERROR", FILE_LINE_FUN); return (EXIT_SUCCESS); }
int loop_hook(void *data) { t_env *env; env = (t_env*)data; context_init(env); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //world_add_chunk(env->world, chunk_create(env->world, 16, 0)); glColor3f(0,0,0); glBegin(GL_QUADS); glVertex3f(-1, 1, 10); glVertex3f(1, 1, 10); glVertex3f(1, -1, 10); glVertex3f(-1, -1, 10); glEnd(); GL_ERROR(); world_render(env->world); mlx_opengl_swap_buffers(env->window->mlx_window); return (0); }
void render_window(t_mlx *e, t_obj *obj) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); draw(obj); mlx_opengl_swap_buffers(e->win); }