SDL_RenderSetLogicalSize doesnt seem to work 100% with rects

when i first discovered SDL_RenderSetLogicalSize() i was happy that i found something i can finally use to be able to render more at once, but it seems that it doesnt like to 100% do its work when used with a rect or anything involving drawing lines of almost any sort, and i would like to know why and if there is any way i can fix the issue, here is a generic template that i work with, try out the code for yourself and please help me find a solution:

DemoCode.txt (1.5 KB)

to bring more clarity to the issue im seeing, this program in the end is going to be a render test of a movable 3d wall for another future project

Just here to confirm that it’s not you. Logical scaling has a lot of known faults for years and nobody has tried to fix it so far. Scaled horizontal / vertical lines will be made fatter / thinner while lines at any other angle aren’t, so that’s why you’re seeing some odd artefacts. It gets even more interesting when you change the x/y aspect and start rotating shapes.

SDL_RenderSetLogicalSize() doesn’t do anything magical, it just adjusts coordinates before rendering. You can implement your own scaling of coordinates instead.

SDL lines aren’t the most efficient way to render something. There’s maybe a better way to do what you want.

See this post. There the advice is given that SDL_RenderSetLogicalSize() “is broken and should not be used”. In the final post of that thread (so far!) I explain how I use a target texture to achieve a similar effect with none of the problems.