This is a little 2d stress test, with fps counter. Install to any dir and run the .exe, all media is included.
[Link fixed. Thanks Amon. :)] http://www.excess.eclipse.co.uk/V2D_StressTest.exe - 1.7mb, proper installer this time around.
Here's the same demo, but with masking on the texture quad. http://www.excess.eclipse.co.uk/VividGL_2DExample8.zip (.exe only, needs demo 1)
Just copy the .exe and new image into the dir you installed the above demo.
It blits 1,000 32x32 2d(Rendered using 3d hardware) per Frame. Also it blits a texture quad you can resize with the mouse in real time.
On my p-800, budget 64bit g5, I get around 300fps. An average of 300,000 blits per second.
I did a quick rewrite in b3d, using regular b3d rects and it gets 63fps. And that's not including the textured real time scaling quad, which isn't possible with b3d's 2d funcs.
Also shows how textures in vivid are 2d and 3d, as the same texture could be used on a model without altering.
Source code for the demo is
;
;2D Stress test.
;
Include "Includes\VividGL_Lite.bb"
Graphics_Init(640,480,16,2) ;-- [ Setup screen
Graphics_Setbuffer Graphics_Back() ;-- [ Set our backbuffer.
test=Texture_Load ("Test.Jpg")
If test=0 RuntimeError "Could not load test.jpg, please re-install"
Texture_Blend test,1
Texture_Rotate test,0,0,180 ;3D Rotation instead of 1d.
Const Rects_Per_Frame=1000 ;How many rects to render each frame.
While Not KeyDown(1)
Render_Cls(False)
Lock_2D()
Render_Color(200,200,200,1)
Render_Begin()
j=0
While j<Rects_per_Frame:j=j+1
Render_QuadFast(Rnd(640),Rnd(480),32,32)
Wend
Render_End()
Texture_Push()
Texture_Activate test,0
Render_Quad(100,100,MouseX()-100,MouseY()-100)
Texture_Pop()
Unlock_2D()
;-Work out frames per second. You don't have to do this.
If ms>ls
ls=ms+1000
fps=frames
frames=0
Else
frames=frames+1
ms=MilliSecs()
EndIf
;---
Text_Out(1,1,fps,0,0)
Render_Flip(False)
Wend
|