SDL_BlitScaled doesn't work

微笑、不失礼 提交于 2019-12-09 08:22:26

Filling y with a color makes it work.

I added:

SDL_FillRect(y, &y->clip_rect, SDL_MapRGBA(x->format, 255, 0, 0, 255));

after the SDL_FillRect for x and it worked.

Some further experimentation of just filling a portion of y with alpha leads me to believe that SDL_BlitScaled isn't copying the alpha from the source surface so unless the dest surface has alpha where the destination rect is you won't see the result.

Some more experimentation shows that the default blend mode for a surface is SDL_BLENDMODE_BLEND and changing the mode for y to SDL_BLENDMODE_NONE also makes it work.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!