开发者

SDL Colour Tint

开发者 https://www.devze.com 2023-03-01 02:16 出处:网络
InOpenGL I simply call glColor3f and then draw the texture to get it coloured, but how do I do th开发者_Go百科is in SDL? I have looked through the docs and cannot see anyway to do this.

In OpenGL I simply call glColor3f and then draw the texture to get it coloured, but how do I do th开发者_Go百科is in SDL? I have looked through the docs and cannot see anyway to do this.

I am trying to make this work under SDL too because I want an SDL-only mode for my game, incase the person playing doesn't have a very good graphics card.


There isn't a built-in function to do it, you'll have to it manually in software. A decently quick and straight forward way to do it would be:

dst_color = src_color * blend_color / 255;

This may be quite slow if you do it a lot, though.

0

精彩评论

暂无评论...
验证码 换一张
取 消