From: Brian P. <br...@pr...> - 2000-05-07 18:22:12
|
Dave Morse wrote: > > Dave Morse writes: > > I'm experiencing some bad behavior in a game I'm writing. > > > > My problem is that if Mesa draws my scene faster than 30 Hertz then I > > never get any x events. So as far as my client can tell, the mouse never > > moves again. > > > > All other applications recieve X events normally. > > > > If I comment out the Mesa drawing code, then I get X events normally. > > > > During the locked times, top reports that X is consuming 90% cpu time. > > > > My machines are K6/450 and PII/333 running software mesa 3.3 beta. > > > > Can someone explain why X is so studiously ignoring the event sending half > > of its job, in favor of the rendering half? > > > > Any ideas for a solution? > > I should also mention that this is a second pass at implementing the > game. The first pass was single-player, no network code, its main loop > looked like: > > while (1) { > check_x_events(); > update_game_state(); > draw_window(); > } > > The new version has a client and a server communicating through udp > packets, and the client loop looks like: > > while (1) { > select( ...X_Windows, UDP... ) /* block for any input */ > if (FD_ISSET( X_Windows )) > { > check_x_events(); > send_mouse_position_to_server(); > } > if (FD_ISSET( UDP )); > { > read_game_state(); > draw_window(); > } > } > > The simpler prototype loop had no problems getting X events. I have no idea what check_x_events() is doing, but I think that should probably consume all pending events, not just one at a time. -Brian |