SFML community forums

General => General discussions => Topic started by: clypto on January 31, 2011, 01:54:58 pm

Title: Mandelbrot/Fractals
Post by: clypto on January 31, 2011, 01:54:58 pm
Hi everybody :D

Im new to SFML and as a first project Im trying to program the Mandelbrot set. I did the same with the canvas2d library in java so I know how to go about it, however there are a few questions I cannot answer with my limited experience in SFML. Since the calculations for a Mandelbrot set need to be fast, meaning the paint methods should have a high performance Im having a few unresolved questions:
How can you a draw a point and set its color?
Should I draw every point at a time or whats the most efficient way to do this in SFML?

regards and thank you in advance,

aline
Title: Mandelbrot/Fractals
Post by: Groogy on January 31, 2011, 02:02:04 pm
A 1px small square shape would let you draw a dot and set it's color pretty fast.

http://www.sfml-dev.org/documentation/1.6/classsf_1_1Shape.htm
Haven't changed much between 1.6 and 2.0
Title: Mandelbrot/Fractals
Post by: Laurent on January 31, 2011, 02:12:38 pm
Drawing things to generate an image is really a bad idea. Generate the whole image in a pixel array, and then display it once it's finished. This will always be the fastest solution.
Title: Mandelbrot/Fractals
Post by: Svenstaro on February 02, 2011, 03:57:29 pm
It would be even faster to do this in a shader.
Title: Mandelbrot/Fractals
Post by: JAssange on February 02, 2011, 04:21:06 pm
You'll need to do this in a shader or performance won't be tolerable.