Skip to content

A C++ SDL program that shows different particle patterns

Notifications You must be signed in to change notification settings

jcalvarezj/ParticleSimulation

Repository files navigation

Particle Simultation

This is a small project that uses the SDL 2 library to display a window with particles that move around in different patterns. It is based on the example project from John Purcell's Cave of Programming C++ Begineer Course

Requirements

In order to successfully compile and run this project, you will need to have the SDL 2 libraries on your system.

For Linux

Install the libsdl2-2.0-0 and libsdl2-dev libraries.

For Windows

MinGW with g++ compiler should be installed on your system.

Download the latest SDL2-devel-2.x.x-mingw from SDL's official page and uncompress on an easy access directory (such as C:\SDL, for example).

From the new directory (C:\SDL), there is a folder named with your desired architecture. Copy that folder's bin content onto your MinGW's bin folder, and the include folder's contents onto MinGW's include

Compilation

Compile on Linux with g++ *.cpp `sdl2-config --cflags --libs`

Compile on Windows (using MinGW's g++ compiler and assuming SDL root is at C:\) with g++ *.cpp -IC:\SDL\include -LC:\SDL\i686-w64-mingw32\lib -w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2

Execution

Run on a CLI with program arguments: mode number, anything (optional), anything (optional)

Running with no optional arguments it will just display the patterns, with one it will disable clear screen, and with two it will enable box blur

Modes are:

  • 1: Flower pattern
  • 2: Spiral
  • 3: Rectangular explosion
  • 4: Circular explosion
  • 5: Circular implosion

For example: ./a.out 5 x x

Screenshot of one of the animations, with an implemented effect of box blur

About

A C++ SDL program that shows different particle patterns

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages