Skip to content

adrian-javid/colorful_display

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colorful Display in a Webpage

This program displays animated color gradients.

A color gradient.

The purpose of this repository is to host a webpage that displays the graphical output of the program.

Project File Structure

  • source/ contains the C++ code for the graphical program.
  • website/ is the root of which to host the webpage.

Building

This project uses a Makefile to build.

This project builds for Linux and WebAssembly (WASM).

When building either for the native target or the website target, an artifact directory and a build directory are created. The build directory is for object files and dependency files. The compiled program is put into the artifact directory.

When compiling for the web, another additional directory website/generated is created if it doesn't already exist. The WebAssembly program is copied to here so that the webpage can use it.

# Compiles both the native target and the website target.
make all

Building Natively

The default target of the make command is the native program.

# Compiles natively.
make

Once compiled, the program can be found at artifact/native/colorful_display.

By default, the Makefile will use whatever C++ compiler the c++ command refers to. The C++ compiler can be specified as an argument to the make command.

# Compiles natively and uses the Clang C++ compiler.
make compiler=clang++

This following command removes the build files for the native target created by the make command.

make clean

Building for the Web

# Compiles the WebAssembly program into the website's directory.
make website

Dependencies

Linux make is used to build this program.

The Emscripten compiler is used to compile the C++ code to WebAssembly for the webpage. To compile natively, another compiler is needed. Specifically, this project was tested with Emscripten version 3.1.63.

Simple DirectMedia Layer (SDL) is used for graphics and input.