RE: create a surface from a buffer

2004-06-24 Thread Andy
On Thu, 2004-06-24 at 10:25, Patrick A wrote: > Been a while since I've Perl'd, but doesn't it make more sense to pass a > reference around? or to have an imagemanager that your threads can query? Within the same thread, yes. Unfortunately, references created in one thread can not be shared with

RE: create a surface from a buffer

2004-06-24 Thread Patrick A
In order to pass surfaces around, I need to be able to serialize them (as only scalars can be in shared variables). Been a while since I've Perl'd, but doesn't it make more sense to pass a reference around? or to have an imagemanager that your threads can query? sorry but I didn't read your entir

create a surface from a buffer

2004-06-24 Thread Andy Bakun
I want to be able to save a surface to a scalar, and then recreate it. it seems like this should work, but it doesn't: my $surf = new SDL::Surface( ... ); my $buffer = $surf->pixels(); my $newsurf = new SDL::Surface(-from=>$buffer, ... ); Where the ... are the same options for both calls to new