from the SDL wiki I came to know that “Use SDL_RenderSetLogicalSize function to set a device independent resolution for rendering.”
But then why my texture is going full-screen even though i am using SDL_RenderSetLogicalSize.
Probably because you used NULL,NULL
You should specify the area of the screen where you want the texture displayed. You are telling it to display it full screen.
You probably shouldn’t use constants for the dst rectangle x and y, unless if you make your app specific for one single devices. The x coordinate should be something like (windows_width-320)/2, and the same for y.
The src rectangle you need to modify only if you want to put part of the texture on screen, otherwise leave it NULL.
Anyway, can you be more specific on what you are trying to do?
Is your code device specific? Because if you do this on some devices, such as very high DPI phones or laptops 320x240 can be just a few square cm big, so that’s not really ideal.