Mandelbrot for PellesC

Started by TimoVJL, November 23, 2013, 10:35:00 PM

Previous topic - Next topic

TimoVJL

Simple Mandelbrot program for PellesC.

EDIT BugFix, reset mouse LBUTTON in WM_CREATE because Explorer leave's it down when doubleclick program to start.
MandelbrotTest6_WS.zip with system palette and with 64-bit version.
May the source be with you

Vortex

Code it... That's all...

CLR


Bitbeisser


czerny

Nice work! But does not terminate fully (see taskmanager).

Bitbeisser

Quote from: czerny on November 25, 2013, 11:29:53 AM
Nice work! But does not terminate fully (see taskmanager).
Not sure what you're seeing but it works just fine for me.
Don't see any remnants in the task manager of either program, neither started through the IDE nor standalone (Windows 7 Ultimate 64bit)...  ???

Ralf

jcfuller

Strange happenings here.
If I run from the ide after building it works fine.
If I double click on the exe from explorer I don't see the image unless I move or change the size of the window.
From explorer if I right click the file name and run as administrator it shows the image.

James

TimoVJL

May the source be with you

jj2007


TimoVJL

if one want more speed, lower c to something like 30  ;) as it is now 255.
May the source be with you

Bitbeisser

Quote from: timovjl on November 26, 2013, 09:05:37 PM
if one want more speed, lower c to something like 30  ;) as it is now 255.
Well, once in a while seeing the graph slowly build up can have a soothing effect  8) , but otherwise, the full picture is there as soon as I hit run in the IDE or click on the executable itself. And that's on a fairly old (by today's geek standard) dual core laptop...  ;)

Ralf

czerny

Quote from: Bitbeisser on November 25, 2013, 08:45:16 PM
Quote from: czerny on November 25, 2013, 11:29:53 AM
Nice work! But does not terminate fully (see taskmanager).
Not sure what you're seeing but it works just fine for me.
Don't see any remnants in the task manager of either program, neither started through the IDE nor standalone (Windows 7 Ultimate 64bit)...  ???
Ralf
I have this under XP. In win2k all is ok! :-)

czerny

jj2007

#12
Quote from: timovjl on November 26, 2013, 09:05:37 PM
if one want more speed, lower c to something like 30  ;) as it is now 255.

Yes, that speeds it up a lot. For an equal number of iterations, your version is only 33% slower than hand-crafted assembler - very good, actually.

By the way, I've done some testing of SetDIBitsToDevice vs BitBlt, and it turns out that the latter is over 5% faster.

EDIT: Bad news - #6 doesn't exit properly on Win7-32. It does process the WM_CLOSE message correctly, it passes the WM_DESTROY message and HeapFree succeeds. With PostQuitMessage, it loses 6 handles in TaskManager. Afterwards, Olly reports that the thread ended but Task Manager still sees it, and it must be killed manually...

Attached a version that asks if it should be killed brutally, with ExitProcess. That works but I guess it's not "by design" ;-)

TimoVJL

#13
Thank's for reporting that error, i just forgot to use ExitProcess(msg.wParam)

BTW: at start 32-bit 55ms or 64-bit 28 ms   :-\ , timing error  ???

EDIT: MandelbrotTest7_WS_1.zip 60 levels and from 256 colours.
         MandelTestPNG_WS.zip commandline program.
May the source be with you