In the test program “testalpha”, the designated way to set a loaded
image’s colorkey based on pixel at (0,0) is:
SDL_SetColorKey(temp, SDL_SRCCOLORKEY, *(Uint8 *)temp->pixels );
However, when I tried it, it didn’t work.
But this did work:
Uint32 key; memcpy( &key, temp->pixels, temp->format->BytesPerPixel ); SDL_SetColorKey(temp, SDL_SRCCOLORKEY, key );
Any ideas why the first way (which is the way shown in the example
program) doesn’t work? I’m just wondering.
// joey tsai
Please CC to me.–
| PITIFUL, adj. The state of an enemy of opponent after an
joey tsai | imaginary encounter with oneself.
| – Ambrose Bierce, “The Devil’s Dictionary”