I finally managed to run a quick test of my own. I must say that it is VERY good for that low res feeling.
I do have two concerns however.
1 The line function sometimes has breaks in the results.
2 Do you think you could impliment a faster DrawScaledBlock function with powers of 2? Ex drawing a 320x240 chunk to a 640x480 buffer. This is useful for making pixel perfect low res work. Testing with FRAPS the big hit seems to be here, not in the drawing functions, which are really quite good.
Here is my small little test...
' test for Zawran's screen buffer library
SuperStrict
Include "Framework.bmx"
'' first draw everything to a small block, then draw the small block to a larger screen block
Global base_buffer:zImageBuffer = zImageBuffer.make(160, 120)
Global scaled_buffer:zImageBuffer = zImageBuffer.make(640, 480)
Graphics(640, 480, 32)
' base rotation angle please
Global rotz:Float = 0
'radius for the star please
Global radius:Float = 64
While Not KeyDown(KEY_ESCAPE)
base_buffer.clear()
scaled_buffer.clear()
If rotz < 360
rotz:+1
Else
rotz:-360
End If
'draw some fun horizontal lines please
For Local y:Float = 0 To 239
'blend 255,0,255 to 255,127,0
Local p:Float = Cos((y * 4) + (rotz * 4))
Local r:Float = 255
Local g:Float = interpolate(0, 127, p)
Local b:Float = interpolate(255, 0, p)
base_buffer.line(0, y, 160, y, r, g, b)
Next
' draw a rotating star please
Local scale:Float = Sin(rotz)
For Local I:Int = 0 To 4
Local r:Byte = Rand(0, 255)
' draw arm one
Local max_radius:Float = radius * scale + 5
Local x1:Float = 80 + Cos(i * 144 + rotz) * max_radius
Local x2:Float = 80 + Cos((i + 1) * 144 + rotz) * max_radius
Local y1:Float = 60 + Sin(i * 144 + rotz) * max_radius * scale
Local y2:Float = 60 + Sin((i + 1) * 144 + rotz) * max_radius * scale
base_buffer.line(x1, y1, x2, y2, 0, 0, 255)
Next
'flip and resize please
base_buffer.drawScaledBlock(scaled_buffer, 0, 0, 4.0, 4.0)
scaled_buffer.blitToScreen()
Flip
Wend
' yes please
Function interpolate:Float(num_1:Float, num_2:Float, p:Float)
Local dif:Float = num_2 - num_1
Return num_2 - (dif * p)
End Function