StartDrawing() --- StopDrawing()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

StartDrawing() --- StopDrawing()

Post by dobro »

I do not know if you've already coded graphical applications
but for my part I find very very heavy with the System Purebasic

Code: Select all

Startdrawing(ImageOutput(image))
	plot(element(i)\x,element(i)\y,element(i)\coul.l)
StopDrawing()
if a loop is to Write points in an image
at the same time and change the color of a sprite
I can not tell you the circus ...


if you also integrate it in a Recursive procedure; this is suicide insured
to manage the StopDrawing the right places ..


not to mention the sssssllllllloooooooowwwww .. in a loop. obliges it has put out of loops
but then, do not have a draw multiple things in multiple locations (Sprite, Screen, etc. ..)
these stories StartDrawing-StopDrawing is archaic!

how to arrange the other languages​​?


some things are impossible because of the speed limit that requires management

out of the question to Reel time, it is necessarily in the Pre-calculated ... so it does not take too temp.

I do not understand that to change context (StartDrawing () in a loop, take as much time in the loop!
it is simply a change of address, right?


the fact to the change of context in the drawing functions, allow it to be able to draw in a loop, and several destination


this will be pretty cool to be able to:


For x= 1 to 100 step 10
    For y= 1 to 100 step 10
       Box(x,y, 10, 10,couleur,imageoutput( #image1 ))
       Box(x,y, 10, 10,couleur,imageoutput( #image2 ))
       Box(x,y, 10, 10,couleur,SPriteoutput( #Sprite1 ))
       Box(x,y, 10, 10,couleur,Screenoutput())
    Next Y
Next x


if it is not a change of address, then we would have functions for the Creation Context
to separate the creation of graphical context ... we could create the context in the beginning of code
and then we could draw on in a loop as my example above ..


Sorry for the Translate Google (sur le forum français, c'est surement plus clair :lol: )
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: StartDrawing() --- StopDrawing()

Post by chris319 »

For x= 1 to 100 step 10
For y= 1 to 100 step 10
Box(x,y, 10, 10,couleur,imageoutput( #image1 ))
Box(x,y, 10, 10,couleur,imageoutput( #image2 ))
Box(x,y, 10, 10,couleur,SPriteoutput( #Sprite1 ))
Box(x,y, 10, 10,couleur,Screenoutput())
Next Y
Next x
Or:

gfxOut1 = imageoutput(image1)
gfxOut2 = imageoutput(image2)
gfxOut3 = spriteoutput(sprite1)
gfxOut4 = screenoutput()

For x = 1 to 100 step 10
For y = 1 to 100 step 10
Box(x,y, 10,10, color, gfxOut1)
Box(x,y, 10,10, color, gfxOut2)
Box(x,y, 10,10, color, gfxOut3)
Box(x,y, 10,10, color, gfxOut4)
Next
Next

Think of all the function calls you save.

Sounds good to me.
Post Reply