summaryrefslogtreecommitdiff
path: root/thirdparty/glad/glad.c
diff options
context:
space:
mode:
authorChaosus <chaosus89@gmail.com>2018-05-04 22:57:22 +0300
committerChaosus <chaosus89@gmail.com>2018-05-04 22:57:22 +0300
commit9cb468da7f9b0dbb32b4f64ef4381d509bd747dc (patch)
tree7a74a2d0441f4fabbbc967a60d59f451334c88f4 /thirdparty/glad/glad.c
parentbf561c49468c9a4d5c47ba7bc53204a51270855f (diff)
Update GLAD to 0.1.20a0
Diffstat (limited to 'thirdparty/glad/glad.c')
-rw-r--r--thirdparty/glad/glad.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/thirdparty/glad/glad.c b/thirdparty/glad/glad.c
index c2aaea2144..8f8b2189ec 100644
--- a/thirdparty/glad/glad.c
+++ b/thirdparty/glad/glad.c
@@ -1,6 +1,6 @@
/*
- OpenGL loader generated by glad 0.1.18a0 on Mon Mar 5 18:43:52 2018.
+ OpenGL loader generated by glad 0.1.20a0 on Fri May 4 21:44:11 2018.
Language/Generator: C/C++
Specification: gl
@@ -27,21 +27,40 @@
static void* get_proc(const char *namez);
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
#include <windows.h>
static HMODULE libGL;
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
+#ifdef _MSC_VER
+#ifdef __has_include
+ #if __has_include(<winapifamily.h>)
+ #define HAVE_WINAPIFAMILY 1
+ #endif
+#elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
+ #define HAVE_WINAPIFAMILY 1
+#endif
+#endif
+
+#ifdef HAVE_WINAPIFAMILY
+ #include <winapifamily.h>
+ #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ #define IS_UWP 1
+ #endif
+#endif
+
static
int open_gl(void) {
+#ifndef IS_UWP
libGL = LoadLibraryW(L"opengl32.dll");
if(libGL != NULL) {
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress(
libGL, "wglGetProcAddress");
return gladGetProcAddressPtr != NULL;
}
+#endif
return 0;
}
@@ -50,7 +69,7 @@ static
void close_gl(void) {
if(libGL != NULL) {
FreeLibrary((HMODULE) libGL);
- libGL = NULL;
+ libGL = NULL;
}
}
#else
@@ -113,7 +132,7 @@ void* get_proc(const char *namez) {
}
#endif
if(result == NULL) {
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
result = (void*)GetProcAddress((HMODULE) libGL, namez);
#else
result = dlsym(libGL, namez);