Dear Maintainer,
I am getting segfaults using SDLx::Text->write_to().
I have a minimal testcase which reproduces the problem in 100% of cases:
---8<---
#!/usr/bin/perl
use strict;
use SDL;
use SDL::Surface;
use SDLx::App;
use SDLx::Text;
my $dt = 1/60;
my $min_t = 1/60;
my $W = 1680/2;
my $H = 1050/2;
my $wt = 0xFFFFFFFF;
my $bk = 0x000000FF;
my $app = SDLx::App->new(w=>$W, h=>$H, dt=>$dt, min_t=>$min_t);
my $fgs = SDL::Surface->new_from($app, $app->w, $app->h, $app->format->BitsPerPixel, 0, 0, 0, 0);
my $fgt = SDLx::Text->new(h_align => 'center', size => 18, color => $bk, x => $W/2, y => 18);
$app->add_show_handler(sub{
my($delta,$app)=@_;
print "boom?\n";
$fgt->write_to($fgs,"segfault");
print "no...\n";
});
$app->run();
exit(0);
--->8---
Output when run:
boom?
Segmentation fault
I'll be happy to help debugging. I'm not a perl or SDL guru though.
Best regards,
Wilfried