SDL_RenderFillRect without antialiasing?

Is there some ways to let SDL2 draw non-antialiased rectangle?
I tried it with using for and SDL_RenderDrawPoint. However, it requires too much CPU performances. Is there any ways to draw non-antialiased rectangle on SDL2?

There should be no antialiasing if you specify ‘nearest’ interpolation:


I don’t think it works.

What graphics backend are you using? Direct3D? OpenGL? Metal? Are you doing any ‘implied’ scaling (e.g. as a result of SDL_RenderSetLogicalSize() or ‘high DPI’ scaling)? Have you tried using the software renderer (SDL_RENDERER_SOFTWARE)?

Oh it works without antialiasing with SDL_RENDERER_SOFTWARE. But, why does it works like this? Why is the rectangle get antialiased with SDL_RENDERER_ACCELERATED? Isn’t it better to use hardware renderer than software renderer?