Hello,
I just downloaded the demo of blitzmax to compare the speed of drawing individual pixels with blitzmax as opposed to blitzplus.
Looking through the documentation, and reading some of the posts here I could find only one way of writing pixel information directly to the backbuffer().
This was - grab pixmap of screen, writepixel to the pixmap, drawpixmap to the screen, release grabbed pixmap.
Comparing this, for the same area of the screen (100 pixels by 100 pixels), to a test done in blitzplus on the same computer, gave a result which showed the blitzplus is a lot faster for individual pixel plotting.
I'd like to know if the method I'm using is flawed to compare the speed of the two languages with respect to pixel plotting.
The speed difference, on an old machine, was 53 frames per second (about 20 millisecs per frame) in blitzmax compared to 145 frames per second (about 7 millisecs per frame) in blitzplus.
Here is the code in blitzplus:
and here is the code in blitzmax:
Having not used blitzmax before I am sure there must be a better way of doing what I did in blitzplus which is of comparable speed.
Thanks,
I just downloaded the demo of blitzmax to compare the speed of drawing individual pixels with blitzmax as opposed to blitzplus.
Looking through the documentation, and reading some of the posts here I could find only one way of writing pixel information directly to the backbuffer().
This was - grab pixmap of screen, writepixel to the pixmap, drawpixmap to the screen, release grabbed pixmap.
Comparing this, for the same area of the screen (100 pixels by 100 pixels), to a test done in blitzplus on the same computer, gave a result which showed the blitzplus is a lot faster for individual pixel plotting.
I'd like to know if the method I'm using is flawed to compare the speed of the two languages with respect to pixel plotting.
The speed difference, on an old machine, was 53 frames per second (about 20 millisecs per frame) in blitzmax compared to 145 frames per second (about 7 millisecs per frame) in blitzplus.
Here is the code in blitzplus:
Graphics 800,600,32 Repeat Cls LockBuffer For pixel=1 To 10000 WritePixelFast pixel/100,pixel Mod 100,pixel Next UnlockBuffer fpscount=fpscount+1 If MilliSecs()-fpstime>1000 Then fpstime=MilliSecs() fps=fpscount fpscount=0 EndIf Text 500,0,"FPS:"+fps Flip False Until KeyDown(1) End
and here is the code in blitzmax:
Graphics 800,600,32 Repeat fpscounter=fpscounter+1 If MilliSecs()-fpstime>1000 Then fpstime=MilliSecs() fps=fpscounter fpscounter=0 EndIf Cls pixmap=GrabPixmap(0,0,101,101) For pixel=1 To 10000 WritePixel pixmap,pixel / 100,pixel Mod 100,pixel Next DrawPixmap pixmap,0,0 Release pixmap DrawText "FPS:"+fps,500,0 Flip False Until KeyHit(key_escape) End
Having not used blitzmax before I am sure there must be a better way of doing what I did in blitzplus which is of comparable speed.
Thanks,