From 7f68960be57860faddb4c4858281ef3945fb53ea Mon Sep 17 00:00:00 2001 From: Indah Sylvia Date: Thu, 30 Nov 2017 14:38:34 +0700 Subject: glad: Sync with upstream 0.1.16a0 --- thirdparty/glad/KHR/khrplatform.h | 3 +-- thirdparty/glad/glad.c | 25 ++++++++++++++++---- thirdparty/glad/glad/glad.h | 48 ++++++++++++++++++++++----------------- 3 files changed, 48 insertions(+), 28 deletions(-) (limited to 'thirdparty/glad') diff --git a/thirdparty/glad/KHR/khrplatform.h b/thirdparty/glad/KHR/khrplatform.h index 07b61b9bd6..1ad3554a76 100644 --- a/thirdparty/glad/KHR/khrplatform.h +++ b/thirdparty/glad/KHR/khrplatform.h @@ -102,8 +102,7 @@ #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C #elif defined(__ANDROID__) -# include -# define KHRONOS_APICALL __attribute__((visibility("default"))) __NDK_FPABI__ +# define KHRONOS_APICALL __attribute__((visibility("default"))) #else # define KHRONOS_APICALL #endif diff --git a/thirdparty/glad/glad.c b/thirdparty/glad/glad.c index 2d756ec3f6..f87ec8cf93 100644 --- a/thirdparty/glad/glad.c +++ b/thirdparty/glad/glad.c @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.14a0 on Wed Jun 14 20:12:45 2017. + OpenGL loader generated by glad 0.1.16a0 on Thu Nov 30 06:21:28 2017. Language/Generator: C/C++ Specification: gl @@ -92,7 +92,7 @@ int open_gl(void) { } static -void close_gl() { +void close_gl(void) { if(libGL != NULL) { dlclose(libGL); libGL = NULL; @@ -165,7 +165,18 @@ static int get_exts(void) { } for(index = 0; index < (unsigned)num_exts_i; index++) { - exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); + const char *gl_str_tmp = (const char*)glGetStringi(GL_EXTENSIONS, index); + size_t len = strlen(gl_str_tmp); + + char *local_str = (char*)malloc((len+1) * sizeof(*exts_i)); + if(local_str != NULL) { +#if _MSC_VER >= 1400 + 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; } } #endif @@ -174,6 +185,10 @@ static int get_exts(void) { static void free_exts(void) { if (exts_i != NULL) { + int index; + for(index = 0; index < num_exts_i; index++) { + free((char *)exts_i[index]); + } free((void *)exts_i); exts_i = NULL; } @@ -207,11 +222,11 @@ static int has_ext(const char *ext) { #ifdef _GLAD_IS_SOME_NEW_VERSION } else { int index; - + if(exts_i == NULL) return 0; for(index = 0; index < num_exts_i; index++) { const char *e = exts_i[index]; - if(strcmp(e, ext) == 0) { + if(exts_i[index] != NULL && strcmp(e, ext) == 0) { return 1; } } diff --git a/thirdparty/glad/glad/glad.h b/thirdparty/glad/glad/glad.h index cb78df071e..69413ef65f 100644 --- a/thirdparty/glad/glad/glad.h +++ b/thirdparty/glad/glad/glad.h @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.14a0 on Wed Jun 14 20:12:45 2017. + OpenGL loader generated by glad 0.1.16a0 on Thu Nov 30 06:21:28 2017. Language/Generator: C/C++ Specification: gl @@ -31,6 +31,9 @@ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif +#ifndef NOMINMAX +#define NOMINMAX 1 +#endif #include #endif @@ -139,6 +142,7 @@ typedef float GLfloat; typedef float GLclampf; typedef double GLdouble; typedef double GLclampd; +typedef void *GLeglClientBufferEXT; typedef void *GLeglImageOES; typedef char GLchar; typedef char GLcharARB; @@ -888,15 +892,17 @@ typedef void (APIENTRY *GLVULKANPROCNV)(void); #define GL_TEXTURE_FILTER_CONTROL 0x8500 #define GL_DEPTH_TEXTURE_MODE 0x884B #define GL_COMPARE_R_TO_TEXTURE 0x884E -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 +#define GL_BLEND_COLOR 0x8005 +#define GL_BLEND_EQUATION 0x8009 #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_FUNC_SUBTRACT 0x800A +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 #define GL_BUFFER_SIZE 0x8764 #define GL_BUFFER_USAGE 0x8765 #define GL_QUERY_COUNTER_BITS 0x8864 @@ -1504,10 +1510,10 @@ GLAPI PFNGLDISABLEPROC glad_glDisable; typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum cap); GLAPI PFNGLENABLEPROC glad_glEnable; #define glEnable glad_glEnable -typedef void (APIENTRYP PFNGLFINISHPROC)(); +typedef void (APIENTRYP PFNGLFINISHPROC)(void); GLAPI PFNGLFINISHPROC glad_glFinish; #define glFinish glad_glFinish -typedef void (APIENTRYP PFNGLFLUSHPROC)(); +typedef void (APIENTRYP PFNGLFLUSHPROC)(void); GLAPI PFNGLFLUSHPROC glad_glFlush; #define glFlush glad_glFlush typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); @@ -1543,7 +1549,7 @@ GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; typedef void (APIENTRYP PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble *data); GLAPI PFNGLGETDOUBLEVPROC glad_glGetDoublev; #define glGetDoublev glad_glGetDoublev -typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(); +typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(void); GLAPI PFNGLGETERRORPROC glad_glGetError; #define glGetError glad_glGetError typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum pname, GLfloat *data); @@ -1582,7 +1588,7 @@ GLAPI PFNGLVIEWPORTPROC glad_glViewport; typedef void (APIENTRYP PFNGLNEWLISTPROC)(GLuint list, GLenum mode); GLAPI PFNGLNEWLISTPROC glad_glNewList; #define glNewList glad_glNewList -typedef void (APIENTRYP PFNGLENDLISTPROC)(); +typedef void (APIENTRYP PFNGLENDLISTPROC)(void); GLAPI PFNGLENDLISTPROC glad_glEndList; #define glEndList glad_glEndList typedef void (APIENTRYP PFNGLCALLLISTPROC)(GLuint list); @@ -1708,7 +1714,7 @@ GLAPI PFNGLEDGEFLAGPROC glad_glEdgeFlag; typedef void (APIENTRYP PFNGLEDGEFLAGVPROC)(const GLboolean *flag); GLAPI PFNGLEDGEFLAGVPROC glad_glEdgeFlagv; #define glEdgeFlagv glad_glEdgeFlagv -typedef void (APIENTRYP PFNGLENDPROC)(); +typedef void (APIENTRYP PFNGLENDPROC)(void); GLAPI PFNGLENDPROC glad_glEnd; #define glEnd glad_glEnd typedef void (APIENTRYP PFNGLINDEXDPROC)(GLdouble c); @@ -2131,7 +2137,7 @@ GLAPI PFNGLSELECTBUFFERPROC glad_glSelectBuffer; typedef GLint (APIENTRYP PFNGLRENDERMODEPROC)(GLenum mode); GLAPI PFNGLRENDERMODEPROC glad_glRenderMode; #define glRenderMode glad_glRenderMode -typedef void (APIENTRYP PFNGLINITNAMESPROC)(); +typedef void (APIENTRYP PFNGLINITNAMESPROC)(void); GLAPI PFNGLINITNAMESPROC glad_glInitNames; #define glInitNames glad_glInitNames typedef void (APIENTRYP PFNGLLOADNAMEPROC)(GLuint name); @@ -2140,7 +2146,7 @@ GLAPI PFNGLLOADNAMEPROC glad_glLoadName; typedef void (APIENTRYP PFNGLPASSTHROUGHPROC)(GLfloat token); GLAPI PFNGLPASSTHROUGHPROC glad_glPassThrough; #define glPassThrough glad_glPassThrough -typedef void (APIENTRYP PFNGLPOPNAMEPROC)(); +typedef void (APIENTRYP PFNGLPOPNAMEPROC)(void); GLAPI PFNGLPOPNAMEPROC glad_glPopName; #define glPopName glad_glPopName typedef void (APIENTRYP PFNGLPUSHNAMEPROC)(GLuint name); @@ -2158,7 +2164,7 @@ GLAPI PFNGLINDEXMASKPROC glad_glIndexMask; typedef void (APIENTRYP PFNGLACCUMPROC)(GLenum op, GLfloat value); GLAPI PFNGLACCUMPROC glad_glAccum; #define glAccum glad_glAccum -typedef void (APIENTRYP PFNGLPOPATTRIBPROC)(); +typedef void (APIENTRYP PFNGLPOPATTRIBPROC)(void); GLAPI PFNGLPOPATTRIBPROC glad_glPopAttrib; #define glPopAttrib glad_glPopAttrib typedef void (APIENTRYP PFNGLPUSHATTRIBPROC)(GLbitfield mask); @@ -2308,7 +2314,7 @@ GLAPI PFNGLISLISTPROC glad_glIsList; typedef void (APIENTRYP PFNGLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GLAPI PFNGLFRUSTUMPROC glad_glFrustum; #define glFrustum glad_glFrustum -typedef void (APIENTRYP PFNGLLOADIDENTITYPROC)(); +typedef void (APIENTRYP PFNGLLOADIDENTITYPROC)(void); GLAPI PFNGLLOADIDENTITYPROC glad_glLoadIdentity; #define glLoadIdentity glad_glLoadIdentity typedef void (APIENTRYP PFNGLLOADMATRIXFPROC)(const GLfloat *m); @@ -2329,10 +2335,10 @@ GLAPI PFNGLMULTMATRIXDPROC glad_glMultMatrixd; typedef void (APIENTRYP PFNGLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GLAPI PFNGLORTHOPROC glad_glOrtho; #define glOrtho glad_glOrtho -typedef void (APIENTRYP PFNGLPOPMATRIXPROC)(); +typedef void (APIENTRYP PFNGLPOPMATRIXPROC)(void); GLAPI PFNGLPOPMATRIXPROC glad_glPopMatrix; #define glPopMatrix glad_glPopMatrix -typedef void (APIENTRYP PFNGLPUSHMATRIXPROC)(); +typedef void (APIENTRYP PFNGLPUSHMATRIXPROC)(void); GLAPI PFNGLPUSHMATRIXPROC glad_glPushMatrix; #define glPushMatrix glad_glPushMatrix typedef void (APIENTRYP PFNGLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); @@ -2441,7 +2447,7 @@ GLAPI PFNGLINDEXUBPROC glad_glIndexub; typedef void (APIENTRYP PFNGLINDEXUBVPROC)(const GLubyte *c); GLAPI PFNGLINDEXUBVPROC glad_glIndexubv; #define glIndexubv glad_glIndexubv -typedef void (APIENTRYP PFNGLPOPCLIENTATTRIBPROC)(); +typedef void (APIENTRYP PFNGLPOPCLIENTATTRIBPROC)(void); GLAPI PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib; #define glPopClientAttrib glad_glPopClientAttrib typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBPROC)(GLbitfield mask); @@ -2839,7 +2845,7 @@ GLAPI PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; typedef void (APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint shader); GLAPI PFNGLCOMPILESHADERPROC glad_glCompileShader; #define glCompileShader glad_glCompileShader -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(void); GLAPI PFNGLCREATEPROGRAMPROC glad_glCreateProgram; #define glCreateProgram glad_glCreateProgram typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC)(GLenum type); @@ -3141,7 +3147,7 @@ GLAPI PFNGLISENABLEDIPROC glad_glIsEnabledi; typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode); GLAPI PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; #define glBeginTransformFeedback glad_glBeginTransformFeedback -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC)(); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC)(void); GLAPI PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; #define glEndTransformFeedback glad_glEndTransformFeedback typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); @@ -3162,7 +3168,7 @@ GLAPI PFNGLCLAMPCOLORPROC glad_glClampColor; typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode); GLAPI PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; #define glBeginConditionalRender glad_glBeginConditionalRender -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC)(); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC)(void); GLAPI PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; #define glEndConditionalRender glad_glEndConditionalRender typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -- cgit v1.2.3