>
> > Thank you so much. I need know the state of keyboard as fast=20
> > as I can in fltk. So I think get_key is what I need.
>
> Well, there may be some specific reason why in your application, but in
> general in a GUI implementation using "out of band" data is exactly what
> you DO NOT need...
>
> Most of the time it is important that you process all the events from
> the server queue in exactly the order that they occur, or the context
> will be wrong at the point the event is processed.
>
> E.g., you might be using some keyboard modifiers to adjust the mouse
> behaviour - but if you get mouse events through the event queue but read
> the keyboard directly, then they will not be matched up and your
> modifiers will not work...
>
> In general, you want to take everything through the queue so that things
> happen in the order that the user expects, or Bad Things can happen.
>
> It is important that you don't overfill the event queue though,
> especially on set ups with more limited server bandwidth, or the user
> experience will be seriously degraded.
> So if the rendering falls behind because you are drawing more frames
> than the server can render, you need to reduce your frame rate until
> something sustainable is attained.
> I suspect that this is the state you were in, from your description of
> the problem.
>
>
>

Thanks. I benifit from it greatly.

Yes, I want to control some 2D sprites with mouse or keyboard in real time and 
interact with the fast animation in real time as fast as I can. It seemed that 
this is not easy to implement in fltk.

I am not sure what happened in xserver. As a opengl-based reference, glxgears 
give about 4000fps.

To check the fps, I insert a gettimeofday to the test code:
     struct timeval tv;
     gettimeofday(&tv, 0);
     printf("%f\n", tv.tv_usec*1e-6);
The DEALY is set to 0.0001. The result like is:
0.867836
0.867938
0.868031
0.868133
0.868232
0.868330
0.868437
0.868529
0.868631

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to