Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hartwork/sdl_video_demo
Demos fast blitting of a video buffer to the screen with scaling while respecting aspect-ratio in C99 for both SDL 2 and SDL 1
https://github.com/hartwork/sdl_video_demo
blitting c c99 letterboxing rendering sdl sdl2 windowboxing
Last synced: 23 days ago
JSON representation
Demos fast blitting of a video buffer to the screen with scaling while respecting aspect-ratio in C99 for both SDL 2 and SDL 1
- Host: GitHub
- URL: https://github.com/hartwork/sdl_video_demo
- Owner: hartwork
- License: gpl-3.0
- Created: 2022-12-19T17:24:06.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T23:59:19.000Z (3 months ago)
- Last Synced: 2024-12-30T21:51:41.609Z (about 1 month ago)
- Topics: blitting, c, c99, letterboxing, rendering, sdl, sdl2, windowboxing
- Language: C
- Homepage:
- Size: 1.73 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
[![Build on Linux](https://github.com/hartwork/sdl_video_demo/actions/workflows/linux.yml/badge.svg)](https://github.com/hartwork/sdl_video_demo/actions/workflows/linux.yml)
[![Enforce clang-format](https://github.com/hartwork/sdl_video_demo/actions/workflows/clang-format.yml/badge.svg)](https://github.com/hartwork/sdl_video_demo/actions/workflows/clang-format.yml)# SDL video demo (for both SDL 2 and SDL 1)
This repository demos fast blitting of a video buffer
to the screen with scaling while respecting aspect-ratio in C99.There are two versions with ~70% identical code,
one for old SDL 1.x and one for current SDL 2.x.
It has been an explicit goal to allow holding
the two versions' code side by side easily,
e.g. using [Meld](https://meldmerge.org/),
and to be able to compare their performance.The code is Software Libre licensed under GPL v3 or later.
Here's a quick 256 color recording of what to expect at runtime:
![Recording of sdl2_video_demo](recording.gif)# Requirements
- SDL 2.x
- SDL 1.x (or sdl12-compat)
- sdl-gfx for SDL 1.x (not sdl2-gfx)e.g.:
```console
# sudo apt install --no-install-recommends --yes -V \
build-essential \
libsdl1.2-dev \
libsdl-gfx1.2-dev \
libsdl2-dev
```# Compilation
```console
# make CFLAGS='-O2 -pipe' -j
# ./sdl1_video_demo &
# ./sdl2_video_demo &
```# Hotkeys
- f or F11 — toggle fullscreen
- q or ESC — exit