[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] events + openGL



On Sun, Jul 15, 2001 at 08:48:37PM -0700, Peter Nicolai wrote:
> how about just saying right after pygame.init():
> 
> pygame.event.set_blocked(range(NUMEVENTS))
> pygame.event.set_allowed([KEYDOWN,QUIT,MOUSEBUTTONDOWN])
> 
> then later pygame.event.get() won't have to iterate
> through a long list of MOUSEMOVEs. 
I tried that along with pete's hint of getting the whole event queue (which
doesn't make sense at all after this blocking stuff..but I just wanted to
double-check it to work ;).. and it works fine now.
I think I must have misinterpreted the behavior of the pump() call, as I myself
already thought about a full event queue. This was actually the reason for me
to introduce this call to the pump function. From the docs:
Pumping the message queue is important if you are not getting events off the message queue. The pump will allow pyGame to communicate with the window manager, which helps keep your application responsive, as well as updating the state for various input devices.
So maybe it helps for future beginners like me to add something like: This will
NOT ;) empty the event queue
:-)
And btw.. isn't there any function to flush that queue totally down the toilet?


Now on to another slightly less important problem I got. Maybe there's someone
here with some experience with OpenGL select buffers (I know at least pete's
got an idea what it is ;). My picking stuff works correctly now (and even as
often as I want it to work ;) but I don't know why every time I use the select
buffer there will be a flicker in my scene? I thought that by calling
glRenderMode(GL_SELECT) there won't be drawn anything on screen anyways? Now
what wonders me even more is the way everything _should_ go:

 1. event check -> mouse click
 2. picking method to determine which map tile was chosen
    (this step doesn't use any flips() or updates()!)
 3. normal drawing of the map

So why does the screen flicker? Afaik there shouldn't be changed anything in
the scene unless I call pygame.display.flip() which I'll only do after drawing
the final map. Without the picking method it doesn't flicker. So I assume it's
got something to do with that (heh.. very clever I know.. but I don't have any
other clue at hand ;)

-- 
Raiser, Frank aka CrashChaos
IRC: 141.30.225.9:6667 #United-Programmers

"Any sufficiently advanced technology is indistinguishable from magic."
    -- Arthur C. Clarke
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org