GLTypes.h (2846B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef GLTYPES_H_ 6 #define GLTYPES_H_ 7 8 #include <stdint.h> 9 10 #ifndef GLAPIENTRY 11 # ifdef WIN32 12 # include <windef.h> 13 # define GLAPIENTRY APIENTRY 14 # define GLAPI 15 # else 16 # define GLAPIENTRY 17 # define GLAPI 18 # endif 19 #endif 20 21 typedef uint8_t realGLboolean; 22 23 #if !defined(__gltypes_h_) && !defined(__gl_h_) 24 # define __gltypes_h_ 25 # define __gl_h_ 26 27 typedef uint32_t GLenum; 28 typedef uint32_t GLbitfield; 29 typedef uint32_t GLuint; 30 typedef int32_t GLint; 31 typedef int32_t GLsizei; 32 typedef int8_t GLbyte; 33 typedef int16_t GLshort; 34 typedef uint8_t GLubyte; 35 typedef uint16_t GLushort; 36 typedef float GLfloat; 37 typedef float GLclampf; 38 # ifndef GLdouble_defined 39 typedef double GLdouble; 40 # endif 41 typedef double GLclampd; 42 typedef void GLvoid; 43 44 typedef char GLchar; 45 # ifndef __gl2_h_ 46 # ifdef _WIN64 47 typedef signed long long int GLintptr; 48 typedef signed long long int GLsizeiptr; 49 # else 50 typedef signed long int GLintptr; 51 typedef signed long int GLsizeiptr; 52 # endif 53 # endif 54 55 #endif /* #if !defined(__gltypes_h_) && !defined(__gl_h_) */ 56 57 #ifdef XP_IOS 58 # ifndef GLdouble_defined 59 typedef double GLdouble; 60 # endif 61 typedef double GLclampd; 62 #endif 63 64 #include <stdint.h> 65 66 // ARB_sync 67 typedef struct __GLsync* GLsync; 68 typedef int64_t GLint64; 69 typedef uint64_t GLuint64; 70 71 // OES_EGL_image (GLES) 72 typedef void* GLeglImage; 73 74 // KHR_debug 75 typedef void(GLAPIENTRY* GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, 76 GLenum severity, GLsizei length, 77 const GLchar* message, 78 const GLvoid* userParam); 79 80 // EGL types 81 typedef void* EGLImage; 82 typedef int EGLint; 83 typedef unsigned int EGLBoolean; 84 typedef unsigned int EGLenum; 85 typedef intptr_t EGLAttrib; 86 typedef void* EGLConfig; 87 typedef void* EGLContext; 88 typedef void* EGLDisplay; 89 typedef void* EGLDeviceEXT; 90 typedef void* EGLSurface; 91 typedef void* EGLClientBuffer; 92 typedef void* EGLCastToRelevantPtr; 93 typedef void* EGLImage; 94 typedef void* EGLSync; 95 typedef void* EGLStreamKHR; 96 typedef uint64_t EGLTime; 97 98 #define EGL_NO_CONTEXT ((EGLContext)0) 99 #define EGL_NO_DISPLAY ((EGLDisplay)0) 100 #define EGL_NO_SURFACE ((EGLSurface)0) 101 #define EGL_NO_CONFIG ((EGLConfig) nullptr) 102 #define EGL_NO_SYNC ((EGLSync)0) 103 #define EGL_NO_IMAGE ((EGLImage)0) 104 105 #ifdef XP_WIN 106 # ifndef WIN32_LEAN_AND_MEAN 107 # define WIN32_LEAN_AND_MEAN 1 108 # endif 109 110 # include <windef.h> 111 112 typedef HDC EGLNativeDisplayType; 113 typedef HBITMAP EGLNativePixmapType; 114 typedef HWND EGLNativeWindowType; 115 #else 116 typedef void* EGLNativeDisplayType; 117 typedef void* EGLNativePixmapType; 118 typedef void* EGLNativeWindowType; 119 #endif 120 121 #endif // GLTYPES_H_