[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] After resize of an OpenGL window, mouse is still clamped to old size?



Rene Dudfield wrote:

innaresting.

Which version of SDL, and pygame is this with? Which OS?


Not sure about the SDL version, it's the binary release of PyGame 1.6 for Win32, so whichever SDL was built into that. Same effect seen with PyGame 1.5.6 binary release. Running on Python 2.3 on Win2K in all cases.

Have fun,
Mike

Cheers.

On Sat, 19 Feb 2005 23:11:18 -0500, Mike C. Fletcher
<mcfletch@xxxxxxxxxx> wrote:


I'm going through all of the OpenGLContext tests with the PyGame context
to catch any bit-rot that may have accumulated over time before the
2.0.0 final release.

When a VIDEORESIZE event comes in we're doing this:

   def PygameVideoResize(self, event):
       """Handle the resize of the window"""
       sizex, sizey = event.size
       self.ViewPort(sizex, sizey)
       self.triggerRedraw(1)
       return 1

where self.ViewPort lets (Py)OpenGL know the new area into which to draw
(it properly draws to the new extents of the window) and triggerRedraw
just tells OpenGLContext to redraw the next chance it gets.  The problem
is that after the resize, the mouse events all report their position as
being clamped to 299,299 (the original size of the window, even though
it's now much larger).

Is there something I need to call to let PyGame know that, for the mouse
events, the screen is now larger? Haven't found anything in the docs
that would suggest it. Doing a set_mode doesn't seem appropriate AFAICS.


...

________________________________________________
 Mike C. Fletcher
 Designer, VR Plumber, Coder
 http://www.vrplumber.com
 http://blog.vrplumber.com
                             PyCon is coming...