271
GLBasic - en / Re: Iphone slow FPS and problem with vectors
« on: 2009-Sep-08 »
Thanks guys,
with your changes the performance has boosted
I got now the expected frame rate (nearly 60fps) The DrawCircle function was the botleneck.
I undestand MOUSESTATE should only call once in the main loop (but is correct to loop trought the entire Mouse matrix) correct me if I?m wrong.
I?m not getting this.
If I have several on screen buttons, they could be pressed at the same time.
So, is not correct to store each iteration all the different mouses positions like this way?
How should I assign the mouses values?
with your changes the performance has boosted

I suspect drawing the circle is the cause - comment it out for a while and see. If it is, I would suggest using a sprite for that.
I got now the expected frame rate (nearly 60fps) The DrawCircle function was the botleneck.
Also..you might be calling MOUSESTATE too many times, these are only needed once in the main loop.
I undestand MOUSESTATE should only call once in the main loop (but is correct to loop trought the entire Mouse matrix) correct me if I?m wrong.
Furthermore, SETACTIVEMOUSE should only be needed once per run, and not looped.
I?m not getting this.
If I have several on screen buttons, they could be pressed at the same time.
So, is not correct to store each iteration all the different mouses positions like this way?
How should I assign the mouses values?
Code: (glbasic) [Select]
//=============================================================================
SUB MouseHANDLER:
//=============================================================================
FOR imouse% = 0 TO nummouse%-1
SETACTIVEMOUSE imouse%
MOUSESTATE mx%, my%, b1%, b2%
Mouse[imouse].x=mx
Mouse[imouse].y=my
Mouse[imouse].active=b1
NEXT
ENDSUB