NO

Author Topic: Mandelbrot for PellesC  (Read 6049 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Mandelbrot for PellesC
« on: November 23, 2013, 10:35:00 PM »
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.
« Last Edit: November 27, 2013, 12:08:01 PM by timovjl »
May the source be with you

Offline Vortex

  • Member
  • *
  • Posts: 797
    • http://www.vortex.masmcode.com
Re: Mandelbrot for PellesC
« Reply #1 on: November 23, 2013, 10:57:29 PM »
Great example. Thanks.
Code it... That's all...

CLR

  • Guest
Re: Mandelbrot for PellesC
« Reply #2 on: November 23, 2013, 11:42:43 PM »
Very nice program. Thanks.

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Mandelbrot for PellesC
« Reply #3 on: November 25, 2013, 04:32:33 AM »
Nice one, thanks!  ;)

Ralf

czerny

  • Guest
Re: Mandelbrot for PellesC
« Reply #4 on: November 25, 2013, 11:29:53 AM »
Nice work! But does not terminate fully (see taskmanager).

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Mandelbrot for PellesC
« Reply #5 on: November 25, 2013, 08:45:16 PM »
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

Offline jcfuller

  • Member
  • *
  • Posts: 36
Re: Mandelbrot for PellesC
« Reply #6 on: November 26, 2013, 12:33:51 AM »
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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: Mandelbrot for PellesC
« Reply #7 on: November 26, 2013, 08:51:36 AM »
That Explorer's "feature" is fixed in MandelbrotTest5.zip ???
May the source be with you

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: Mandelbrot for PellesC
« Reply #8 on: November 26, 2013, 05:00:26 PM »
Works like a charm, ca. 600 ms on my trusty Celeron M :)

For comparison, I've posted a BASIC version in the other forum ;-)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: Mandelbrot for PellesC
« Reply #9 on: November 26, 2013, 09:05:37 PM »
if one want more speed, lower c to something like 30  ;) as it is now 255.
May the source be with you

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Mandelbrot for PellesC
« Reply #10 on: November 26, 2013, 10:02:13 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

  • Guest
Re: Mandelbrot for PellesC
« Reply #11 on: November 26, 2013, 10:30:31 PM »
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

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: Mandelbrot for PellesC
« Reply #12 on: November 26, 2013, 10:32:15 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" ;-)
« Last Edit: November 27, 2013, 10:44:48 AM by jj2007 »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: Mandelbrot for PellesC
« Reply #13 on: November 27, 2013, 12:06:41 PM »
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.
« Last Edit: November 28, 2013, 11:35:47 PM by timovjl »
May the source be with you