[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] events + openGL
how about just saying right after pygame.init():
then later pygame.event.get() won't have to iterate
through a long list of MOUSEMOVEs.
--- Pete Shinners <email@example.com> wrote:
> > pygame.event.pump() # tried this to get it
> working.. no success tho
> > event_list =
> > for event in event_list:
> > if event.type == QUIT: finished = 1
> > elif event.type == KEYDOWN:
> > if event.key == K_ESCAPE:
> > print "finished"
> > finished = 1
> > elif event.type == MOUSEBUTTONDOWN:
> > events.mouseClicked(event.pos)
> heya frank, sorry i haven't had time to look into
> your little
> sample myself. but here are some things that come to
> my mind
> just looking at your code...
> first, there's no need to call event.pump() if you
> are using
> any of the other event queue checking functions. the
> only time
> you need to make the pump() call is when you aren't
> anything else with the event queue. in any case, it
> hurt anything for you to make both calls.
> another thing that may (or may not) be a problem is
> the use
> of your "get" with the list of desired event types.
> the event
> queue is always getting MOUSEMOVE and other
> events from SDL. calling event.get() will only get
> types of events off of the queue. the other events
> are still
> sitting on the queue. you mention after awhile you
> stop getting
> the mouseclick events, perhaps the event queue is
> just getting
> "full" and there's no room for more. since you
> already check
> for different events with your "if" and "elif"
> cases, just switch
> the call to "pygame.event.get()" which will just get
> all the
> available events off the queue. not sure if thats
> really a problem,
> but i can assume there is some internal limit to the
> SDL event
> queue size.
> maybe this can get things going for you?
> pygame mailing list
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
pygame mailing list