Re: Utilising Retina display on laptops

244 views
Skip to first unread message

Nathan

unread,
Dec 19, 2012, 1:49:06 AM12/19/12
to pyglet...@googlegroups.com
Not implemented, as far as I know.  What happens for you on your rMBP?

~ Nathan


On Tue, Dec 18, 2012 at 4:43 PM, Ayush Jha <ayush...@gmail.com> wrote:
Hello, I'm new to this library and I'm wondering if there's any way to take advantage of Retina screens, such as the one on the new Macbook Pro.
Is there a flag or mode I need to set to make it work, or is this functionality not implemented yet?


--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pyglet-users/-/fxcZmKtOLg0J.
To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.

Adam Kidder

unread,
Dec 19, 2012, 10:06:36 PM12/19/12
to pyglet...@googlegroups.com
Pyglet on a rMBP just operates in low DPI mode. Pyglet windows open in 2x resolution and everything is scaled up by a factor of 2.

Adam Bark

unread,
Dec 20, 2012, 4:20:05 AM12/20/12
to pyglet


On Dec 19, 2012 12:15 AM, "Ayush Jha" <ayush...@gmail.com> wrote:
>
> Hello, I'm new to this library and I'm wondering if there's any way to take advantage of Retina screens, such as the one on the new Macbook Pro.
> Is there a flag or mode I need to set to make it work, or is this functionality not implemented yet?

What happens when running pyglet on a retina display? What do you mean by "take advantage of"?

Tristam MacDonald

unread,
Dec 20, 2012, 8:28:06 AM12/20/12
to pyglet-users
Retina displays operate in a 'High DPI' mode by default, where the reported resolution is half the native resolution, and every pixel is effectively doubled.

To get the display to run at native resolution requires a hack. I think what Pyglet needs to do is to become aware that it is running in high-DPI mode, and allocate a double-density rendering context. I am not however aware of how to do that.

Adam Bark

unread,
Dec 20, 2012, 2:08:04 PM12/20/12
to pyglet

If that's how all other programs work on it what is the advantage of using the native resolution? Presumably you won't be able to resolve pixels and it will look wrong on any other screen.

Tristam MacDonald

unread,
Dec 20, 2012, 2:48:54 PM12/20/12
to pyglet-users
On Thu, Dec 20, 2012 at 2:08 PM, Adam Bark <adam....@gmail.com> wrote:
If that's how all other programs work on it what is the advantage of using the native resolution? Presumably you won't be able to resolve pixels and it will look wrong on any other screen.

No, not really. If you naively allocate an OpenGL context, it will be initialised at the 'fake' low-res, and all of your pixels will be doubled when it is composited to the screen - basically, you lose all the advantages of having a retina display.

A retina-aware app needs to understand Cocoa's UI scaling, and resize its rendering to fit.

A simple solution would be to call [NSOpenGLView setWantsBestResolutionOpenGLSurface:YES], and then expose the value of [NSScreen backingScaleFactor] to the pyglet application, so it can scale its drawing to suit.

Reply all
Reply to author
Forward
0 new messages