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

[pygame] events + openGL



Hi all..
I'm new to this list.. thought it was time now to join it :)

Concerning <Pine.LNX.4.10.10107121541020.24625-100000@infa.abo.fi>:
> Out of pure curiosity I was wondering wether anybody is using OpenGL with
> PyGame for something more serious than rotating a cube on the screen? 
I can report working on a landscape for game-usage in openGL. Unfortunately
it's still pretty slow. But the result is already quite promising. If you're
interested take a look at: http://141.30.225.9/~crashchaos/map.jpg
The source is not online but if anyone wants to take a look or knows of a
good way to improve performance just mail me.


So much about that.. now I got a problem someone might be able to help me
with. I implemented a selectBuffer method (took me quite some while *g*) to
check for the user clicking on one of the map tiles. That method will give me
the coordinates of the chosen map tile. It all works fine but for some strange
reason the event handling code seems to ignore the MOUSEBUTTONDOWN event. I
usually manage to click 2-4 map tiles with a correct result.. then any other
clicks are ignored. This is the event handling code I use:

	pygame.event.pump() # tried this to get it working.. no success tho
        event_list = pygame.event.get([KEYDOWN,QUIT,MOUSEBUTTONDOWN])
        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)

the 'finished' var is just used for a while not finished loop.
The events.mouseClicked(event.pos) is the method with the selectbuffer which
works a few times and then doesn't get called anymore.
Anyone had something similar? or got an idea what I'm doing wrong here?

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

"Your either part of the problem, part of the solution, or part of the
landscape." -Ronin
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org