aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-03-01 20:07:52 +0100
committerDavid Robillard <d@drobilla.net>2020-03-01 20:32:42 +0100
commit0d37c19ac71d153a093960eadccf791f54fc2547 (patch)
tree68fd172ac323e9f2e77c25dba05f21a73861af27 /pugl/detail/win.h
parent94a2d5c31e6bad7e33a03bf282dc60d08f923526 (diff)
downloadpugl-0d37c19ac71d153a093960eadccf791f54fc2547.tar.gz
pugl-0d37c19ac71d153a093960eadccf791f54fc2547.tar.bz2
pugl-0d37c19ac71d153a093960eadccf791f54fc2547.zip
Cleanup: Adjust some code to be more clang-format friendly
Diffstat (limited to 'pugl/detail/win.h')
-rw-r--r--pugl/detail/win.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/pugl/detail/win.h b/pugl/detail/win.h
index e9056b7..4219a36 100644
--- a/pugl/detail/win.h
+++ b/pugl/detail/win.h
@@ -45,16 +45,17 @@ struct PuglInternalsImpl {
static inline PuglWinPFD
puglWinGetPixelFormatDescriptor(const PuglHints hints)
{
- const int rgbBits = (hints[PUGL_RED_BITS] +
- hints[PUGL_GREEN_BITS] +
+ const int rgbBits = (hints[PUGL_RED_BITS] + //
+ hints[PUGL_GREEN_BITS] + //
hints[PUGL_BLUE_BITS]);
+ const DWORD dwFlags = hints[PUGL_DOUBLE_BUFFER] ? PFD_DOUBLEBUFFER : 0;
+
PuglWinPFD pfd;
ZeroMemory(&pfd, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
- pfd.dwFlags = PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL;
- pfd.dwFlags |= hints[PUGL_DOUBLE_BUFFER] ? PFD_DOUBLEBUFFER : 0;
+ pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | dwFlags;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = (BYTE)rgbBits;
pfd.cRedBits = (BYTE)hints[PUGL_RED_BITS];
@@ -70,12 +71,13 @@ puglWinGetPixelFormatDescriptor(const PuglHints hints)
static inline unsigned
puglWinGetWindowFlags(const PuglView* const view)
{
- const bool resizable = view->hints[PUGL_RESIZABLE];
+ const bool resizable = view->hints[PUGL_RESIZABLE];
+ const unsigned sizeFlags = resizable ? (WS_SIZEBOX | WS_MAXIMIZEBOX) : 0;
+
return (WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
(view->parent
- ? WS_CHILD
- : (WS_POPUPWINDOW | WS_CAPTION | WS_MINIMIZEBOX |
- (resizable ? (WS_SIZEBOX | WS_MAXIMIZEBOX) : 0))));
+ ? WS_CHILD
+ : (WS_POPUPWINDOW | WS_CAPTION | WS_MINIMIZEBOX | sizeFlags)));
}
static inline unsigned