SFML community forums
General => General discussions => Topic started 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
-
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
-
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.
-
It would be even faster to do this in a shader.
-
You'll need to do this in a shader or performance won't be tolerable.