{"id":2592,"date":"2012-07-25T21:29:06","date_gmt":"2012-07-25T11:29:06","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=2592"},"modified":"2012-07-25T21:29:06","modified_gmt":"2012-07-25T11:29:06","slug":"retina","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2012\/07\/25\/retina\/","title":{"rendered":"Retina"},"content":{"rendered":"

\"\"<\/a>So here’s something fun (for me). \u00a0At the start of this week, I received one of those fancy retina-display Macbook Pro laptops.<\/p>\n

While SDL doesn’t currently support the retina display on the Mac, I’ve hacked things together enough to get MMORPG Tycoon 2 running at standard (i.e. 2x) retina resolution. \u00a0And gosh it looks pretty.<\/p>\n

Of course, it required a few modifications to the SDL library and to the core VectorStorm library code, and it would be totally broken for non-retina displays (or retina displays set to any scale factor other than a uniform 2x scale). \u00a0But I’m pleased to at least see what it would look like.<\/p>\n

See, the tricky thing about the retina display is that Apple hasn’t done the usual thing; \u00a0just calling it a higher resolution screen. \u00a0No, they’ve introduced a completely different display concept; \u00a0they’ve introduced the new concept of a “point” (being 1\/72th of an inch, I imagine), and have made it possible to vary how many pixels there are inside that “point”. \u00a0So this retina laptop screen is still 1400×900 points in size, but is made up of vastly more pixels than that. \u00a0And for most GUI tools, this is fantastic; \u00a0it lets all existing layouts continue to work and look like they used to (as they’re expressed in ‘points’), and just lets the layering tools of the GUI draw the contents of those points more precisely by using those extra pixels inside the points.<\/p>\n

OpenGL, though, isn’t based on points. \u00a0It’s based on pixels. \u00a0And so most OpenGL-based programs (this includes browsers like Firefox and Chrome) are stuck in the old world, drawing at one-pixel-per-point, and with OSX scaling those one-pixel-per-point images up to fill their window on the screen, like low-resolution textures.<\/p>\n

It does make things more tricky, now that Apple’s considering GUI elements to be expressed in points, and OpenGL still being in pixels. \u00a0It means that you can no longer (for example) take the window width and pass that into OpenGL as the size you want your viewport to be; \u00a0now you have to pass those dimensions through a conversion routine to figure out how many pixels wide your 800-wide window is, and so how big you need to make your offscreen render buffers.<\/p>\n

Anyhow, I’m not really sure what I’m going to do with this; \u00a0probably just store the build away as an interesting trinket, and wait for the SDL guys to get around to figuring out a proper way to support the retina display. \u00a0I’m sure they’ll think of something eventually. \u00a0And I’ve really got more important stuff to be playing with, than this.<\/p>\n","protected":false},"excerpt":{"rendered":"

So here’s something fun (for me). \u00a0At the start of this week, I received one of those fancy retina-display Macbook Pro laptops. While SDL doesn’t currently support the retina display on the Mac, I’ve hacked things together enough to get MMORPG Tycoon 2 running at standard (i.e. 2x) retina resolution. \u00a0And gosh it looks pretty.…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[4,24,25,3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/so9WK-retina","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2592"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=2592"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2592\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=2592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=2592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=2592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}