common: add aspect ratio helper code
This is sufficiently nontrivial and often-needed enough that providing helpers makes a lot of sense. Add some extra helpers that come up when rendering to sub-rects of targets. The only annoying thing here is the mismatch between pl_rect2df and pl_rect2d. Maybe I can come up with a better API here? Also update the sdl2 demo to actually preserve the aspect ratio, as well as add some test cases to the new helper functions.
parent
f74ad3c8
No related branches found
No related tags found
Showing
- demos/sdl2.c 10 additions, 4 deletionsdemos/sdl2.c
- meson.build 1 addition, 1 deletionmeson.build
- src/common.c 140 additions, 0 deletionssrc/common.c
- src/include/libplacebo/common.h 49 additions, 0 deletionssrc/include/libplacebo/common.h
- src/include/libplacebo/renderer.h 5 additions, 0 deletionssrc/include/libplacebo/renderer.h
- src/renderer.c 17 additions, 0 deletionssrc/renderer.c
- src/tests/context.c 40 additions, 2 deletionssrc/tests/context.c
Loading
Please register or sign in to comment