I was beginning my foray into GL programming and ended up with this as my first test program:
WARNING!: Bright colours contained within, may well nauseate.
I get a constant 10ms/frame (100fps) regardless of whether I use 16bit mode or 32 bit mode.
Tested the same on my Dad's PC while I was at his house, he has an Athlon64 3200 and a Radeon Atlantis (9800 128MB I think).
He gets 8ms in 16bit mode and 16 in 32bit mode.
Could some of you guys test this and tell me what your specs are and what you get?
Const SCREENWIDTH = 800 Const SCREENHEIGHT= 600 Const HALFSCREENWIDTH:Float = SCREENWIDTH / 2.0 Const HALFSCREENHEIGHT:Float = SCREENHEIGHT/ 2.0 bglCreateContext(SCREENWIDTH, SCREENHEIGHT, 32, 1000, BGL_FULLSCREEN|BGL_BACKBUFFER|BGL_DEPTHBUFFER) bglSetSwapInterval 0 glShadeModel(GL_SMOOTH) Global QuadList:TList = New TList Type TQuad Field X : Float Field Y : Float Field Width : Float Field Height : Float Method Update() X = X + RndFloat()-RndFloat() Y = Y + RndFloat()-RndFloat() End Method End Type SeedRnd MilliSecs() For Local t = 1 To 10000 Local tempQuad:TQuad = New TQuad tempQuad.X = Rnd!(0.0, SCREENWIDTH) tempQuad.Y = Rnd!(0.0, SCREENHEIGHT) tempQuad.Width = Rnd!(16,64) tempQuad.Height = Rnd!(16,64) QuadList.AddLast(tempQuad) Next Local LastTime:Int Local TimeDiff : Int Local StartTime:Int Local timecount:Int = 0 Local counter :Int =0 HideMouse() While Not KeyDown(KEY_ESCAPE) StartTime = MilliSecs() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) For Local a:TQuad = EachIn QuadList a.Update() DrawQuad(a.X, a.Y, a.Width, a.Height) Next bglSwapBuffers() TimeDiff = MilliSecs()-StartTime TimeCount :+TimeDiff counter :+ 1 Wend ShowMouse() Print timecount Print counter Print TimeCount/counter +"ms/frame" Print "FPS: "+1000/(TimeCount/counter) bglDeleteContext() QuadList.Clear() QuadList = Null Function DrawQuad( qX:Float, qY:Float, qWidth:Float, qHeight:Float) qX = (qx-HALFSCREENWIDTH)/HALFSCREENWIDTH qY = -((qY-HALFSCREENHEIGHT)/HALFSCREENHEIGHT) qWidth = qWidth/HALFSCREENWIDTH qHeight = qHeight/HALFSCREENHEIGHT glBegin(GL_QUADS) glColor3f(1.0, 0.0, 0.0) glVertex3f(qX, qY - qHeight, -1.0) glVertex3f(qX + qWidth , qY - qHeight, -1.0) glColor3f(1.0, 1.0, 0.0) glVertex3f(qX + qWidth, qY, -1.0) glVertex3f(qX, qY, -1.0) glEnd() End Function
WARNING!: Bright colours contained within, may well nauseate.
I get a constant 10ms/frame (100fps) regardless of whether I use 16bit mode or 32 bit mode.
Tested the same on my Dad's PC while I was at his house, he has an Athlon64 3200 and a Radeon Atlantis (9800 128MB I think).
He gets 8ms in 16bit mode and 16 in 32bit mode.
Could some of you guys test this and tell me what your specs are and what you get?