Re: [Vala] Uint32 Color



On Wed, 2012-08-01 at 23:50 +0100, David Gomes wrote:
http://valadoc.org/#!api=sdl-gfx/SDLGraphics.Rectangle.fill_color

Regarding that function, how can I have an Uint32 act as a color? I tried
0xFF but no luck.

I took a look at the SDL documentation,
http://www.libsdl.org/docs/html/sdlfillrect.html
and noticed that they said that you should use the 'SDL_MapRGB' function
to generate the colour. In vala, this is
http://www.valadoc.org/#!api=sdl/SDL.PixelFormat.map_rgb

I also stumbled upon some example code that puts everything together:
take a look at
http://www.jezra.net/code_examples/game_of_life.vala

-- 
Calvin Walton <calvin walton kepstin ca>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]