I have written a program to draw Julia sets and store them in a .bmp file, using SDL 1.2, on windows 7. The program is designed to scan each pixel and draw a certain color, updating the screen regularly, and when that is done, to store the image in a file and wait for the user to exit.
The program compiles and runs OK. However, and this annoys me, after a while the screen will freeze, though the program keeps running. When all the computations are finished, the screen unfreezes, the file is stored correctly, and the program exits normally when the user quits. Also, if the user toggles the window before the calculations are finished and then comes back to it, the screen freezes.
The program itself requires a lot of CPU but very little memory.
Any idea how to fix this ?
Note : first posted on programmers.stackexchange but apparently that was not the right place for the question :-)