Code Monkey home page Code Monkey logo

sdl_video_demo's Introduction

Build on Linux Enforce clang-format

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, 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

Requirements

  • SDL 2.x
  • SDL 1.x (or sdl12-compat)
  • sdl-gfx for SDL 1.x (not sdl2-gfx)

e.g.:

# sudo apt install --no-install-recommends --yes -V \
    build-essential \
    libsdl1.2-dev \
    libsdl-gfx1.2-dev \
    libsdl2-dev

Compilation

# make CFLAGS='-O2 -pipe' -j
# ./sdl1_video_demo &
# ./sdl2_video_demo &

Hotkeys

  • f or F11 โ€” toggle fullscreen
  • q or ESC โ€” exit

sdl_video_demo's People

Contributors

dependabot[bot] avatar hartwork avatar trofi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.