From 426222903151173637c9a49246c182e79618bf83 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Jan 2023 19:44:41 -0500 Subject: Use ensureHint pattern everywhere --- src/win.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/win.c') 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; -- cgit v1.2.1