Skip to content
My personal WIP single file header library for quick and simple cross-platform interactive applications.
C Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
examples
previews
.clang-format
.editorconfig
.gitignore
LICENSE
Makefile
README.md
scg.h

README.md

Simple Computer Graphics (SCG)

My personal single file header library for quick and simple cross-platform graphics applications. It is currently in a WIP progress state, so not really usable for others. But feel free to take any code from it if it's useful.

The library does all rendering in software by manually setting pixels. At the end of each frame these pixels are sent to a texture on the GPU which is scaled and presented on screen. This method of drawing is slow and not intended for any serious production software. It is designed for learning purposes and for building interactive demos.

Setup

The library requires the SDL2.

OSX

brew install sdl2

Linux

sudo apt-get install libsdl2-dev

Or, if on another distribution, use the package manager available.

Building the examples

All the examples can be built with Make.

Build all examples:

make

Build a single example:

make {{example_name}}

Replace {{example_name}} with any of the following:

  • basic
  • plasma
  • image
  • transform
  • rotozoom
  • tunnel

By default all the examples are built with optimization flags. To build in debug mode, use the DEBUG=1 flag.

make DEBUG=1

Or for building a specific example:

make {{example_name}} DEBUG=1

Examples

Basic Plasma Image Transform Rotozoom Tunnel
basic plasma image transform rotozoom tunnel
Source Source Source Source Source Source

Converting audio

Ensure ffmpeg is installed. Then run:

ffmpeg -i assets/{example_sound}.wav -acodec pcm_s16le -ac 2 -ar 48000 assets/{example_sound_output}.wav

Attributions / References

You can’t perform that action at this time.