Whoami
Whoami

Reputation: 14418

Inter relationship between SDL_CreateWindow size/ screen resolution / SDL_Logical Size

My Android device supports the resolution of 480*800 ie: (Width*height).

I am trying to display 1280 * 720 frame that are received from ffmpeg.

Pertaining to SDL:

  1. Window size is created to : 640 * 480 ( width * height )
  2. Renderer size 640 * 480 ( width * height )
  3. Setting Logical Size to 640 * 480 [ SDL_RenderSetLogicalSize ]

Question:

  1. How 1280 * 720 [ HD Frame] actually related to these three components? What i understood is that SDL_RenderSetLogicalSize will try to fit (1280 * 720 ) into (640 * 480).
  2. Changing render size and window size does not create any difference. so what important it is about size of window/renderer and logical size?

Upvotes: 2

Views: 1281

Answers (1)

Cosmic Bacon
Cosmic Bacon

Reputation: 301

SDL_RenderSetLogicalSize(Renderer, 1280, 720);

That will display a resolution of 1280 by 720 on any resolution while maintaining the proper aspect ratio via letter boxing.

Upvotes: 2

Related Questions