[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?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] After resize of an OpenGL window, mouse is still clamped to old size?
- From: Rene Dudfield <renesd@xxxxxxxxx>
- Date: Mon, 21 Feb 2005 08:28:34 +1100
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Sun, 20 Feb 2005 16:29:31 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=aJsvvCI5s5+RRN6OANkgJt1c9VtV9zEka08iJ6YQgzt6WAE3ZoyBQR0Em9YgWM20s7qU9Ii4Gx80JlO0ZOmfiqixPS5KRJSVYLatlx2q62+nNH/8eHJlpU+vOIp/2kJEJDlTp3qjqweRQmS49qRgJ+y5XRYqokAXEt8J6fU6tZ4=
- In-reply-to: <42180DE6.1020905@rogers.com>
- References: <42180DE6.1020905@rogers.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
innaresting.
Which version of SDL, and pygame is this with? Which OS?
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.
>
> Thanks for any pointers,
> Mike
>
> ________________________________________________
> Mike C. Fletcher
> Designer, VR Plumber, Coder
> http://www.vrplumber.com
> http://blog.vrplumber.com
> PyCon is coming...
>
>