Little Fractale Generator with source :)

Blitz3D Forums/Blitz3D Programming/Little Fractale Generator with source :)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I like you program.

This mod seems to speed it up a bit.
I have changed the Proc_RenderMandel() so it is Locking the buffer and using writepixelfast. It also doesnt then need to convert the colors.

Replace Proc_RenderMandel() with this code
Function Proc_RenderMandel()
	
	For i =0 To PalSize-1
		Read  Colour
		Col(I)=Colour
	Next
	
	xscale#=X_Side#/Float(xmax) 
	yscale#=Y_Side#/Float(ymax) 
 LockBuffer ImageBuffer (RenderView)

	For y=0 To ymax  Step Precision
		For x=0 To xmax Step Precision
			cx#=Float(x)*xscale#+Left_Side# 
			cy#=Float(y)*yscale#+Top_Side# 
			
			zx#=0
			zy#=0 
			
			ColorCounter=0
			CurrentColor=0

			While (zx#*zx#+zy#*zy#<4 And colorcounter+ScaleColor<MaxColor) 
				tempx#=zx#*zx#-zy#*zy#+cx#
				zy#=2*zx#*zy#+cy#
				zx#=tempx# 
				colorcounter=colorcounter+1
			Wend

			CurrentColor=colorcounter+ScaleColor Mod MaxColor

		;	SetBuffer ImageBuffer (RenderView)
		;	ConvertARGB(Col(CurrentColor))
		 ;Plot x,y
		 writepixelfast x,y,col(CurrentColor),ImageBuffer (RenderView)
 ;  SetBuffer BackBuffer()

			; -----------------------------
			; Gestion de 'l'interface
			; -----------------------------
			If BCF_TestButton(StopMandel)  Then
				BCF_ChangeGaugeValue(Gauge01,0)
				unLockBuffer ImageBuffer (RenderView)
				Return
			EndIf

			If BCF_TestButton(ZoomMandel)  Then
				BCF_ChangeGaugeValue(Gauge01,0)
				unLockBuffer ImageBuffer (RenderView)
				Proc_ZoomMandel
			EndIf

			; ---------------------------------
			; On quitte le programme
			; ---------------------------------
			If BCF_TestButton(QuitMandel)  Or  KeyHit(1)  Then
			 unLockBuffer ImageBuffer (RenderView)
				ClearWorld
				End
			EndIf
		Next 
  unLockBuffer ImageBuffer (RenderView)
		; -----------------------------------
		; Gauge et affichage image
		; -----------------------------------
		BCF_ChangeGaugeValue(Gauge01,y)
	;	RenderWorld
  cls
		DrawImage RenderView,0,0

		; -------------------------
		; Gestion de la BCF
		; -------------------------
		BCF_RenderBCF()
	
		Flip
	Next

	BCF_ChangeGaugeValue(Gauge01,0)
End Function