Liar...
I don't know who is a liar but i am not .
here is my red-mandelbrot if you don't believe that is not yours...
$ filename "MandelRed.exe"
include "rtl32.inc"
include "awinh.inc"
#lookahead
declare function GetTickCount lib "kernel32.dll" () as long
sys t1,t2 : string ts
INT win,c,r
INT w,h
dim i,y,px as INT
dim Z_re2 as FLOAT
dim Z_im2 as FLOAT
dim Z_re as FLOAT
dim Z_im as FLOAT
dim c_re as FLOAT
dim c_im as FLOAT
INT rr,gg,bb
float t
INT hdc, hdcMem, hbmMem, oldBmp, oldBrush, oldPen, oldFont, fColor
INT textX,textY,hBrush
INT ImageWidth=640
INT ImageHeight=480
int z
MinRe = -2.0f
MaxRe = 1.0f
MinIm = -1.2f
MaxIm = MinIm+(MaxRe-MinRe) * ImageHeight/ImageWidth
Re_factor = (MaxRe-MinRe)/(ImageWidth-1)
Im_factor = (MaxIm-MinIm)/(ImageHeight-1)
'window
win = SetWindow("Mandel::Red",0,0,ImageWidth,ImageHeight,0,WS_SYSMENU)
InitDrawing()
FillRect ( hdcMem,rc,CreateSolidBrush RGB(0,0,0) )
t1=GetTickCount()
'---------------------------------------------------------------------
for y = 0 to ImageHeight-1
c_im = MaxIm - y*Im_factor
for px=0 to ImageWidth-1
c_re=MinRe+px*Re_factor
Z_re=c_re
Z_im=c_im
for i = 1 to 30
Z_re2=Z_re*Z_re
Z_im2=Z_im*Z_im
if (Z_re2+Z_im2) > 4
'-> back buffer
Setpixel hdcMem, px, y,RGB(145-(i+5),i*16,i+1)
exit for
end if
Z_im=2*Z_re*Z_im+c_im
Z_re=Z_re2-Z_im2+c_re
next i
next px
next y
t2=GetTickCount()
t= (t2-t1) /1000
ts = str(t)
TextOut hdcMem,10,360, ts, Len(ts) ' 0.731 sec
'----------------------------------------------------------------
Wait()
Function WndProc (sys hwnd,wmsg,wparam,lparam) as sys callback
Select wmsg
CASE WM_CLOSE
DestroyWindow win
CleanUp()
PostQuitMessage 0
CASE WM_SIZE
'GetSize(win,0,0,w,h)
CASE WM_PAINT
BitBlt(hDC, 0, 0, w, h, hdcMem, 0, 0, SRCCOPY)
End Select
Return DEFAULT
End Function
SUB InitDrawing
''get current size of window
GetSize(win,0,0,w,h)
'get window DC
hdc=GetDC(win)
hdcMem = CreateCompatibleDC(0)
hbmMem = CreateCompatibleBitmap(hdc, w, h)
oldBmp = SelectObject( hdcMem, hbmMem )
oldBrush = SelectObject(hdcMem, CreateSolidBrush( RGB(231,223,231)) )
oldPen = SelectObject(hdcMem, CreatePen(PS_SOLID,1,RGB(231,223,231)))
'fill rectangle memDC with brush color
FillRect ( hdcMem,rc, oldBrush)
SetTextColor( hDC,RGB(0,0,0))
SetBkColor( hDC, RGB(231,223,231))
'blit to memDC
BitBlt(hDCmem, 0, 0, w, h, hdc, 0, 0, SRCCOPY)
ReleaseDC( win, hdc)
End SUB
SUB CleanUp
DeleteDC(hdcMem)
DeleteObject(SelectObject(hdcMem, oldBrush))
DeleteObject(SelectObject(hdcMem, oldPen))
DeleteObject(SelectObject(hdcMem, oldBmp))
END SUB
Sub Pix(wnd as int,sys x, y, r, g, b)
hdc=GetDC(wnd)
sys pcolor = RGB(r,g,b)
Setpixel hdcMem, x, y,pcolor
'BitBlt(hDCmem, 0, 0, w, h, hdc, 0, 0, SRCCOPY)
ReleaseDC(wnd, hdc)
End Sub
'//////////////////////////////////////////////////////////
SUB DrawGray
INT color,red,green,blue
for y = 0 to ImageHeight-1
for px=0 to ImageWidth-1
cColor = Getpixel( hdc, px, y)
sys color
red = color
green = color - green/256
blue = color - blue/65536
Pix win, px, y,red,green,blue
Next px
Next y
END SUB
Ok now ?
I am not in the mood for freak show at all...