src/resource/texture.c
// draws a thin, w-width rectangle from point A to point B with a texture that
// moves along the line.
//
draws a thin, w-width rectangle from point A to point B with a texture that
moves along the line.
draws a thin w - width rectangle from point A to point B with a texture that moves along the line .
void loop_tex_line_p(cmplx a, cmplx b, float w, float t, Texture *texture) {
	cmplx d = b-a;
	cmplx c = (b+a)/2;
	r_mat_mv_push();
	r_mat_mv_translate(creal(c), cimag(c), 0);
	r_mat_mv_rotate(carg(d), 0, 0, 1);
	r_mat_mv_scale(cabs(d), w, 1);
	r_mat_tex_push();
	r_mat_tex_translate(t, 0, 0);
	r_uniform_sampler("tex", texture);
	r_draw_quad();
	r_mat_tex_pop();
	r_mat_mv_pop();
}
void loop_tex_line_p ( cmplx a , cmplx b , float w , float t , Texture * texture ) { cmplx d = b - a ; cmplx c = ( b + a ) / 2 ; r_mat_mv_push ( ) ; r_mat_mv_translate ( creal ( c ) , cimag ( c ) , 0 ) ; r_mat_mv_rotate ( carg ( d ) , 0 , 0 , 1 ) ; r_mat_mv_scale ( cabs ( d ) , w , 1 ) ; r_mat_tex_push ( ) ; r_mat_tex_translate ( t , 0 , 0 ) ; r_uniform_sampler ( " " , texture ) ; r_draw_quad ( ) ; r_mat_tex_pop ( ) ; r_mat_mv_pop ( ) ; }
draws a thin, w-width rectangle from point A to point B with a texture that
moves along the line.
draws a thin w - width rectangle from point A to point B with a texture that moves along the line .