Skip to content

rlfbckr/p5terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

Processing-Terminal

A Terminal (ASCII Art) Processing Interpreter.

Requirements

Tested on Linux (Ubuntu/Debian based distributions). Mac OS X and Windows (Cygwin/MINGW) should be possible.

  • libCaca/ncurses
  • Perl (File::Slup and File::copy Modules)
  • GNU C++ Compiler

Installing requirements on Ubuntu/Debian:

sudo apt-get install libfile-slurp-perl libcaca0 libcaca-dev git ncurses

###Installation Get Processing-Terminal from Github

git clone https://github.com/rlfbckr/p5terminal

Add processing-terminal to your PATH or add an alias in .bashrc

alias p5terminal="/path/to/processing-terminal/src/p5terminal"      

How it works

Processing-Terminal consists of two parts:

  1. C/C++ framework that mimics the Processing-core functions (e.g. draw(), line(), rect(), map())
  2. A Perl-Script that builds and runs the processing-code (similar to Arduino)

The Perl-Script processing-terminal does the following:

processing-terminal demo.pde
  1. It reads the given .pde file
  2. It adds an #include of the processing-terminal.h header file to the first line
  3. Precompiles the processing code
    • generating C function headers
    • inserts missing setup() and draw() functions
    • translates java syntax to C syntax
  4. Adds an a main function
  5. Builds and executable of the precompiled C code
    • create a build directory in the current path
    • copys the required C files and headers into the build directory
    • builds the executable with g++:
  6. Executes the build
  7. Restores the terminal (stty sane)

An example build command looks like this

g++ -Wall -g  -o build/demo build/p5terminal.c build/demo.c -Wall -lcaca -lpthread

About

Processing for the Terminal (ASCII)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published