Alex Holkner wrote:
> On 9/17/08, pdpi <[EMAIL PROTECTED]> wrote:
>>  Hello everybody,
>>
>>  I have a question, and though I've been programming for a while, I'm
>>  quite new to games in general and pyglet in particular, so assuming
>>  generic programming knowledge is ok, pyglet specifics isn't :)
>>
>>  This said: I have an image (assume a bitmap) with tiled sub-images, in
>>  black and white, and I would like to be able to blit bits of that
>>  image on the framebuffer (which is easy enough), but with some sort of
>>  "palette switch", whereby I get to pick what colours the white and the
>>  black represent (which is where I'm lost).
>>
>>  (All of a sudden it occurred to me that I could blit the replacement
>>  for the black background colour in first, as a rectangle, and then
>>  colorize the bitmap with the sprite.color attribute, make the
>>  background transparent, and blit it on top, but that seems a bit...
>>  inelegant)
> 
> That's pretty much the idea, actually.  OpenGL doesn't have any
> built-in color shifting functions.

As Alex says, it's not part of OpenGL but often the library used to open
an OpenGL context has such a function. Changing the CLUT (color lookup
table) is an old trick that was used for various animations.

pyglet doesn't include CLUT setting functions, but pygame does
(specifically, pygame.display.set_gamma_ramp).

-Andrew

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to