Jump to content
  • Advertisement
Sign in to follow this  

SDL2 jagged/staircase edges

This topic is 1237 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

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


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?


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!