aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-08 19:44:41 -0500
committerDavid Robillard <d@drobilla.net>2023-01-08 22:32:09 -0500
commit426222903151173637c9a49246c182e79618bf83 (patch)
tree536914cb50c2e6e32f32190d2e3b7c997cb01ca7 /src/mac.m
parentf1524acbd3e708d1764b7f1533d707b22254ae95 (diff)
downloadpugl-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.m16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/mac.m b/src/mac.m
index 307a557..3b0896c 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -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);