Ejemplo n.º 1
0
void		draw_bricks(t_env *e, t_brick *brick)
{
	init_brick(brick);
	while (e->map[brick->i])
	{
		brick->x = -0.99;
		brick->j = 0;
		while (e->map[brick->i][brick->j])
		{
			if (e->map[brick->i][brick->j] != '0')
			{
				glBegin(GL_POLYGON);
				get_color(e->map[brick->i][brick->j]);
				glVertex2f(brick->x, brick->y);
				glVertex2f(brick->x + brick->tx, brick->y);
				glVertex2f(brick->x + brick->tx, brick->y + brick->ty);
				glVertex2f(brick->x, brick->y + brick->ty);
				glEnd();
			}
			brick->x += brick->tx + 0.01;
			brick->j++;
		}
		brick->y += brick->ty - 0.01;
		brick->i++;
	}
}
Ejemplo n.º 2
0
/* these are the tcl init/exit routines */
int DLLEXPORT Br_Init(Tcl_Interp *interp)
{

   /* initialize stubs and create the exit handler */
   if( !Tcl_InitStubs(interp, TCL_VERSION, 0) )
     return TCL_ERROR;

   Tcl_CreateExitHandler(Br_Atexit, NULL);


   /* prepare environment and load functions into tcl */
   init_brick();
   load_routines(interp);

   return TCL_OK;
}