aboutsummaryrefslogtreecommitdiffstats
path: root/src/win.c
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/win.c
parentf1524acbd3e708d1764b7f1533d707b22254ae95 (diff)
downloadpugl-426222903151173637c9a49246c182e79618bf83.tar.gz
pugl-426222903151173637c9a49246c182e79618bf83.tar.bz2
pugl-426222903151173637c9a49246c182e79618bf83.zip
Use ensureHint pattern everywhere
Diffstat (limited to 'src/win.c')
-rw-r--r--src/win.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/win.c b/src/win.c
index 80a5baf..5defb8d 100644
--- a/src/win.c
+++ b/src/win.c
@@ -220,14 +220,6 @@ puglPollWinEvents(PuglWorld* world, const double timeout)
return PUGL_SUCCESS;
}
-static void
-ensureHint(PuglView* const view, const PuglViewHint hint, const int value)
-{
- if (view->hints[hint] == PUGL_DONT_CARE) {
- view->hints[hint] = value;
- }
-}
-
PuglStatus
puglRealize(PuglView* view)
{
@@ -245,10 +237,10 @@ puglRealize(PuglView* view)
}
// Set default depth hints if the user hasn't specified any
- ensureHint(view, PUGL_RED_BITS, 8);
- ensureHint(view, PUGL_GREEN_BITS, 8);
- ensureHint(view, PUGL_BLUE_BITS, 8);
- ensureHint(view, 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);
// Get refresh rate for resize draw timer
DEVMODEA devMode;