Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(480074)

Issue 1357: Preserve video aspect ratio when resizing.

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 years, 7 months ago by freitass
Modified:
2 years, 6 months ago
Reviewers:
negge
Visibility:
Public.

Description

There is no standard, platform independent solution on SDL to make the
window preserve its aspect ratio when resizing. The present solution
calculates the proper video scale factor that fills as much of the
window as possible without stretching the image. When window and video
have different aspect ratios, the video is centralized, leaving empty
spaces to the left/right or to the top/bottom, depending on the shape of
the window/video.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M examples/player_example.c View 1 chunk +17 lines, -1 line 0 comments Download

Messages

Total messages: 3
freitass
2 years, 7 months ago #1
freitass
On 2016/04/29 20:03:59, freitass wrote: This is an attempt to fix Github issue #116.
2 years, 7 months ago #2
negge
2 years, 6 months ago #3
I also attempted to fix github issue #116 and found that a call to

SDL_RenderSetLogicalSize(renderer, WIDTH, HEIGHT);

by itself fixes this problem.  See my example program here

https://people.xiph.org/~unlord/SDL_test.c
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld