Coder Social home page Coder Social logo

interactive-mandelbrot's Introduction

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.

interactive-mandelbrot's People

Contributors

giodestone avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.