From 76fb88fa1a060b67c85ba0c380c027c850d177ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 17 Jan 2019 14:50:13 +0100 Subject: [PATCH] external: update OpenGL headers. Only a cleanup in the type definitions, which is actually nice. The desktop GL version now requires the khrplatform.h header as well. --- src/Magnum/GL/OpenGL.cpp | 6 +- src/MagnumExternal/OpenGL/CMakeLists.txt | 11 ++-- src/MagnumExternal/OpenGL/GL/flextGL.h | 63 ++++--------------- src/MagnumExternal/OpenGL/GLES2/flextGL.h | 16 ++--- .../OpenGL/GLES2/flextGLEmscripten.h | 14 ++--- .../OpenGL/GLES2/flextGLWindowsDesktop.h | 16 ++--- src/MagnumExternal/OpenGL/GLES3/flextGL.h | 19 +++--- .../OpenGL/GLES3/flextGLEmscripten.h | 17 ++--- .../OpenGL/GLES3/flextGLWindowsDesktop.h | 19 +++--- src/MagnumExternal/OpenGL/KHR/khrplatform.h | 18 +++--- 10 files changed, 65 insertions(+), 134 deletions(-) diff --git a/src/Magnum/GL/OpenGL.cpp b/src/Magnum/GL/OpenGL.cpp index 76e45d51c..cac95b64f 100644 --- a/src/Magnum/GL/OpenGL.cpp +++ b/src/Magnum/GL/OpenGL.cpp @@ -30,11 +30,15 @@ namespace Magnum { namespace GL { -/* Verify types */ +/* Verify types. GLbyte, GLushort, and GLshort are used only by desktop GL for + single-value vertex attributes and nowhere else and those functions are no + on ES. */ static_assert(std::is_same::value, "GLubyte is not the same as UnsignedByte"); +#ifndef MAGNUM_TARGET_GLES static_assert(std::is_same::value, "GLbyte is not the same as Byte"); static_assert(std::is_same::value, "GLushort is not the same as UnsignedShort"); static_assert(std::is_same::value, "GLshort is not the same as Short"); +#endif static_assert(std::is_same::value, "GLuint is not the same as UnsignedInt"); static_assert(std::is_same::value, "GLint is not the same as Int"); static_assert(std::is_same::value, "GLsizei is not the same as Int"); diff --git a/src/MagnumExternal/OpenGL/CMakeLists.txt b/src/MagnumExternal/OpenGL/CMakeLists.txt index f3a95e758..cbba8f543 100644 --- a/src/MagnumExternal/OpenGL/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/CMakeLists.txt @@ -23,13 +23,12 @@ # DEALINGS IN THE SOFTWARE. # +add_subdirectory(KHR) + if(NOT TARGET_GLES) add_subdirectory(GL) +elseif(TARGET_GLES2) + add_subdirectory(GLES2) else() - add_subdirectory(KHR) - if(TARGET_GLES2) - add_subdirectory(GLES2) - else() - add_subdirectory(GLES3) - endif() + add_subdirectory(GLES3) endif() diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h b/src/MagnumExternal/OpenGL/GL/flextGL.h index 604e76b55..129495d07 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h @@ -94,66 +94,27 @@ void flextGLInit(); /* Data types */ -#include -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(__sun__) || defined(__digital__) -#include -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include -#elif defined(__SCO__) || defined(__USLC__) -#include -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -/* Fallback if nothing above works */ -#include -#endif -#endif +#include typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; -typedef signed char GLbyte; -typedef short GLshort; +typedef khronos_int8_t GLbyte; +typedef khronos_uint8_t GLubyte; +typedef khronos_int16_t GLshort; +typedef khronos_uint16_t GLushort; typedef int GLint; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; -typedef float GLfloat; -typedef float GLclampf; +typedef khronos_float_t GLfloat; typedef double GLdouble; -typedef double GLclampd; typedef char GLchar; -typedef unsigned short GLhalf; -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -typedef int64_t GLint64; -typedef uint64_t GLuint64; -typedef uint64_t GLuint64EXT; +typedef khronos_uint16_t GLhalf; +typedef khronos_intptr_t GLintptr; +typedef khronos_ssize_t GLsizeiptr; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef khronos_uint64_t GLuint64EXT; typedef struct __GLsync *GLsync; typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h b/src/MagnumExternal/OpenGL/GLES2/flextGL.h index 51c047137..941290695 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h @@ -86,23 +86,17 @@ typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; -typedef short GLshort; +typedef khronos_uint8_t GLubyte; typedef int GLint; -typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; -typedef char GLchar; -typedef struct __GLsync *GLsync; -typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef khronos_int8_t GLbyte; -typedef khronos_uint8_t GLubyte; typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; +typedef char GLchar; typedef khronos_intptr_t GLintptr; typedef khronos_ssize_t GLsizeiptr; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); /* Enums */ diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h b/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h index 1f53c65e2..e36424c1b 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h @@ -60,22 +60,16 @@ typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; -typedef short GLshort; +typedef khronos_uint8_t GLubyte; typedef int GLint; -typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; -typedef char GLchar; -typedef struct __GLsync *GLsync; -typedef khronos_int8_t GLbyte; -typedef khronos_uint8_t GLubyte; typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; +typedef char GLchar; typedef khronos_intptr_t GLintptr; typedef khronos_ssize_t GLsizeiptr; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; /* Enums */ diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h index 6faa48dbb..0acbdf19f 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h @@ -86,23 +86,17 @@ typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; -typedef short GLshort; +typedef khronos_uint8_t GLubyte; typedef int GLint; -typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; -typedef char GLchar; -typedef struct __GLsync *GLsync; -typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef khronos_int8_t GLbyte; -typedef khronos_uint8_t GLubyte; typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; +typedef char GLchar; typedef khronos_intptr_t GLintptr; typedef khronos_ssize_t GLsizeiptr; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); /* Enums */ diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h b/src/MagnumExternal/OpenGL/GLES3/flextGL.h index 87e0b625a..8738b9654 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h @@ -90,25 +90,20 @@ typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; -typedef short GLshort; +typedef khronos_uint8_t GLubyte; typedef int GLint; -typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; +typedef khronos_float_t GLfloat; typedef char GLchar; -typedef unsigned short GLhalf; +typedef khronos_uint16_t GLhalf; +typedef khronos_intptr_t GLintptr; +typedef khronos_ssize_t GLsizeiptr; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; typedef struct __GLsync *GLsync; typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef khronos_int8_t GLbyte; -typedef khronos_uint8_t GLubyte; -typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; -typedef khronos_intptr_t GLintptr; -typedef khronos_ssize_t GLsizeiptr; /* Enums */ diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h b/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h index 3f4786b4d..42a7cae5e 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h @@ -65,23 +65,18 @@ typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; -typedef short GLshort; +typedef khronos_uint8_t GLubyte; typedef int GLint; -typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; -typedef char GLchar; -typedef unsigned short GLhalf; -typedef struct __GLsync *GLsync; -typedef khronos_int8_t GLbyte; -typedef khronos_uint8_t GLubyte; typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; +typedef char GLchar; +typedef khronos_uint16_t GLhalf; typedef khronos_intptr_t GLintptr; typedef khronos_ssize_t GLsizeiptr; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef struct __GLsync *GLsync; /* Enums */ diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h index 835abec00..b4eb32b7a 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h @@ -90,25 +90,20 @@ typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; -typedef short GLshort; +typedef khronos_uint8_t GLubyte; typedef int GLint; -typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; +typedef khronos_float_t GLfloat; typedef char GLchar; -typedef unsigned short GLhalf; +typedef khronos_uint16_t GLhalf; +typedef khronos_intptr_t GLintptr; +typedef khronos_ssize_t GLsizeiptr; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; typedef struct __GLsync *GLsync; typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef khronos_int8_t GLbyte; -typedef khronos_uint8_t GLubyte; -typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; -typedef khronos_intptr_t GLintptr; -typedef khronos_ssize_t GLsizeiptr; /* Enums */ diff --git a/src/MagnumExternal/OpenGL/KHR/khrplatform.h b/src/MagnumExternal/OpenGL/KHR/khrplatform.h index 43aac97a7..975bbffed 100644 --- a/src/MagnumExternal/OpenGL/KHR/khrplatform.h +++ b/src/MagnumExternal/OpenGL/KHR/khrplatform.h @@ -2,7 +2,7 @@ #define __khrplatform_h_ /* -** Copyright (c) 2008-2009 The Khronos Group Inc. +** Copyright (c) 2008-2018 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the @@ -26,18 +26,16 @@ /* Khronos platform-specific types and definitions. * - * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ + * The master copy of khrplatform.h is maintained in the Khronos EGL + * Registry repository at https://github.com/KhronosGroup/EGL-Registry + * The last semantic modification to khrplatform.h was at commit ID: + * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 * * Adopters may modify this file to suit their platform. Adopters are * encouraged to submit platform specific modifications to the Khronos * group so that they can be included in future versions of this file. - * Please submit changes by sending them to the public Khronos Bugzilla - * (http://khronos.org/bugzilla) by filing a bug against product - * "Khronos (general)" component "Registry". - * - * A predefined template which fills in some of the bug fields can be - * reached using http://tinyurl.com/khrplatform-h-bugreport, but you - * must create a Bugzilla login first. + * Please submit changes by filing pull requests or issues on + * the EGL Registry repository linked above. * * * See the Implementer's Guidelines for information about where this file @@ -101,6 +99,8 @@ # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C +#elif defined(__ANDROID__) +# define KHRONOS_APICALL __attribute__((visibility("default"))) #else # define KHRONOS_APICALL #endif