You can use the enclosed short(ish) program to test some speed results for your OpenGL 2D graphics.
These are my results on a G3 300MHz iBook.
[EDIT] This is all in 32-bit color
800x600 - no clearscreen, computing and printing fps only - 17fps
640x480 - no clearscreen, computing and printing fps only - 29fps
320x240 - no clearscreen, computing and printing fps only - 59fps
800x600 - with clearscreen, computing and printing fps - 14.5fps
640x480 - with clearscreen, computing and printing fps - 23fps
320x240 - with clearscreen, computing and printing fps - 55fps
640x480 - with 10 128x128 zooming/rotating/tinted objects in LIGHTBLEND - 7fps
In the non-object tests there is no other processing occuring in the loop other than the screen flip (which takes quite a bit of processing itself!). Throwing around 10 128x128 objects drops the framerate to about 6-7 frames per second at 640x480. Eeeeeeee!
Oh well. See what results you can get with this test program - you can just comment out the main loop stuff except the fps calculations in order to get the results consistent with those above. And just take out the Cls inside the loop for the non-clearing version. I KNOW that on more modern hardware the framerate is probably amazing.
You'll need to create a 128x128 (or so) image to use and change the incbin and loadimage commands in the source.......
Give it a try, let us know your results and on what hardware :-)
These are my results on a G3 300MHz iBook.
[EDIT] This is all in 32-bit color
800x600 - no clearscreen, computing and printing fps only - 17fps
640x480 - no clearscreen, computing and printing fps only - 29fps
320x240 - no clearscreen, computing and printing fps only - 59fps
800x600 - with clearscreen, computing and printing fps - 14.5fps
640x480 - with clearscreen, computing and printing fps - 23fps
320x240 - with clearscreen, computing and printing fps - 55fps
640x480 - with 10 128x128 zooming/rotating/tinted objects in LIGHTBLEND - 7fps
In the non-object tests there is no other processing occuring in the loop other than the screen flip (which takes quite a bit of processing itself!). Throwing around 10 128x128 objects drops the framerate to about 6-7 frames per second at 640x480. Eeeeeeee!
Oh well. See what results you can get with this test program - you can just comment out the main loop stuff except the fps calculations in order to get the results consistent with those above. And just take out the Cls inside the loop for the non-clearing version. I KNOW that on more modern hardware the framerate is probably amazing.
You'll need to create a 128x128 (or so) image to use and change the incbin and loadimage commands in the source.......
'Bouncy images with gravity, color tint, rotation, zoom and masking objects:Int=10 maxxspeed:Int=10 maxyspeed:Int=10 Const blendmode:Int=LIGHTBLEND gravity:Float=0.3 maxspinspeed:Float=10 maxzoomspeed:Float=2 Const gwid:Int=640 Const ghig:Int=480 Const iflags:Int=0 'Image type Graphics gwid,ghig,0 Incbin "ball.png" img=LoadImage("incbin::ball.png",iflags) wid=ImageWidth(img) hig=ImageHeight(img) halfwid:Int=wid/2 halfhig:Int=hig/2 Rand MilliSecs() Global objpos:Float[objects,2] Global movpos:Float[objects,2] Global col:Byte[objects,3] Global spin:Float[objects,2] Global zoom:Float[objects,2] Local xadd:Float Local yaad:Float For Local o:Int=0 To objects-1 xadd=Rnd(maxxspeed*2)-maxxspeed yadd=Rnd(maxyspeed*2)-maxyspeed objpos[o,0]=maxxspeed+halfwid+Rnd(639-wid-maxxspeed-maxxspeed) objpos[o,1]=maxyspeed+halfhig+Rnd(479-hig-maxyspeed-maxyspeed) movpos[o,0]=xadd movpos[o,1]=yadd col[o,0]=128+Rnd(127) col[o,1]=128+Rnd(127) col[o,2]=128+Rnd(127) spin[o,0]=Rnd(359) spin[o,1]=Rnd(maxspinspeed) zoom[o,0]=Rnd(359) zoom[o,1]=Rnd(maxzoomspeed) Next SetColor $ff,$ff,$ff SetImageHandle img,wid/2,hig/2 SetRotation 0 SetScale 1,1 Local counter:Int=MilliSecs() Local passage:Int=0 Local m:Int=0 Local fps:Float=0.0 Repeat Cls SetBlend blendmode For o=0 To objects-1 If ((objpos[o,0]<=maxxspeed+halfwid) Or (objpos[o,0]>=gwid-halfwid-maxxspeed)) movpos[o,0]=-movpos[o,0] EndIf If ((objpos[o,1]<=maxyspeed*4+halfhig) Or (objpos[o,1]>=ghig-halfhig-maxyspeed*4)) movpos[o,1]=-movpos[o,1] EndIf objpos[o,0]=objpos[o,0]+movpos[o,0] objpos[o,1]=objpos[o,1]+movpos[o,1] SetRotation spin[o,0]+(o*10) spin[o,0]=spin[o,0]+spin[o,1] SetScale 1.5*Sin(zoom[o,0]+o*30),1.5*Sin(zoom[o,0]+o*30) zoom[o,0]=zoom[o,0]+zoom[o,1] SetColor col[o,0],col[o,1],col[o,2] DrawImage img,objpos[o,0],objpos[o,1] movpos[o,1]=movpos[o,1]+gravity Next m=MilliSecs() passage=m-counter fps=1000.0/passage counter=m SetRotation 0 SetScale 1,1 SetBlend SOLIDBLEND DrawText fps+"fps",0,0 Flip Until KeyHit(KEY_ESCAPE) End
Give it a try, let us know your results and on what hardware :-)