From 7c632544403e1b5c19a1689cde969e0131afd8f1 Mon Sep 17 00:00:00 2001 From: Graham Date: Fri, 30 Aug 2019 12:30:29 +0100 Subject: [PATCH] Document why our ChoosePixelFormat usage is correct --- gl-natives/src/main/c/jaggl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gl-natives/src/main/c/jaggl.c b/gl-natives/src/main/c/jaggl.c index 55dc7c62..a9e7e9f4 100644 --- a/gl-natives/src/main/c/jaggl.c +++ b/gl-natives/src/main/c/jaggl.c @@ -967,6 +967,16 @@ JNIEXPORT jboolean JNICALL Java_jaggl_context_choosePixelFormat1(JNIEnv *env, jc } } + /* + * The Windows documentation doesn't make it immediately clear whether + * ChoosePixelFormat() will fall back to a single-buffered context if + * double-buffering is not available when PFD_DOUBLEBUFFER is set. + * + * The Wine project determined that it does fall back to a single-buffered + * context: + * + * https://github.com/wine-mirror/wine/blob/ba9f3dc198dfc81bb40159077b73b797006bb73c/dlls/opengl32/wgl.c#L480 + */ PIXELFORMATDESCRIPTOR pfd = { .nSize = sizeof(pfd), .nVersion = 1,