From: SonOfLilit Date: 2007-01-30T20:25:06+09:00 Subject: Re: 0xff000000 ------=_Part_70185_4532782.1170156303136 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Looking at the ruby source showed me that ruby /can/ translate 0xff000000 to a ulong. The problem was a typo in my code, one extra 0. Aur Saraf On 1/30/07, SonOfLilit wrote: > > Hello. > > I am running on a 32 bit machine. > > I need to pass SDL the unsigned long 0xff000000 as a mask. > > s = SDL::Surface.new_from(image_data, screen.w, screen.h, 32, screen.w*4 > , > 0x00ff0000, 0x0000ff00, 0x000000ff, > 0xff0000000) > > fails with "bignum too big to convert into `unsigned long' (RangeError)" > > which is very understandable, considering that Ruby uses the MSB of a > VALUE > and thus Fixnums can only be 31bit on 32bit machines. > > What's the best idiom to get the mask so I can pass it? > > Thanks, > > Aur > > ------=_Part_70185_4532782.1170156303136--