OpenGL-Sandbox-V1-FTGLFont

 view release on metacpan or  search on metacpan

t/90-visual-inspection.t  view on Meta::CPAN

	or plan skip_all => "Set TEST_VISUAL=1 to run these tests";

my $c= try { make_context; }
	or plan skip_all => "Can't test without context";

$res->resource_root_dir(catdir($FindBin::Bin, 'data'));
$res->font_config({
	default => { filename => 'SquadaOne-Regular', face_size => 32 }
});

sub show(&) {
	my ($code, $tname)= @_;
	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
	load_identity;
	$code->();
	$c->swap_buffers;
	sleep .5;
	my @e= get_gl_errors;
	ok( !@e, $tname )
		or diag "GL Errors: ".join(', ', @e);
}
sub spin(&) {
	my ($code, $tname)= @_;
	load_identity;
	for (my $i= 0; $i < 200; $i++) {
		glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
		local_matrix {
			rotate $i*1, 1, 1, 0;
			rotate $i*2, 0, 0, 1;
			$code->();
		};
		$c->swap_buffers;



( run in 0.301 second using v1.01-cache-2.11-cpan-49f99fa48dc )