Jacquelinett Posted February 11, 2013 Author Share Posted February 11, 2013 Like the title saidis it possible to tint an image in SDL? Link to comment Share on other sites More sharing options...
Godlord Posted February 11, 2013 Share Posted February 11, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now