Browse Source

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.
simd
Vladimír Vondruš 7 years ago
parent
commit
76fb88fa1a
  1. 6
      src/Magnum/GL/OpenGL.cpp
  2. 11
      src/MagnumExternal/OpenGL/CMakeLists.txt
  3. 63
      src/MagnumExternal/OpenGL/GL/flextGL.h
  4. 16
      src/MagnumExternal/OpenGL/GLES2/flextGL.h
  5. 14
      src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h
  6. 16
      src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h
  7. 19
      src/MagnumExternal/OpenGL/GLES3/flextGL.h
  8. 17
      src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h
  9. 19
      src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h
  10. 18
      src/MagnumExternal/OpenGL/KHR/khrplatform.h

6
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<GLubyte, UnsignedByte>::value, "GLubyte is not the same as UnsignedByte");
#ifndef MAGNUM_TARGET_GLES
static_assert(std::is_same<GLbyte, Byte>::value, "GLbyte is not the same as Byte");
static_assert(std::is_same<GLushort, UnsignedShort>::value, "GLushort is not the same as UnsignedShort");
static_assert(std::is_same<GLshort, Short>::value, "GLshort is not the same as Short");
#endif
static_assert(std::is_same<GLuint, UnsignedInt>::value, "GLuint is not the same as UnsignedInt");
static_assert(std::is_same<GLint, Int>::value, "GLint is not the same as Int");
static_assert(std::is_same<GLsizei, Int>::value, "GLsizei is not the same as Int");

11
src/MagnumExternal/OpenGL/CMakeLists.txt vendored

@ -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()

63
src/MagnumExternal/OpenGL/GL/flextGL.h vendored

@ -94,66 +94,27 @@ void flextGLInit();
/* Data types */
#include <stddef.h>
#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 <inttypes.h>
#elif defined(__sun__) || defined(__digital__)
#include <inttypes.h>
#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 <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#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 <stdint.h>
#elif defined(_WIN32)
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
/* Fallback if nothing above works */
#include <inttypes.h>
#endif
#endif
#include <KHR/khrplatform.h>
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);

16
src/MagnumExternal/OpenGL/GLES2/flextGL.h vendored

@ -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 */

14
src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h vendored

@ -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 */

16
src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h vendored

@ -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 */

19
src/MagnumExternal/OpenGL/GLES3/flextGL.h vendored

@ -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 */

17
src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h vendored

@ -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 */

19
src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h vendored

@ -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 */

18
src/MagnumExternal/OpenGL/KHR/khrplatform.h vendored

@ -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

Loading…
Cancel
Save