[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] After resize of an OpenGL window, mouse is still clamped to old size?
- To: pygame-users@xxxxxxxx
- Subject: [pygame] After resize of an OpenGL window, mouse is still clamped to old size?
- From: "Mike C. Fletcher" <mcfletch@xxxxxxxxxx>
- Date: Sat, 19 Feb 2005 23:11:18 -0500
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Sat, 19 Feb 2005 23:12:16 -0500
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: Mozilla Thunderbird StumbleUpon/1.994 (Windows/20041201)
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.
Thanks for any pointers,
Mike
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
PyCon is coming...