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/win.c | |
parent | f1524acbd3e708d1764b7f1533d707b22254ae95 (diff) | |
download | pugl-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.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -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; |