Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

C++ SDL Tinting?


Jacquelinett
 Share

Recommended Posts

SDL doesn't really offer any functions to tint images. However, there are a few ways to do it. The most obvious and fastest way to do it is to simply use OpenGL. Alternatively, you can also write your own function that applies the following formula to your images: dst_colour = src_colour * blend_colour / 255; However, since that operation has to be done in software, it is going to be painfully slow. Finally, the way used for old games is to have multiple palettes, where you'd dim the background by simply switching to another palette for that image or those images (of course, you'll need images where the palette indices are specified within the pixels, rather than the colours directly).

Yours faithfully,

S.J.R. van Schaik.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...