SDL2 jagged/staircase edges

Started by
0 comments, last by sdrb 9 years, 2 months ago

I am using SDL2 and SDL2 Image to render png images.

When I rotate the textures, they turn out very ugly, like this:

VDbhy.png

This is the code responsible for the rotation and alpha mod.


SDL_Rect srcRect;
SDL_Rect destRect;
srcRect.x = width * currentFrame;
srcRect.y = height * currentRow;
srcRect.w = destRect.w = width;
srcRect.h = destRect.h = height;
destRect.x = x;
destRect.y = y;

SDL_SetTextureAlphaMod(m_textureMap[id], alpha);
SDL_RenderCopyEx(pRenderer, m_textureMap[id], &srcRect, &destRect, 10.0, 0, flip);

Do I need to set a blendmode too?

Advertisement

This did it:


SDL_SetHint( SDL_HINT_RENDER_SCALE_QUALITY, "1" )

This topic is closed to new replies.

Advertisement