diff options
author | David Robillard <d@drobilla.net> | 2023-01-08 19:44:41 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-01-08 22:32:09 -0500 |
commit | 426222903151173637c9a49246c182e79618bf83 (patch) | |
tree | 536914cb50c2e6e32f32190d2e3b7c997cb01ca7 /src/mac.m | |
parent | f1524acbd3e708d1764b7f1533d707b22254ae95 (diff) | |
download | pugl-426222903151173637c9a49246c182e79618bf83.tar.gz pugl-426222903151173637c9a49246c182e79618bf83.tar.bz2 pugl-426222903151173637c9a49246c182e79618bf83.zip |
Use ensureHint pattern everywhere
Diffstat (limited to 'src/mac.m')
-rw-r--r-- | src/mac.m | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -1129,18 +1129,10 @@ puglRealize(PuglView* view) const double scaleFactor = [screen backingScaleFactor]; // Getting depth from the display mode seems tedious, just set usual values - if (view->hints[PUGL_RED_BITS] == PUGL_DONT_CARE) { - view->hints[PUGL_RED_BITS] = 8; - } - if (view->hints[PUGL_BLUE_BITS] == PUGL_DONT_CARE) { - view->hints[PUGL_BLUE_BITS] = 8; - } - if (view->hints[PUGL_GREEN_BITS] == PUGL_DONT_CARE) { - view->hints[PUGL_GREEN_BITS] = 8; - } - if (view->hints[PUGL_ALPHA_BITS] == PUGL_DONT_CARE) { - view->hints[PUGL_ALPHA_BITS] = 8; - } + puglEnsureHint(view, PUGL_RED_BITS, 8); + puglEnsureHint(view, PUGL_GREEN_BITS, 8); + puglEnsureHint(view, PUGL_BLUE_BITS, 8); + puglEnsureHint(view, PUGL_ALPHA_BITS, 8); CGDirectDisplayID displayId = CGMainDisplayID(); CGDisplayModeRef mode = CGDisplayCopyDisplayMode(displayId); |