]> git.tdb.fi Git - libs/gui.git/commitdiff
Do not use wglext.h
authorMikko Rasa <tdb@tdb.fi>
Tue, 5 Sep 2023 09:24:45 +0000 (12:24 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 5 Sep 2023 09:24:45 +0000 (12:24 +0300)
It does not exist in the Windows SDK.  Instead add manual definitions
for what we need.

source/graphics/wgl/glcontext.cpp

index 5a13dc4f79e6068089521ed887cb441723203931..f04f664b254b74cfc4ccf60f14eb85d99dd1950b 100644 (file)
@@ -2,13 +2,29 @@
 #include <vector>
 #include <windows.h>
 #include <GL/gl.h>
-#include <GL/wglext.h>
 #include <msp/strings/lexicalcast.h>
 #include <msp/strings/utils.h>
 #include "window_private.h"
 
 using namespace std;
 
+#ifndef WGL_ARB_create_context
+using PFNWGLCREATECONTEXTATTRIBSARBPROC = HGLRC (WINAPI *)(HDC, HGLRC, const int *);
+#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 2
+#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define WGL_CONTEXT_FLAGS_ARB 0x2094
+#endif
+
+#ifndef WGL_ARB_create_context_profile
+#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
+#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 1
+#endif
+
+#ifndef WGL_EXT_swap_control
+using PFNWGLSWAPINTERVALEXTPROC = BOOL (WINAPI *)(int);
+#endif
+
 namespace {
 
 template<typename T>