ASPiK SDK
|
VSTGUI4 has built in support for Hi-DPI (retina) displays, also called simply "HiDPI" and to use it will require a bit of work on the graphics end. The PluginGUI object already supports GUI scaling and you can find the code for that in two functions: PluginGUI::scaleGUISize( ) which is called when the user engages the built-in scaling factor (see SDK topic for GUI Scaling) from the GUI control. Scaling is also done in PluginGUI::createGUI( ) which is called when the user opens the GUI. If you look at the scaling code you can see that it will scale from 65% to 150% using the built-in scaling control. If the scaling goes outside of this bound, lower than 65% or higher than 150%, then the GUI will be difficult to read (too small) or grainy (too large) due to the resampling that occurs automatically in VSTGUI4.
If you would like to support Hi-DPI graphics, you can do so by supplying new graphics files with new file names. VSTGUI4 will use the file name to figure out how to do the scaling. The good news is that you only really need to add the GUI graphics files, and manually set the "zoom factor" to 2.0 (see code). However it can be a bit tricky, especially when testing. The following is culled from the VSTGUI4 user's forum which you should definitely consult when working with advanced VSTGUI4 topics. The forum is at: http://sdk.steinberg.net/
First, make sure you have a Hi-DPI monitor and it is set up correctly - this can be a pain for both Mac and Windows. The user forum states:
Bitmap HiDPI support is as follows:
"The default Bitmap for a scale factor of 1 is just normally named like "MyBitmap.png". For this example, say the bitmap has the size 100x100 pixels. Now if you want to support a scale factor of 2 you create a bitmap with the size of 200x200 pixel and name it "MyBitmap#2.0x.png".
You add both bitmaps to your xml file and that's it. The backend automatically uses the correct bitmap depending on the scale factor."
You can find the thread on this topic here:
https://sdk.steinberg.net/viewtopic.php?f=5&t=335#p1091