Newbe question on mouse input / MaxFPS

Newbe question on mouse input / MaxFPS

Post by Anas Moale » Mon, 20 Jan 2003 04:05:02



Hi all,

I've spent some time coding in OpenGL and SDL.
I've got a 3D scene where I can fly around. The mouse allows to look around
(triggers glRotatef). Mouse pointer is set to invisible and each redraw the
mouse is warped to the center of the screen, so the difference between
mousemotion and screen center is given to glRotatef.

My problem is: When setting a maximum fps lower than 120 the mouse movement
is not reported cleanly (?). The camera then rotates jumpy (or doesn't
rotate at all). Translation however works fine (!) (keyboard input, not
mouse) over SDL_GetKeyState.

I have done time based movement using SDL_GetTime and thus redrawing the
scene every time a certain time intervall t has passed, where t =
1000/MaxFps

Any ideas ?

 
 
 

Newbe question on mouse input / MaxFPS

Post by Wolfgang Draxinge » Mon, 20 Jan 2003 06:52:57



> My problem is: When setting a maximum fps lower than 120 the mouse movement

Do you mean the vertical refresh rate of your graphics card, or an
internal limitation of your program? On this it depends, what cause it.

--
+------------------------------------------------+
| +----------------+ WOLFGANG DRAXINGER          |
| | ,-.   DARKSTAR | lead programmer             |

| | `-' / GAMES /                                |
| +----+''''''''     http://www.darkstargames.de |
+------------------------------------------------+

 
 
 

Newbe question on mouse input / MaxFPS

Post by Anas Moale » Mon, 20 Jan 2003 07:02:42


Quote:> > My problem is: When setting a maximum fps lower than 120 the mouse
movement
> Do you mean the vertical refresh rate of your graphics card, or an
> internal limitation of your program? On this it depends, what cause it.

Internal limitation.
Not the vertical refresh rate but the number of times my DrawScene is called
in one second.
For example I call DrawScene every X milliseconds where X = 1000/MaxFps.
MaxFps is set by the user and is the maximum fps I mentioned above.
 
 
 

Newbe question on mouse input / MaxFPS

Post by Wolfgang Draxinge » Mon, 20 Jan 2003 09:56:02



> My problem is: When setting a maximum fps lower than 120 the mouse

> movement

>>Do you mean the vertical refresh rate of your graphics card, or an
>>internal limitation of your program? On this it depends, what cause it.

> Internal limitation.
> Not the vertical refresh rate but the number of times my DrawScene is called
> in one second.
> For example I call DrawScene every X milliseconds where X = 1000/MaxFps.
> MaxFps is set by the user and is the maximum fps I mentioned above.

You shouldn't call draw scene based on a timer function, since this can
desync with your GPU which will slow down your whole program.
When swaping the buffers the programm is blocked until the GPU is ready
for the next render cycle. Usually this takes the time of the V-Sync.
Now when your rendering system is slowed down by a limiter you will
probably miss the right point to fire the SwapBuffers command.

Usually the programm is limited to the V-Sync anyway, so you don't have
to limit yourself.

When starting OpenGL I thought, limit the render cycle to 30 FPS, more
the eye can't see and the performance rises. The inverse happend, since
I missed the right right render cycle time

--
+------------------------------------------------+
| +----------------+ WOLFGANG DRAXINGER          |
| | ,-.   DARKSTAR | lead programmer             |

| | `-' / GAMES /                                |
| +----+''''''''     http://www.darkstargames.de |
+------------------------------------------------+

 
 
 

Newbe question on mouse input / MaxFPS

Post by Anas Moale » Mon, 20 Jan 2003 10:29:04


What do you suggest?
Without FPS limitation the speed rises and falls between 60 and 170 FPS
depending on the objects that are drawn.
 
 
 

Newbe question on mouse input / MaxFPS

Post by Will » Mon, 20 Jan 2003 11:20:23


Quote:>What do you suggest?
>Without FPS limitation the speed rises and falls between 60 and 170 FPS
>depending on the objects that are drawn.

What's the problem with that?  Just ask the system how long the last frame took
to render, and move your objects according to the time step.  That way you
don't have to artificially limit the frame rate, and it will always go as fast
as it can, regardless of the hardware used.
------------------
Woooogy
I have to go back in time to pretend to be myself when I tell myself to tell
myself, because I don't remember having been told by myself to tell myself.  I
love temp*mechanics.
 
 
 

Newbe question on mouse input / MaxFPS

Post by Anas Moale » Tue, 21 Jan 2003 06:45:15


Quote:> What's the problem with that?  Just ask the system how long the last frame
took
> to render, and move your objects according to the time step.  That way you
> don't have to artificially limit the frame rate, and it will always go as
fast
> as it can, regardless of the hardware used.

Aah, now thats a point (already tried it)! Thx to all.
 
 
 

1. Newbe scanner question.

Newbe scanner question.
What causes the scanned images to have jagged (stair steps) edges?
I have tried everything to eliminate it but It will not go away.
At 300dpi its very apparent, at 1200dpi its better, at 2400 Its somewhere in
between.
I hope you can explain this phenomena as no one else I ask can.

2. Transparant EPS

3. SLIM Newbe Question

4. Making 3D letters with povray 2.2

5. Newbe Question

6. Quark Disappearing Guidelines

7. Newbe scanner question.

8. seeking advice on choosing/rendering

9. Attn : All Stupid newbe question 2 & 3 : )

10. help newbe animation question

11. Newbe question: graphics in C++

12. Newbe Questions...

13. Newbe question