mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-22 23:21:08 +00:00
Update glad to 0.1.25
Includes https://github.com/Dav1dde/glad/pull/140 git-svn-id: https://svn.eduke32.com/eduke32@6948 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0116b51b2d
commit
a0c87b5fda
5 changed files with 60 additions and 38 deletions
|
@ -129,13 +129,7 @@ glad_src := $(glad_root)/src
|
||||||
glad_inc := $(glad_root)/include
|
glad_inc := $(glad_root)/include
|
||||||
glad_obj := $(obj)/$(glad)
|
glad_obj := $(obj)/$(glad)
|
||||||
|
|
||||||
glad__no_cast_qual := -Wno-cast-qual
|
glad_cflags :=
|
||||||
ifeq (4,$(GCC_MAJOR))
|
|
||||||
ifneq (,$(filter 0 1 2 3 4,$(GCC_MINOR)))
|
|
||||||
glad__no_cast_qual :=
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
glad_cflags := $(glad__no_cast_qual)
|
|
||||||
|
|
||||||
ifeq ($(RENDERTYPE),WIN)
|
ifeq ($(RENDERTYPE),WIN)
|
||||||
glad_objs += glad_wgl.c
|
glad_objs += glad_wgl.c
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
OpenGL, OpenGL ES loader generated by glad 0.1.18a0 on Thu Mar 22 01:10:42 2018.
|
OpenGL, OpenGL ES loader generated by glad 0.1.25 on Mon Jul 23 02:57:25 2018.
|
||||||
|
|
||||||
Language/Generator: C/C++
|
Language/Generator: C/C++
|
||||||
Specification: gl
|
Specification: gl
|
||||||
|
@ -180,16 +180,8 @@ typedef unsigned int GLhandleARB;
|
||||||
typedef unsigned short GLhalfARB;
|
typedef unsigned short GLhalfARB;
|
||||||
typedef unsigned short GLhalf;
|
typedef unsigned short GLhalf;
|
||||||
typedef GLint GLfixed;
|
typedef GLint GLfixed;
|
||||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
typedef khronos_intptr_t GLintptr;
|
||||||
typedef long GLintptr;
|
typedef khronos_ssize_t GLsizeiptr;
|
||||||
#else
|
|
||||||
typedef ptrdiff_t GLintptr;
|
|
||||||
#endif
|
|
||||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
|
||||||
typedef long GLsizeiptr;
|
|
||||||
#else
|
|
||||||
typedef ptrdiff_t GLsizeiptr;
|
|
||||||
#endif
|
|
||||||
typedef int64_t GLint64;
|
typedef int64_t GLint64;
|
||||||
typedef uint64_t GLuint64;
|
typedef uint64_t GLuint64;
|
||||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
WGL loader generated by glad 0.1.18a0 on Thu Mar 22 01:11:56 2018.
|
WGL loader generated by glad 0.1.25 on Mon Jul 23 02:57:35 2018.
|
||||||
|
|
||||||
Language/Generator: C/C++
|
Language/Generator: C/C++
|
||||||
Specification: wgl
|
Specification: wgl
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
OpenGL, OpenGL ES loader generated by glad 0.1.18a0 on Thu Mar 22 01:10:42 2018.
|
OpenGL, OpenGL ES loader generated by glad 0.1.25 on Mon Jul 23 02:57:25 2018.
|
||||||
|
|
||||||
Language/Generator: C/C++
|
Language/Generator: C/C++
|
||||||
Specification: gl
|
Specification: gl
|
||||||
|
@ -37,21 +37,41 @@
|
||||||
|
|
||||||
static void* get_proc(const char *namez);
|
static void* get_proc(const char *namez);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
static HMODULE libGL;
|
static HMODULE libGL;
|
||||||
|
|
||||||
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
|
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
|
||||||
static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
|
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
|
static
|
||||||
int open_gl(void) {
|
int open_gl(void) {
|
||||||
|
#ifndef IS_UWP
|
||||||
libGL = LoadLibraryW(L"opengl32.dll");
|
libGL = LoadLibraryW(L"opengl32.dll");
|
||||||
if(libGL != NULL) {
|
if(libGL != NULL) {
|
||||||
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress(
|
void (* tmp)(void);
|
||||||
libGL, "wglGetProcAddress");
|
tmp = (void(*)(void)) GetProcAddress(libGL, "wglGetProcAddress");
|
||||||
|
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE) tmp;
|
||||||
return gladGetProcAddressPtr != NULL;
|
return gladGetProcAddressPtr != NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +80,7 @@ static
|
||||||
void close_gl(void) {
|
void close_gl(void) {
|
||||||
if(libGL != NULL) {
|
if(libGL != NULL) {
|
||||||
FreeLibrary((HMODULE) libGL);
|
FreeLibrary((HMODULE) libGL);
|
||||||
libGL = NULL;
|
libGL = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -123,7 +143,7 @@ void* get_proc(const char *namez) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(result == NULL) {
|
if(result == NULL) {
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
result = (void*)GetProcAddress((HMODULE) libGL, namez);
|
result = (void*)GetProcAddress((HMODULE) libGL, namez);
|
||||||
#else
|
#else
|
||||||
result = dlsym(libGL, namez);
|
result = dlsym(libGL, namez);
|
||||||
|
@ -155,7 +175,7 @@ static int max_loaded_minor;
|
||||||
|
|
||||||
static const char *exts = NULL;
|
static const char *exts = NULL;
|
||||||
static int num_exts_i = 0;
|
static int num_exts_i = 0;
|
||||||
static const char **exts_i = NULL;
|
static char **exts_i = NULL;
|
||||||
|
|
||||||
static int get_exts(void) {
|
static int get_exts(void) {
|
||||||
#ifdef _GLAD_IS_SOME_NEW_VERSION
|
#ifdef _GLAD_IS_SOME_NEW_VERSION
|
||||||
|
@ -169,7 +189,7 @@ static int get_exts(void) {
|
||||||
num_exts_i = 0;
|
num_exts_i = 0;
|
||||||
glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
|
glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
|
||||||
if (num_exts_i > 0) {
|
if (num_exts_i > 0) {
|
||||||
exts_i = (const char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i));
|
exts_i = (char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exts_i == NULL) {
|
if (exts_i == NULL) {
|
||||||
|
@ -182,11 +202,7 @@ static int get_exts(void) {
|
||||||
|
|
||||||
char *local_str = (char*)malloc((len+1) * sizeof(char));
|
char *local_str = (char*)malloc((len+1) * sizeof(char));
|
||||||
if(local_str != NULL) {
|
if(local_str != NULL) {
|
||||||
#if _MSC_VER >= 1400
|
memcpy(local_str, gl_str_tmp, (len+1) * sizeof(char));
|
||||||
strncpy_s(local_str, len+1, gl_str_tmp, len);
|
|
||||||
#else
|
|
||||||
strncpy(local_str, gl_str_tmp, len+1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
exts_i[index] = local_str;
|
exts_i[index] = local_str;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
WGL loader generated by glad 0.1.18a0 on Thu Mar 22 01:11:56 2018.
|
WGL loader generated by glad 0.1.25 on Mon Jul 23 02:57:35 2018.
|
||||||
|
|
||||||
Language/Generator: C/C++
|
Language/Generator: C/C++
|
||||||
Specification: wgl
|
Specification: wgl
|
||||||
|
@ -30,21 +30,41 @@
|
||||||
|
|
||||||
static void* get_proc(const char *namez);
|
static void* get_proc(const char *namez);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
static HMODULE libGL;
|
static HMODULE libGL;
|
||||||
|
|
||||||
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
|
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
|
||||||
static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
|
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
|
static
|
||||||
int open_gl(void) {
|
int open_gl(void) {
|
||||||
|
#ifndef IS_UWP
|
||||||
libGL = LoadLibraryW(L"opengl32.dll");
|
libGL = LoadLibraryW(L"opengl32.dll");
|
||||||
if(libGL != NULL) {
|
if(libGL != NULL) {
|
||||||
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress(
|
void (* tmp)(void);
|
||||||
libGL, "wglGetProcAddress");
|
tmp = (void(*)(void)) GetProcAddress(libGL, "wglGetProcAddress");
|
||||||
|
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE) tmp;
|
||||||
return gladGetProcAddressPtr != NULL;
|
return gladGetProcAddressPtr != NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +73,7 @@ static
|
||||||
void close_gl(void) {
|
void close_gl(void) {
|
||||||
if(libGL != NULL) {
|
if(libGL != NULL) {
|
||||||
FreeLibrary((HMODULE) libGL);
|
FreeLibrary((HMODULE) libGL);
|
||||||
libGL = NULL;
|
libGL = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -116,7 +136,7 @@ void* get_proc(const char *namez) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(result == NULL) {
|
if(result == NULL) {
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
result = (void*)GetProcAddress((HMODULE) libGL, namez);
|
result = (void*)GetProcAddress((HMODULE) libGL, namez);
|
||||||
#else
|
#else
|
||||||
result = dlsym(libGL, namez);
|
result = dlsym(libGL, namez);
|
||||||
|
|
Loading…
Reference in a new issue