There is a couple of things that you need to understand in order to get your application Retina Ready, and it's possible with RS2012r2.1 (download the demo of Shine from http://www.ohanaware.com/shine
) to see a Retina Ready Real Studio application.
#1 The current IDE is still a Carbon based application, while there are things that you can do to make a Carbon application Retina Ready, I have not tried as Cocoa is the way forward (not to mention that there are Sandboxing bugs with Carbon apps). So the IDE as it stands is NOT Retina Ready.
#2 The Cocoa Framework is Retina Ready, but it may still require extra work on your behalf.
#3 Adding the plist key to a Cocoa made application via an IDE Script of wrapping tool (such as App Wrapper), will tell the OS to use Retina when available.
All system supplied controls draw in Retina. If you are using a custom control based on a Canvas, as long as you use the graphics functions in the paint event, it will draw in Retina. If you are drawing images in your canvas, you need to draw a double sized image down. So if you're drawing a 32x23 image, it needs to be 64x64. For most things, this works well, however icons and such may not draw quite so elegantly and in which case you should figure out if you _need_ to draw the high resolution image in the first place. This can be done by using a declare and some structures.
Declare function CGContextConvertRectToDeviceSpace lib kLibrary (context as integer, inRect as CGRect ) as CGRect
Dim CGContextRef as integer = g.handle( graphics.HandleTypeCGContextRef )
Dim userRect as CGRect = CGRectMake( 0, 0, regular.width, regular.Height )
Dim deviceRect as CGRect = CGContextConvertRectToDeviceSpace( CGContextRef, userRect )
if deviceRect.area.Width = regular.Width then
g.drawPicture regular, X, y, w, h, 0, 0, regular.Width, regular.Height
g.drawPicture hiDPIVersion, x, y, w, h, 0, 0, hidpIVersion.Width, hidPIVersion.height
You'll need to create a structure with 4 singles, called CGRect.ToolBars:
If you are using toolbars, you can pass them 64x64 images as the icons.ListBoxes:
RowPicture is not retina ready, to get retina icons in a listbox, you need to override the cellTextPaint event and include code for drawing the icon and then text.Menus:
This one is tricker, I found the solution was to use the MBS plug-in (There's an example included with the plugin), where it intercepts the menu creation, extracts the NSImage and set's the size on the NSImage. I think you might even be able to do this with the MacOSLib, as basically you're registering to receive a Notification via the NSNotificationCenter "NSMenuDidAddItemNotification", then acting upon it.
This should be enough to get you started, if you are using your own declare library for drawing graphics, then double check what functions you use, as Apple warn not all APIs are Retina Ready.The best solution for drawing images:
Is to use either the MBS or MacOSLib or your own declares to get a NSImages, as the OS will then pick the correct version for you, with no extra work on your behalf.
I'm thinking of writing this all up into a guide to help others get their apps Retina Ready. If you have any questions then please feel free to ask.