Skip to content

An interactive Mandelbrot using a thread farm/pool made using SFML and STL threads.

Notifications You must be signed in to change notification settings

giodestone/Interactive-Mandelbrot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Interactive-Mandelbrot

An interactive Mandelbrot using a thread farm/pool made using SFML and STL threads.

Download Here!

GIF of Interactive Mandelbrot running

How to use

WSAD, Arrow Keys, or Numpad 8, 6, 4, 2 to move; Plus and Minus (including numpad) to zoom; R to reset view.

How it works

The screen is divided up into tiles. Each of them is re-rendered when input happens.

The rendering is done on the CPU using a thread pool. Each of the threads gets a task allocated.

Key tasks are:

  • Redraw tile (render it again with new paramaters)
  • 'Desaturate tile' (Dim the tile to tell the user that it's out of date)

More Images

Zoomed part of the Mandelbrot set Home Page of application Another zoomed part of the Mandelbrot Set Rendering a scene

Implementation Notes

Uses SFML to not spend time implementing repetitive things.

Inter thread communication

Signalling the thread to wake up is done using a condition variable.

Mutexes are used for the queue.

Number of threads

The number of threads in minimum two, but otherwise automatically set to the amount of cores the operating system sees.

Drawing Manager

The Drawing Manager class handles drawing, input, and scheduling.

Mandelbrot static class

The Mandelbrot static class contains functions. Made static as it doesn't need to be instanced.

Logger Class

The logger class is for taking notes of time in CSV's, which can later be made into graphs.

Running benchmarks

Uncomment RunStatistics in the main function. This probably should've been made a mode.

About

An interactive Mandelbrot using a thread farm/pool made using SFML and STL threads.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages