[
  {
    "path": ".gitignore",
    "content": "# Object files\n*.o\n*.ko\n*.obj\n*.elf\n\n# Precompiled Headers\n*.gch\n*.pch\n\n# Libraries\n*.lib\n*.a\n*.la\n*.lo\n\n# Shared objects (inc. Windows DLLs)\n*.dll\n*.so\n*.so.*\n*.dylib\n\n# Executables\n*.exe\n*.out\n*.app\n*.i*86\n*.x86_64\n*.hex\n\n# Debug files\n*.dSYM/\n\nBuild\nbin\n"
  },
  {
    "path": "CMake/OutOfSourceBuild.cmake",
    "content": "# Disallow in-source build\nSTRING(COMPARE EQUAL \"${CMAKE_SOURCE_DIR}\" \"${CMAKE_BINARY_DIR}\" BUILDING_IN_SOURCE)\nIF(BUILDING_IN_SOURCE)\n  MESSAGE(FATAL_ERROR \"This project requires an out of source build. Please create a separate build directory and run 'cmake [options] <path-to-source>' there.\")\nENDIF(BUILDING_IN_SOURCE)\n\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "PROJECT(MTCL)\n\n## Let's use a reasonable modern version\nCMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)\nSET(CMAKE_HAS_SORT 1)\nSET(CMAKE_MODULE_PATH\n  ${MTCL_SOURCE_DIR}/CMake\n  ${CMAKE_MODULE_PATH}\n)\n\n## Disallow in-source builds\nINCLUDE(OutOfSourceBuild)\n\n## Set version and info\nSET(MTCL_MAJOR_VERSION 1)\nSET(MTCL_MINOR_VERSION 0)\nSET(MTCL_PATCH_VERSION 0)\n\nSET(MTCL_PACKAGE \"Maratis Tiny C Library\")\nSET(MTCL_VENDOR \"Anael Seghezzi\")\nSET(MTCL_VERSION \"${MTCL_MAJOR_VERSION}.${MTCL_MINOR_VERSION}.${MTCL_PATCH_VERSION}\")\nSET(MTCL_COPYRIGHT \"Copyright (c) 2015, ${MTCL_VENDOR}.\")\n\nMESSAGE(STATUS \"${MTCL_PACKAGE} ${MTCL_VERSION}\")\n\n## Set install path\nSET(MTCL_INSTALL_DIR MTCL)\n\nIF(WIN32)\n  FIND_PACKAGE(OpenGL REQUIRED)\n  SET(MTCL_BUILD_FLAGS \"\")\n  SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${MOE_BUILD_FLAGS} /EHsc /nologo /GR /FC /DWIN32 /D_MBCS\")\n  SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG} /Z7 /W4 /Od /MDd /D_DEBUG /D__Debug__\")\n  SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE} /W1 /Ox /Ot /MD /DNDEBUG\")\n  SET(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${MARATIS_BUILD_FLAGS} /EHsc /nologo /GR /FC /DWIN32 /D_MBCS\")\n  SET(CMAKE_CXX_FLAGS_DEBUG \"${CMAKE_CXX_FLAGS_DEBUG} /Z7 /W4 /Od /MDd /D_DEBUG /D__Debug__\")\n  SET(CMAKE_CXX_FLAGS_RELEASE \"${CMAKE_CXX_FLAGS_RELEASE} /W1 /Ox /Ot /MD /DNDEBUG\")\n  SET(OS_SPECIFIC_LIBRARIES)\nENDIF(WIN32)\n\nIF(APPLE)\n  FIND_PACKAGE(OpenGL REQUIRED)\n  FIND_LIBRARY(COCOA_LIB Cocoa)\n  FIND_LIBRARY(CORE_SERVICES_LIB CoreServices)\n  FIND_LIBRARY(FOUNDATION_LIB Foundation)\n  FIND_LIBRARY(IOKIT_LIB IOKit)\n  SET(MTCL_BUILD_FLAGS \"-mmacosx-version-min=10.6\")\n  SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${MTCL_BUILD_FLAGS} -O3 -DOSX\")\n  SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG} -D__Debug__\")\n  SET(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${MTCL_BUILD_FLAGS} -O3 -DOSX\")\n  SET(CMAKE_CXX_FLAGS_DEBUG \"${CMAKE_CXX_FLAGS_DEBUG} -D__Debug__\")\n  SET(CMAKE_SHARED_LINKER_FLAGS \"-Wl\")\n  SET(OS_SPECIFIC_LIBRARIES ${COCOA_LIB} ${CORE_SERVICES_LIB} ${FOUNDATION_LIB} ${IOKIT_LIB})\nENDIF(APPLE)\n\nIF(UNIX AND NOT APPLE)\n  FIND_PACKAGE(OpenGL REQUIRED)\n  SET(MTCL_BUILD_FLAGS \"\")\n  SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${MTCL_BUILD_FLAGS} -O3 -fPIC -DLINUX -ldl\")\n  SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG} -D__Debug__\")\n  SET(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${MTCL_BUILD_FLAGS} -O3 -fPIC -DLINUX -ldl\")\n  SET(CMAKE_CXX_FLAGS_DEBUG \"${CMAKE_CXX_FLAGS_DEBUG} -D__Debug__\")\n  SET(CMAKE_SHARED_LINKER_FLAGS \"-ldl -Wl,--as-needed,--allow-multiple-definition,--build-id\")\n  SET(OS_SPECIFIC_LIBRARIES pthread Xxf86vm X11 Xrandr Xi dl m)\nENDIF(UNIX AND NOT APPLE)\n\nFIND_PACKAGE(OpenMP)\nIF(OPENMP_FOUND)\n  SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}\")\n  SET(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}\")\nENDIF()\n\n## Set up 3rd party dependencies\nSET(GLFW_INCLUDE_DIR ${MTCL_SOURCE_DIR}/tests/3rdparty/glfw/include)\nSET(TINYCTHREAD_INCLUDE_DIR ${MTCL_SOURCE_DIR}/tests/3rdparty/tinycthread/source)\nSET(STB_INCLUDE_DIR ${MTCL_SOURCE_DIR}/tests/3rdparty/stb)\nSET(GLFW_LIBRARIES glfw)\nSET(TINYCTHREAD_LIBRARIES tinycthread)\n\n## Set up SDK dependencies\nSET(MTCL_INCLUDE_DIR ${MTCL_SOURCE_DIR}/include)\n\n## Set up subdirectories...\nADD_SUBDIRECTORY(tests/3rdparty)\nADD_SUBDIRECTORY(tests/raster)\nADD_SUBDIRECTORY(tests/raytracing)\nADD_SUBDIRECTORY(tests/voronoi)\nADD_SUBDIRECTORY(tests/vorogen)"
  },
  {
    "path": "LICENSE",
    "content": "Maratis Tiny C library\n\nCopyright (c) 2015 Anael Seghezzi <www.maratis3d.com>\r\n\r\n This software is provided 'as-is', without any express or implied\r\n warranty. In no event will the authors be held liable for any damages\r\n arising from the use of this software.\r\n\r\n Permission is granted to anyone to use this software for any purpose,\r\n including commercial applications, and to alter it and redistribute it\r\n freely, subject to the following restrictions:\r\n\r\n 1. The origin of this software must not be misrepresented; you must not\r\n    claim that you wrote the original software. If you use this software\r\n    in a product, an acknowledgment in the product documentation would\r\n    be appreciated but is not required.\r\n\r\n 2. Altered source versions must be plainly marked as such, and must not\r\n    be misrepresented as being the original software.\r\n\r\n 3. This notice may not be removed or altered from any source\r\n    distribution.\n"
  },
  {
    "path": "README.md",
    "content": "Maratis Tiny C library\r\n======================\r\n\r\nis a collection of small and efficient math and image processing routines written in ANSI C with no dependencies.\r\n\r\nThe library is divided in independent single files (stb style):\r\n- [m_math.h](https://github.com/anael-seghezzi/Maratis-Tiny-C-library/blob/master/include/m_math.h)\r\n- [m_image.h](https://github.com/anael-seghezzi/Maratis-Tiny-C-library/blob/master/include/m_image.h)\r\n- [m_raster.h](https://github.com/anael-seghezzi/Maratis-Tiny-C-library/blob/master/include/m_raster.h)\r\n- [m_dist.h](https://github.com/anael-seghezzi/Maratis-Tiny-C-library/blob/master/include/m_dist.h)\r\n- [m_path_finding.h](https://github.com/anael-seghezzi/Maratis-Tiny-C-library/blob/master/include/m_path_finding.h)\r\n\r\nMath\r\n----\r\n\r\n* vector manipulation\r\n* interpolation (cubic, catmullrom)\r\n* quaternion (basics, slerp...)\r\n* matrix (projection, transformation...)\r\n* random number generator\r\n* 2d routines\r\n* 3d routines\r\n  * voxeliser (tri-box overlap)\r\n  * raytracing (sphere, plane, box, triangle)\r\n\r\nImage manipulation\r\n------------------\r\n\r\n* ubyte, ushort, int, half, float...\r\n* copy, conversions, mirror, reframe, rotate...\r\n* filters (convolution, gaussian blur, sobel, harris)\r\n* resizing, pyrdown\r\n* morphology (floodfill, dilate, erode, thinning...)\r\n* corner detection (harris, non-maxima suppression)\r\n\r\nRasterization\r\n-------------\r\n\r\n* triangle with interpolation (perspective correct)\r\n* basic line, circle and polygon\r\n\r\nDistance map\r\n------------\r\n\r\n* distance transform and voronoi\r\n\r\nPath finding\r\n------------\r\n\r\n* path finding on regular grid (floodfill-based)\r\n\r\nAsm.js demos\r\n------------\r\n\r\n* [m_raster](http://maratis3d.org/js/m_raster/m_raster.html)\r\n* [m_voronoi](http://maratis3d.org/js/m_voronoi/m_voronoi.html)\r\n* [m_raytracing](http://maratis3d.org/js/m_raytracing/m_raytracing.html)\r\n\r\nGames / Demos\r\n-------------\r\n\r\n* Back on Earth - Ludum Dare 34 Compo\r\n\r\n [![BackOnEarth](http://maratis3d.com/download/ludum34/scm.png)](http://maratis3d.com/download/ludum34/b/web_player.html)\r\n\r\n\r\nBuilding the demos (CMake)\r\n--------------------------\r\n\r\n**Unix:**\r\n\r\nrun:\r\n\r\n    build_tests_unix.sh\r\n    \r\nor type:\r\n\r\n    mkdir Build\r\n    cd Build\r\n    cmake -G \"Unix Makefiles\" ../ -DCMAKE_INSTALL_PREFIX=../bin\r\n    make\r\n    make install\r\n\r\n**Windows:**\r\n\r\n    mkdir Build\r\n    cd Build\r\n    cmake -G \"Visual Studio 11\" ../ -DCMAKE_INSTALL_PREFIX=../bin\r\n\r\nor:\r\n\r\n    mkdir Build\r\n    cd Build\r\n    cmake -G \"MinGW Makefiles\" ../ -DCMAKE_INSTALL_PREFIX=../bin\r\n    make\r\n    make install\r\n\r\n**Emscripten:**\r\n\r\n    ./emcc -s LEGACY_GL_EMULATION=1 -s USE_GLFW=3\r\n\r\nLicense (zlib)\r\n--------------\r\n\r\nCopyright (c) 2015 Anael Seghezzi <www.maratis3d.com>\r\n\r\n This software is provided 'as-is', without any express or implied\r\n warranty. In no event will the authors be held liable for any damages\r\n arising from the use of this software.\r\n\r\n Permission is granted to anyone to use this software for any purpose,\r\n including commercial applications, and to alter it and redistribute it\r\n freely, subject to the following restrictions:\r\n\r\n 1. The origin of this software must not be misrepresented; you must not\r\n    claim that you wrote the original software. If you use this software\r\n    in a product, an acknowledgment in the product documentation would\r\n    be appreciated but is not required.\r\n\r\n 2. Altered source versions must be plainly marked as such, and must not\r\n    be misrepresented as being the original software.\r\n\r\n 3. This notice may not be removed or altered from any source\r\n    distribution.\r\n\r\nYou may also like\r\n-----------------\r\n\r\n* [stb](https://github.com/nothings/stb)\r\n* [PAL](https://github.com/parallella/pal)\r\n* [Maratis](http://www.maratis3d.org)\r\n* [BGFX](https://github.com/bkaradzic/bgfx)\r\n* [GLFW](https://github.com/glfw/glfw)\r\n"
  },
  {
    "path": "build_tests_unix.sh",
    "content": "#!/bin/bash\n\ncur_dir=`dirname \"$0\"`; cur_dir=`eval \"cd \\\"$cur_dir\\\" && pwd\"`\nbuild_path=$cur_dir\"/Build\"\ninstall_path=$cur_dir\"/bin\"\n\n# build\nmkdir $build_path\ncd $build_path\ncmake -G \"Unix Makefiles\" ../ -DCMAKE_INSTALL_PREFIX=$install_path\nmake\nmake install\n\necho \"\"\necho \"done\"\nread x\n"
  },
  {
    "path": "build_tests_vs.bat",
    "content": "mkdir Build\ncd Build\ncmake -G \"Visual Studio 11\" ../ -DCMAKE_INSTALL_PREFIX=../bin\n"
  },
  {
    "path": "include/m_dist.h",
    "content": "/*======================================================================\n Maratis Tiny C Library\n version 1.0\n------------------------------------------------------------------------\n Copyright (c) 2015 Anael Seghezzi <www.maratis3d.org>\n\n This software is provided 'as-is', without any express or implied\n warranty. In no event will the authors be held liable for any damages\n arising from the use of this software.\n\n Permission is granted to anyone to use this software for any purpose,\n including commercial applications, and to alter it and redistribute it\n freely, subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would\n    be appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must not\n    be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source\n    distribution.\n\n========================================================================*/\n/*\n   Fast distance transform and Voronoi:\n   \n   to create the implementation,\n   #define M_DIST_IMPLEMENTATION\n   in *one* C/CPP file that includes this file.\n   \n   optional:\n   include this file after *m_image.h* to enable m_image helpers\n*/\n   \n#ifndef M_DIST_H\n#define M_DIST_H\n\n#define M_DIST_VERSION 1\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef MDAPI\n#define MDAPI extern\n#endif\n\n#define M_DIST_MAX 1e20f\n\n/* raw distance functions\n      dest: squared distance */\nMDAPI void m_dist_transform_1d(float *dest, float *src, int count);\nMDAPI void m_dist_transform_2d(float *dest, float *src, int width, int height);\n\n/* raw voronoi distance functions\n      destd: squared distance, desti: closest src index */\nMDAPI void m_voronoi_transform_1d(float *destd, int *desti, float *src, int count);\nMDAPI void m_voronoi_transform_2d(float *destd, int *desti, float *src, int width, int height);\n\n/* image distance transform */\n#ifdef M_IMAGE_VERSION\n\nMDAPI void m_image_dist_mask_init(struct m_image *dest, const struct m_image *src); /* initialize a valid distance map from a ubyte mask */\nMDAPI void m_image_dist_transform(struct m_image *dest, const struct m_image *src);\nMDAPI void m_image_voronoi_transform(struct m_image *destd, struct m_image *desti, const struct m_image *src);\nMDAPI void m_image_voronoi_fill(struct m_image *dest, const struct m_image *src, const struct m_image *srci);\n\n#endif /* M_IMAGE_VERSION */\n\n#ifdef __cplusplus\n}\n#endif\n/*\n----------------------------------------------------------------------*/\n#endif /* M_DIST_H */\n\n#ifdef M_DIST_IMPLEMENTATION\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <memory.h>\n#include <math.h>\n#include <assert.h>\n\n/* From paper:\n   Distance Transforms of Sampled Functions\n   by Pedro F. Felzenszwalb and Daniel P. Huttenlocher */\n\n#define M_DIST_T()\\\nv[0] = 0;\\\nz[0] = -M_DIST_MAX;\\\nz[1] = M_DIST_MAX;\\\nk = 0;\\\nfor (q = 1; q < count; q++) {\\\n   float s;\\\n   while (1) {\\\n      s = (((double)src[q] + q * q) - ((double)src[v[k]] + v[k] * v[k])) / (double)(2 * q - 2 * v[k]);\\\n      if (s > z[k])\\\n         break;\\\n      k--;\\\n   }\\\n   k++;\\\n   v[k] = q;\\\n   z[k] = s;\\\n   z[k+1] = M_DIST_MAX;\\\n}\n\nvoid m_dist_transform_1d(float *dest, float *src, int count)\n{\n   int *v = (int *)malloc(count * sizeof(int));\n   float *z = (float *)malloc((count + 1) * sizeof(float));\n   int q, k;\n\n   M_DIST_T()\n\n   k = 0;\n   for (q = 0; q < count; q++) {\n      while(z[k+1] < q) k++;\n      dest[q] = (q - v[k]) * (q - v[k]) + src[v[k]];\n   }\n   \n   free(z);\n   free(v);\n}\n\nvoid m_voronoi_transform_1d(float *destd, int *desti, float *src, int count)\n{\n   int *v = (int *)malloc(count * sizeof(int));\n   float *z = (float *)malloc((count + 1) * sizeof(float));\n   int q, k;\n\n   M_DIST_T()\n   \n   k = 0;\n   for (q = 0; q < count; q++) {\n      while (z[k+1] < q) k++;\n      destd[q] = (q - v[k]) * (q - v[k]) + src[v[k]];\n      desti[q] = v[k];\n   }\n\n   free(z);\n   free(v);\n}\n\nvoid m_dist_transform_2d(float *dest, float *src, int width, int height)\n{\n\t\n   float *tmp1 = (float *)malloc(M_MAX(width, height) * sizeof(float));\n   float *tmp2 = (float *)malloc(M_MAX(width, height) * sizeof(float));\n   int x, y;\n\n   /* vertical pass */\n   for (x = 0; x < width; x++) {\n\n      /* fill vertical line */\n      for (y = 0; y < height; y++)\n         tmp1[y] = *(src + width * y + x);\n\n      m_dist_transform_1d(tmp2, tmp1, height);\n\n      /* copy the result */\n      for (y = 0; y < height; y++)\n         *(dest + width * y + x) = tmp2[y];\n   }\n\n   /* horizontal pass */\n   for (y = 0; y < height; y++) {\n      memcpy(tmp1, dest + width * y, width * sizeof(float));\n      m_dist_transform_1d(dest + width * y, tmp1, width);\n   }\n\n   free(tmp2);\n   free(tmp1);\n   \n}\n\nvoid m_voronoi_transform_2d(float *destd, int *desti, float *src, int width, int height)\n{\n   int maxs = M_MAX(width, height);\n   float *tmp1 = (float *)malloc(maxs * sizeof(float));\n   float *tmp2 = (float *)malloc(maxs * sizeof(float));\n   int *tmpi1 = (int *)malloc(maxs * sizeof(int));\n   int *tmpi2 = (int *)malloc(width * sizeof(int));\n   int x, y;\n\n   /* vertical pass */\n   for (x = 0; x < width; x++) {\n\n      /* fill vertical line */\n      for (y = 0; y < height; y++)\n         tmp1[y] = *(src + width * y + x);\n\n      m_voronoi_transform_1d(tmp2, tmpi1, tmp1, height);\n\n      /* copy the result */\n      for (y = 0; y < height; y++) {\n         *(destd + width * y + x) = tmp2[y];\n         *(desti + width * y + x) = tmpi1[y];\n      }\n   }\n\n   /* horizontal pass */\n   for (y = 0; y < height; y++) {\n\n      /* copy distance and index of current line */\n      memcpy(tmp1, destd + width * y, width * sizeof(float));\n      memcpy(tmpi2, desti + width * y, width * sizeof(int));\n      \n      m_voronoi_transform_1d(destd + width * y, tmpi1, tmp1, width);\n\n      /* compute 2d closest pixel index */\n      for (x = 0; x < width; x++) {\n         int _x = tmpi1[x];\n         int _y = tmpi2[_x];\n         *(desti + width * y + x) = _y * width + _x;\n      }\n   }\n\n   free(tmpi2);\n   free(tmpi1);\n   free(tmp2);\n   free(tmp1);\n}\n\n#ifdef M_IMAGE_VERSION\n\nvoid m_image_dist_mask_init(struct m_image *dest, const struct m_image *src)\n{\n   float *dest_data;\n   unsigned char *src_data;\n   int width = src->width;\n   int height = src->height;\n   int size = src->size;\n   int i;\n\n   assert(src->size > 0 && src->type == M_UBYTE && src->comp == 1);\n   m_image_create(dest, M_FLOAT, width, height, 1);\n\n   dest_data = (float *)dest->data;\n   src_data = (unsigned char *)src->data;\n\n   /* init from mask */\n   for (i = 0; i < size; i++)\n      dest_data[i] = src_data[i] < 128 ? M_DIST_MAX : 0;\n}\n\nvoid m_image_dist_transform(struct m_image *dest, const struct m_image *src)\n{\n   float *dest_data;\n   int width = src->width;\n   int height = src->height;\n   int size = src->size;\n   int i;\n   \n   assert(src->size > 0 && src->type == M_FLOAT && src->comp == 1);\n   m_image_create(dest, M_FLOAT, width, height, 1);\n   dest_data = (float *)dest->data;\n\n   /* distance transform */\n   m_dist_transform_2d(dest_data, (float *)src->data, width, height);\n\n   for (i = 0; i < size; i++)\n      dest_data[i] = sqrtf(dest_data[i]);\n}\n\nvoid m_image_voronoi_transform(struct m_image *destd, struct m_image *desti, const struct m_image *src)\n{\n   float *dest_data;\n   int width = src->width;\n   int height = src->height;\n   int size = src->size;\n   int i;\n\n   assert(src->size > 0 && src->type == M_FLOAT && src->comp == 1);\n   m_image_create(destd, M_FLOAT, width, height, 1);\n   m_image_create(desti, M_INT, width, height, 1);\n   dest_data = (float *)destd->data;\n\n   /* distance transform */\n   m_voronoi_transform_2d(dest_data, (int *)desti->data, (float *)src->data, width, height);\n\n   for (i = 0; i < size; i++)\n      dest_data[i] = sqrtf(dest_data[i]);\n}\n\nvoid m_image_voronoi_fill(struct m_image *dest, const struct m_image *src, const struct m_image *srci)\n{\n   #define M_VORO_FILL(T)\\\n   {\\\n      T *sData = (T *)src->data;\\\n      T *dData = (T *)dest->data;\\\n      int i, c;\\\n      for (i = 0; i < size; i++) {\\\n         for (c = 0; c < comp; c++) {\\\n            (*dData) = sData[(*datai) * comp + c];\\\n            dData++;\\\n         }\\\n         datai++;\\\n      }\\\n   }\n\n   int *datai = (int *)srci->data;\n   int comp = src->comp;\n   int size = srci->size;\n\n   m_image_create(dest, src->type, src->width, src->height, src->comp);\n\n   switch(src->type)\n   {\n   case M_BYTE:\n   case M_UBYTE:\n      M_VORO_FILL(char);\n      break;\n   case M_SHORT:\n   case M_USHORT:\n   case M_HALF:\n      M_VORO_FILL(short);\n      break;\n   case M_INT:\n   case M_UINT:\n      M_VORO_FILL(int);\n      break;\n   case M_FLOAT:\n      M_VORO_FILL(float);\n      break;\n   default:\n      assert(0);\n      break;\n   }\n   \n   #undef M_VORO_FILL\n}\n\n#endif /* M_IMAGE_VERSION */\n\n#endif /* M_DIST_IMPLEMENTATION */"
  },
  {
    "path": "include/m_image.h",
    "content": "/*======================================================================\r\n Maratis Tiny C Library\r\n version 1.0\r\n------------------------------------------------------------------------\r\n Copyright (c) 2015 Anael Seghezzi <www.maratis3d.org>\r\n Copyright (c) 2015 Marti Maria Saguer\r\n\r\n This software is provided 'as-is', without any express or implied\r\n warranty. In no event will the authors be held liable for any damages\r\n arising from the use of this software.\r\n\r\n Permission is granted to anyone to use this software for any purpose,\r\n including commercial applications, and to alter it and redistribute it\r\n freely, subject to the following restrictions:\r\n\r\n 1. The origin of this software must not be misrepresented; you must not\r\n    claim that you wrote the original software. If you use this software\r\n    in a product, an acknowledgment in the product documentation would\r\n    be appreciated but is not required.\r\n\r\n 2. Altered source versions must be plainly marked as such, and must not\r\n    be misrepresented as being the original software.\r\n\r\n 3. This notice may not be removed or altered from any source\r\n    distribution.\r\n\r\n========================================================================*/\r\n/*\r\n   Image manipulation :\r\n   - transformation (re-frame, mirror, rotation)\r\n   - conversions (float, half, ubyte, linear, greyscale...)\r\n   - filtering (convolution, Gaussian blur, Harris)\r\n   - scaling (pyramid, generic, bilinear)\r\n   - morphology (flood-fill, dilate, erode, thinning)\r\n   - edge and corner detection (Sobel, Harris)\r\n\r\n   to create the implementation,\r\n   #define M_IMAGE_IMPLEMENTATION\r\n   in *one* C/CPP file that includes this file.\r\n\r\n   optional:\r\n   include after *m_math.h*\r\n   \r\n   //////////////////////////////////////////////////////\r\n   Example: create a 256x256 float image with 1 component:\r\n \r\n   struct m_image foo1 = M_IMAGE_IDENTITY();\r\n   struct m_image foo2 = M_IMAGE_IDENTITY();   \r\n   int x, y;\r\n   \r\n   m_image_create(&foo1, M_FLOAT, 256, 256, 1);\r\n   memset(foo1.data, 0, foo1.size * sizeof(float)); // clear to zero\r\n   \r\n   y = 128; x = 128;\r\n   ((float *)foo1.data)[y * foo1.width + x] = 1.0f; // set (x, y) pixel to one\r\n   \r\n   m_image_gaussian_blur(&foo2, &foo1, 3, 3); // apply Gaussian blur\r\n   \r\n   m_image_destroy(&foo2);\r\n   m_image_destroy(&foo1);\r\n*/\r\n\r\n#ifndef M_IMAGE_H\r\n#define M_IMAGE_H\r\n\r\n#include <stdint.h>\r\n\r\n#define M_IMAGE_VERSION 1\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n#ifndef MIAPI\r\n#define MIAPI extern\r\n#endif\r\n\r\n#define M_VOID   0\r\n#define M_BOOL   1\r\n#define M_BYTE   2\r\n#define M_UBYTE  3\r\n#define M_SHORT  4\r\n#define M_USHORT 5\r\n#define M_INT    6\r\n#define M_UINT   7\r\n#define M_HALF   8\r\n#define M_FLOAT  9\r\n#define M_DOUBLE 10\r\n\r\nstruct m_image\r\n{\r\n   void *data;\r\n   int size;\r\n   int width;\r\n   int height;\r\n   int comp;\r\n   char type;\r\n};\r\n\r\n/* identity, must be used before calling m_image_create */\r\n#define M_IMAGE_IDENTITY() {0, 0, 0, 0, 0, 0}\r\n\r\n/* m_image type util */\r\nMIAPI int m_type_sizeof(char type);\r\n\r\n/* fully supported types are: M_UBYTE, M_USHORT, M_HALF, M_FLOAT\r\n   partially supported types: M_BYTE, M_SHORT, M_INT, M_UINT (no support for conversion) */\r\nMIAPI void m_image_create(struct m_image *image, char type, int width, int height, int comp);\r\nMIAPI void m_image_destroy(struct m_image *image);\r\n\r\nMIAPI void m_image_ubyte_to_float(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_ushort_to_float(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_half_to_float(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_float_to_ubyte(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_float_to_ushort(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_float_to_half(struct m_image *dest, const struct m_image *src);\r\n\r\nMIAPI void m_image_copy(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_copy_sub_image(struct m_image *dest, const struct m_image *src, int x, int y, int w, int h);\r\nMIAPI void m_image_reframe_zero(struct m_image *dest, const struct m_image *src, int left, int top, int right, int bottom);\r\nMIAPI void m_image_reframe(struct m_image *dest, const struct m_image *src, int left, int top, int right, int bottom);\r\nMIAPI void m_image_extract_component(struct m_image *dest, const struct m_image *src, int c);\r\nMIAPI void m_image_rotate_left(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_rotate_right(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_rotate_180(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_mirror_x(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_mirror_y(struct m_image *dest, const struct m_image *src);\r\n\r\nMIAPI void m_image_premultiply(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_unpremultiply(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_sRGB_to_linear(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_linear_to_sRGB(struct m_image *dest, const struct m_image *src);\r\n\r\n/* float/half conversion */\r\nMIAPI float    m_half2float(uint16_t h);\r\nMIAPI uint16_t m_float2half(float flt);\r\n\r\n/* raw processing */\r\nMIAPI void  m_sRGB_to_linear(float *dest, const float *src, int size);\r\nMIAPI void  m_linear_to_sRGB(float *dest, const float *src, int size);\r\nMIAPI void  m_RGB_to_HSV(float *dest, const float *src);\r\nMIAPI void  m_HSV_to_RGB(float *dest, const float *src);\r\nMIAPI void  m_RGB_to_HSL(float *dest, const float *src);\r\nMIAPI void  m_HSL_to_RGB(float *dest, const float *src);\r\nMIAPI void  m_gaussian_kernel(float *dest, int size, float radius);\r\nMIAPI void  m_sst(float *dest, const float *src, int count);\r\nMIAPI void  m_harris_response(float *dest, const float *src, int count);\r\nMIAPI void  m_tfm(float *dest, const float *src, int count);\r\nMIAPI void  m_normalize(float *dest, const float *src, int size); /* dest = src / norm(src) */\r\nMIAPI void  m_normalize_sum(float *dest, const float *src, int size); /* dest = src / sum(src) */\r\nMIAPI float m_mean(const float *src, int size);\r\nMIAPI float m_squared_distance(const float *src1, const float *src2, int size);\r\nMIAPI float m_squared_distance_dispatch(const float *src1, const float *src2, int size);\r\nMIAPI float m_convolution(const float *src1, const float *src2, int size); /* a dot product really */\r\nMIAPI float m_chi_squared_distance(const float *src1, const float *src2, int size); /* good at estimating signed hystograms difference */\r\n\r\n/* conversion to 1 component (float image only) */\r\nMIAPI void m_image_grey(struct m_image *dest, const struct m_image *src); /* from RGB src */\r\nMIAPI void m_image_max(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_max_abs(struct m_image *dest, const struct m_image *src);\r\n\r\n/* summed area table (also called \"integral image\") */\r\nMIAPI void m_image_summed_area(struct m_image *dest, const struct m_image *src);\r\n\r\n/* convolutions (float image only) */\r\n/* if alpha channel, src image must be pre-multiplied */\r\nMIAPI void m_image_convolution_h_raw(struct m_image *dest, const struct m_image *src, float *kernel, int size);\r\nMIAPI void m_image_convolution_v_raw(struct m_image *dest, const struct m_image *src, float *kernel, int size);\r\nMIAPI void m_image_convolution_h(struct m_image *dest, const struct m_image *src, float *kernel, int size); /* horizontal */\r\nMIAPI void m_image_convolution_v(struct m_image *dest, const struct m_image *src, float *kernel, int size); /* vertical */\r\nMIAPI void m_image_gaussian_blur(struct m_image *dest, const struct m_image *src, float dx, float dy);\r\n\r\n/* edge and corner (float 1 component image only) */\r\nMIAPI void m_image_sobel(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_harris(struct m_image *dest, const struct m_image *src, float radius);\r\n\r\n/* morphology (ubyte 1 component image only) */\r\nMIAPI int  m_image_floodfill_4x(struct m_image *dest, int x, int y, uint8_t ref, uint8_t value, uint16_t *stack, int stack_size);\r\nMIAPI int  m_image_floodfill_8x(struct m_image *dest, int x, int y, uint8_t ref, uint8_t value, uint16_t *stack, int stack_size);\r\nMIAPI void m_image_dilate(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_erode(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_edge_4x(struct m_image *dest, const struct m_image *src, uint8_t ref);\r\nMIAPI void m_image_thin(struct m_image *dest);\r\n\r\n/* non maxima suppression (float image only) */\r\nMIAPI void m_image_non_max_supp(struct m_image *dest, const struct m_image *src, int radius, float threshold);\r\n\r\n/* detect Harris corners\r\n   margin: margin around the image to exclude corners\r\n   radius: maxima radius\r\n   threshold: Harris response threshold\r\n   corners: corners coordinates of size max_count * 2\r\n   max_count: maximum number of corners\r\n   return corner count */\r\nMIAPI int m_image_corner_harris(const struct m_image *src, int margin, float radius, float threshold, int *corners, int max_count);\r\n\r\n/* resizing (float image only) */\r\nMIAPI void m_image_sub_pixel(const struct m_image *src, float x, float y, float *result);\r\nMIAPI void m_image_pyrdown(struct m_image *dest, const struct m_image *src);\r\nMIAPI void m_image_resize(struct m_image *dest, const struct m_image *src, int new_width, int new_height);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n/*\r\n----------------------------------------------------------------------*/\r\n#endif /* M_IMAGE_H */\r\n\r\n#ifdef M_IMAGE_IMPLEMENTATION\r\n\r\n#include <stdlib.h>\r\n#include <stdio.h>\r\n#include <memory.h>\r\n#include <math.h>\r\n#include <float.h>\r\n#include <assert.h>\r\n\r\n#ifndef M_SAFE_FREE\r\n#define M_SAFE_FREE(p) {if (p) {free(p); (p) = NULL;}}\r\n#endif\r\n\r\n#ifndef M_MIN\r\n#define M_MIN(a, b) (((a) < (b)) ? (a) : (b))\r\n#endif\r\n#ifndef M_MAX\r\n#define M_MAX(a, b) (((a) > (b)) ? (a) : (b))\r\n#endif\r\n#ifndef M_ABS\r\n#define M_ABS(a) (((a) < 0) ? -(a) : (a))\r\n#endif\r\n#ifndef M_CLAMP\r\n#define M_CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))\r\n#endif\r\n\r\nMIAPI void m_linear_to_sRGB(float *dest, const float *src, int size)\r\n{\r\n   int i;\r\n   for (i = 0; i < size; i++) {\r\n      if (*src < 0.0031308f)\r\n         *dest = 12.92f * (*src);\r\n      else\r\n         *dest = (1.0f + 0.055f) * powf(*src, 1.0f/2.4f) - 0.055f;\r\n      dest++;\r\n      src++;\r\n   }\r\n}\r\n\r\nMIAPI void m_sRGB_to_linear(float *dest, const float *src, int size)\r\n{\r\n   int i;\r\n   for (i = 0; i < size; i++) {\r\n      if (*src <= 0.03928f)\r\n         *dest = *src / 12.92f;\r\n      else\r\n         *dest = powf((*src + 0.055f) / 1.055f, 2.4f);\r\n      dest++;\r\n      src++;\r\n   }\r\n}\r\n\r\nMIAPI void m_RGB_to_HSV(float *dest, const float *src)\r\n{\r\n   float r = src[0];\r\n   float g = src[1];\r\n   float b = src[2];\r\n   float h = 0;\r\n   float s = 0;\r\n   float v = 0;\r\n   float min = r;\r\n   float max = r;\r\n   float delta;\r\n\r\n   min = M_MIN(min, g);\r\n   min = M_MIN(min, b);\r\n   max = M_MAX(max, g);\r\n   max = M_MAX(max, b);\r\n   delta = max - min;\r\n   v = max;\r\n\r\n   if (delta == 0 || max == 0) {\r\n      dest[0] = h; dest[1] = s; dest[2] = v;\r\n      return;\r\n   }\r\n\r\n   s = delta / max;\r\n   \r\n   if (r == max)\r\n      h = (g - b) / delta;\r\n   else if (g == max)\r\n      h = 2 + (b - r) / delta;\r\n   else\r\n      h = 4 + (r - g) / delta;\r\n   \r\n   h *= 60;\r\n   if (h < 0) h += 360;\r\n\r\n   dest[0] = h; dest[1] = s; dest[2] = v;\r\n}\r\n\r\nMIAPI void m_HSV_to_RGB(float *dest, const float *src)\r\n{\r\n   float r, g, b;\r\n   float f, p, q, t;\r\n   float h = src[0];\r\n   float s = src[1];\r\n   float v = src[2];\r\n   int i;\r\n   \r\n   if (s == 0) {\r\n      dest[0] = v; dest[1] = v; dest[2] = v;\r\n      return;\r\n   }\r\n   \r\n   h /= 60.0f;\r\n   i = (int)floorf(h);\r\n   f = h - i;\r\n   p = v * (1 - s);\r\n   q = v * (1 - s * f);\r\n   t = v * (1 - s * (1 - f));\r\n   \r\n   switch (i) {\r\n   case 0:\r\n      r = v; g = t; b = p;\r\n      break;\r\n   case 1:\r\n      r = q; g = v; b = p;\r\n      break;\r\n   case 2:\r\n      r = p; g = v; b = t;\r\n      break;\r\n   case 3:\r\n      r = p; g = q; b = v;\r\n      break;\r\n   case 4:\r\n      r = t; g = p; b = v;\r\n      break;\r\n   default:\r\n      r = v; g = p; b = q;\r\n      break;\r\n   }\r\n   \r\n   dest[0] = r; dest[1] = g; dest[2] = b;\r\n}\r\n\r\nMIAPI void m_RGB_to_HSL(float *dest, const float *src)\r\n{\r\n   float h, s, l, dr, dg, db;\r\n   float r = src[0];\r\n   float g = src[1];\r\n   float b = src[2];\r\n   float min = r;\r\n   float max = r;\r\n   float delta;\r\n\r\n   min = M_MIN(min, g);\r\n   min = M_MIN(min, b);\r\n   max = M_MAX(max, g);\r\n   max = M_MAX(max, b);\r\n\r\n   delta = max - min;\r\n   h = 0;\r\n   s = 0;\r\n   l = (max + min) * 0.5f;\r\n   \r\n   if (max == 0) {\r\n      dest[0] = h; dest[1] = s; dest[2] = l;\r\n      return;\r\n   }\r\n\r\n   if(r == max)\r\n      h = fmodf(((g - b) / delta), 6.0f);\r\n   else if(g == max)\r\n      h = ((b - r) / delta) + 2.0f;\r\n   else\r\n      h = ((r - g) / delta) + 4.0f;\r\n\r\n   h *= 60.0f;\r\n   if (h < 0) h += 360;\r\n    \r\n   s = delta / (1.0f - fabsf(2.0f * l - 1.0f));\r\n   \r\n   dest[0] = h;\r\n   dest[1] = s;\r\n   dest[2] = l;\r\n}\r\n\r\nMIAPI void m_HSL_to_RGB(float *dest, const float *src)\r\n{\r\n   float h = src[0];\r\n   float s = src[1];\r\n   float l = src[2];\r\n   float c, m, x;\r\n   \r\n   if (s == 0) {\r\n      dest[0] = l; dest[1] = l; dest[2] = l;\r\n      return;\r\n   }\r\n   \r\n   c = (1.0f - fabsf(2.0f * l - 1.0f)) * s;\r\n   m = 1.0f * (l - 0.5f * c);\r\n   x = c * (1.0f - fabsf(fmodf(h / 60.0f, 2) - 1.0f));\r\n\r\n   if (h >= 0.0f && h < 60.0f) {\r\n      dest[0] = c + m;\r\n      dest[1] = x + m;\r\n      dest[2] = m;\r\n   }\r\n   else if (h >= 60.0f && h < 120.0f) {\r\n      dest[0] = x + m;\r\n      dest[1] = c + m;\r\n      dest[2] = m;\r\n   }\r\n   else if (h < 120.0f && h < 180.0f) {\r\n      dest[0] = m;\r\n      dest[1] = c + m;\r\n      dest[2] = x + m;\r\n   }\r\n   else if (h >= 180.0f && h < 240.0f) {\r\n      dest[0] = m;\r\n      dest[1] = x + m;\r\n      dest[2] = c + m;\r\n   }\r\n   else if (h >= 240.0f && h < 300.0f) {\r\n      dest[0] = x + m;\r\n      dest[1] = m;\r\n      dest[2] = c + m;\r\n   }\r\n   else if (h >= 300.0f && h < 360.0f) {\r\n      dest[0] = c + m;\r\n      dest[1] = m;\r\n      dest[2] = x + m;\r\n   }\r\n   else {\r\n     dest[0] = m;\r\n     dest[1] = m;\r\n     dest[2] = m;\r\n   }\r\n}\r\n\r\nMIAPI void m_gaussian_kernel(float *dest, int size, float radius)\r\n{\r\n   float *k;\r\n   float rs, s2, sum;\r\n   float sigma = 1.6f;\r\n   float tetha = 2.25f;\r\n   int r, hsize = size / 2;\r\n   \r\n   s2 = 1.0f / expf(sigma * sigma * tetha);\r\n   rs = sigma / radius;\r\n\r\n   k = dest;\r\n   sum = 0.0f;\r\n\r\n   /* compute gaussian kernel */\r\n   for (r = -hsize; r <= hsize; r++) {\r\n      float x = r * rs;\r\n      float v = (1.0f / expf(x * x)) - s2;\r\n      v = M_MAX(v, 0);\r\n      *k = v;\r\n      sum += v;\r\n      k++;\r\n   }\r\n\r\n   /* normalize */\r\n   if (sum > 0.0f) {\r\n      float isum = 1.0f / sum;\r\n      for (r = 0; r < size; r++)\r\n         dest[r] *= isum;\r\n   }\r\n}\r\n\r\nMIAPI void m_sst(float *dest, const float *src, int count)\r\n{\r\n   register int i;\r\n   register float dx;\r\n   register float dy;\r\n   for (i = 0; i < count; i++) {\r\n      dx = src[0];\r\n      dy = src[1];\r\n      dest[0] = dx*dx;\r\n      dest[1] = dy*dy;\r\n      dest[2] = dx*dy;\r\n      src += 2;\r\n      dest += 3;\r\n   }\r\n}\r\n\r\nMIAPI void m_harris_response(float *dest, const float *src, int count)\r\n{\r\n   int i;\r\n   for (i = 0; i < count; i++) {\r\n      float dx2 = src[0];\r\n      float dy2 = src[1];\r\n      float dxy = src[2];\r\n      *dest = (dx2 * dy2 - dxy * dxy) / (dx2 + dy2 + 1e-8f);\r\n      src += 3;\r\n      dest++;\r\n   }\r\n}\r\n\r\nMIAPI void m_tfm(float *dest, const float *src, int count)\r\n{\r\n   int i;\r\n   for (i = 0; i < count; i++) {\r\n\r\n      if (src[0] < src[1]) {\r\n         float dx2 = src[0];\r\n         float dy2 = src[1];\r\n         float dxy = src[2];\r\n         float sqd = (dy2 * dy2) - (2.0f * dx2 * dy2) + (dx2 * dx2) + (4.0f * dxy * dxy);\r\n         float lambda = 0.5f * (dy2 + dx2 + sqrtf(M_MAX(0, sqd)));\r\n         dest[0] = dx2 - lambda;\r\n         dest[1] = dxy;\r\n      }\r\n      else {\r\n         float dy2 = src[0];\r\n         float dx2 = src[1];\r\n         float dxy = src[2];\r\n         float sqd = (dy2 * dy2) - (2.0f * dx2 * dy2) + (dx2 * dx2) + (4.0f * dxy * dxy);\r\n         float lambda = 0.5f * (dy2 + dx2 + sqrtf(M_MAX(0, sqd)));\r\n         dest[0] = dxy;\r\n         dest[1] = dx2 - lambda;\r\n      }\r\n\r\n      src += 3;\r\n      dest += 2;\r\n   }\r\n}\r\n\r\nMIAPI float m_chi_squared_distance(const float *src1, const float *src2, int size)\r\n{\r\n   int i;\r\n   float score = 0;\r\n   for (i = 0; i < size; i++) {\r\n\r\n      float val1 = src1[i];\r\n      float val2 = src2[i];\r\n\r\n      /* chi squared distance */\r\n      if ((val1 + val2) > 0) {\r\n         float x = val2 - val1;\r\n         score += (x * x) / (val1 + val2);\r\n      }\r\n   }\r\n\r\n   return score * 0.5f;\r\n}\r\n\r\nMIAPI float m_convolution(const float *src1, const float *src2, int size)\r\n{\r\n   float c = 0; int i;\r\n   for (i = 0; i < size; i++)\r\n      c += src1[i] * src2[i];\r\n   return c;\r\n}\r\n\r\nMIAPI void m_normalize(float *dest, const float *src, int size)\r\n{\r\n   float sum = 0.0f; int i;\r\n   for(i = 0; i < size; i++)\r\n      sum += src[i] * src[i];\r\n\r\n   if (sum > 0.0f) {\r\n      sum = 1.0f / sqrtf(sum);\r\n      for(i = 0; i < size; i++)\r\n         dest[i] = src[i] * sum;\r\n   }\r\n   else if (dest != src) {\r\n      memset(dest, 0, size * sizeof(float));\r\n   }\r\n}\r\n\r\nMIAPI void m_normalize_sum(float *dest, const float *src, int size)\r\n{\r\n   float sum = 0.0f; int i;\r\n   for(i = 0; i < size; i++)\r\n      sum += src[i];\r\n\r\n   if (sum > 0.0f) {\r\n      sum = 1.0f / sum;\r\n      for(i = 0; i < size; i++)\r\n         dest[i] = src[i] * sum;\r\n   }\r\n   else {\r\n      memset(dest, 0, size * sizeof(float));\r\n   }\r\n}\r\n\r\nMIAPI float m_mean(const float *src, int size)\r\n{\r\n   float mean = 0; int i;\r\n   for (i = 0; i < size; i++)\r\n      mean += (*src++);\r\n   return mean / size;\r\n}\r\n\r\nMIAPI float m_squared_distance(const float *src1, const float *src2, int size)\r\n{\r\n   register float score = 0.0f; \r\n   register int i;\r\n   register float x;\r\n\r\n   for (i = 0; i < size; i++) {\r\n      x = src2[i] - src1[i];\r\n      score += x * x;\r\n   }\r\n   return score;\r\n}\r\n\r\n/* m_half2float / m_float2half :\r\n   a big thanks to Marti Maria Saguer for allowing the use of this code\r\n   under the zlib license from \"Little Color Management System\" (cmshalf.c) */\r\n\r\n/* This code is inspired in the paper \"Fast Half Float Conversions\"\r\n   by Jeroen van der Zijp */\r\n\r\nstatic uint32_t m__mantissa[2048] = {\r\n0x00000000, 0x33800000, 0x34000000, 0x34400000, 0x34800000, 0x34a00000,\r\n0x34c00000, 0x34e00000, 0x35000000, 0x35100000, 0x35200000, 0x35300000,\r\n0x35400000, 0x35500000, 0x35600000, 0x35700000, 0x35800000, 0x35880000,\r\n0x35900000, 0x35980000, 0x35a00000, 0x35a80000, 0x35b00000, 0x35b80000,\r\n0x35c00000, 0x35c80000, 0x35d00000, 0x35d80000, 0x35e00000, 0x35e80000,\r\n0x35f00000, 0x35f80000, 0x36000000, 0x36040000, 0x36080000, 0x360c0000,\r\n0x36100000, 0x36140000, 0x36180000, 0x361c0000, 0x36200000, 0x36240000,\r\n0x36280000, 0x362c0000, 0x36300000, 0x36340000, 0x36380000, 0x363c0000,\r\n0x36400000, 0x36440000, 0x36480000, 0x364c0000, 0x36500000, 0x36540000,\r\n0x36580000, 0x365c0000, 0x36600000, 0x36640000, 0x36680000, 0x366c0000,\r\n0x36700000, 0x36740000, 0x36780000, 0x367c0000, 0x36800000, 0x36820000,\r\n0x36840000, 0x36860000, 0x36880000, 0x368a0000, 0x368c0000, 0x368e0000,\r\n0x36900000, 0x36920000, 0x36940000, 0x36960000, 0x36980000, 0x369a0000,\r\n0x369c0000, 0x369e0000, 0x36a00000, 0x36a20000, 0x36a40000, 0x36a60000,\r\n0x36a80000, 0x36aa0000, 0x36ac0000, 0x36ae0000, 0x36b00000, 0x36b20000,\r\n0x36b40000, 0x36b60000, 0x36b80000, 0x36ba0000, 0x36bc0000, 0x36be0000,\r\n0x36c00000, 0x36c20000, 0x36c40000, 0x36c60000, 0x36c80000, 0x36ca0000,\r\n0x36cc0000, 0x36ce0000, 0x36d00000, 0x36d20000, 0x36d40000, 0x36d60000,\r\n0x36d80000, 0x36da0000, 0x36dc0000, 0x36de0000, 0x36e00000, 0x36e20000,\r\n0x36e40000, 0x36e60000, 0x36e80000, 0x36ea0000, 0x36ec0000, 0x36ee0000,\r\n0x36f00000, 0x36f20000, 0x36f40000, 0x36f60000, 0x36f80000, 0x36fa0000,\r\n0x36fc0000, 0x36fe0000, 0x37000000, 0x37010000, 0x37020000, 0x37030000,\r\n0x37040000, 0x37050000, 0x37060000, 0x37070000, 0x37080000, 0x37090000,\r\n0x370a0000, 0x370b0000, 0x370c0000, 0x370d0000, 0x370e0000, 0x370f0000,\r\n0x37100000, 0x37110000, 0x37120000, 0x37130000, 0x37140000, 0x37150000,\r\n0x37160000, 0x37170000, 0x37180000, 0x37190000, 0x371a0000, 0x371b0000,\r\n0x371c0000, 0x371d0000, 0x371e0000, 0x371f0000, 0x37200000, 0x37210000,\r\n0x37220000, 0x37230000, 0x37240000, 0x37250000, 0x37260000, 0x37270000,\r\n0x37280000, 0x37290000, 0x372a0000, 0x372b0000, 0x372c0000, 0x372d0000,\r\n0x372e0000, 0x372f0000, 0x37300000, 0x37310000, 0x37320000, 0x37330000,\r\n0x37340000, 0x37350000, 0x37360000, 0x37370000, 0x37380000, 0x37390000,\r\n0x373a0000, 0x373b0000, 0x373c0000, 0x373d0000, 0x373e0000, 0x373f0000,\r\n0x37400000, 0x37410000, 0x37420000, 0x37430000, 0x37440000, 0x37450000,\r\n0x37460000, 0x37470000, 0x37480000, 0x37490000, 0x374a0000, 0x374b0000,\r\n0x374c0000, 0x374d0000, 0x374e0000, 0x374f0000, 0x37500000, 0x37510000,\r\n0x37520000, 0x37530000, 0x37540000, 0x37550000, 0x37560000, 0x37570000,\r\n0x37580000, 0x37590000, 0x375a0000, 0x375b0000, 0x375c0000, 0x375d0000,\r\n0x375e0000, 0x375f0000, 0x37600000, 0x37610000, 0x37620000, 0x37630000,\r\n0x37640000, 0x37650000, 0x37660000, 0x37670000, 0x37680000, 0x37690000,\r\n0x376a0000, 0x376b0000, 0x376c0000, 0x376d0000, 0x376e0000, 0x376f0000,\r\n0x37700000, 0x37710000, 0x37720000, 0x37730000, 0x37740000, 0x37750000,\r\n0x37760000, 0x37770000, 0x37780000, 0x37790000, 0x377a0000, 0x377b0000,\r\n0x377c0000, 0x377d0000, 0x377e0000, 0x377f0000, 0x37800000, 0x37808000,\r\n0x37810000, 0x37818000, 0x37820000, 0x37828000, 0x37830000, 0x37838000,\r\n0x37840000, 0x37848000, 0x37850000, 0x37858000, 0x37860000, 0x37868000,\r\n0x37870000, 0x37878000, 0x37880000, 0x37888000, 0x37890000, 0x37898000,\r\n0x378a0000, 0x378a8000, 0x378b0000, 0x378b8000, 0x378c0000, 0x378c8000,\r\n0x378d0000, 0x378d8000, 0x378e0000, 0x378e8000, 0x378f0000, 0x378f8000,\r\n0x37900000, 0x37908000, 0x37910000, 0x37918000, 0x37920000, 0x37928000,\r\n0x37930000, 0x37938000, 0x37940000, 0x37948000, 0x37950000, 0x37958000,\r\n0x37960000, 0x37968000, 0x37970000, 0x37978000, 0x37980000, 0x37988000,\r\n0x37990000, 0x37998000, 0x379a0000, 0x379a8000, 0x379b0000, 0x379b8000,\r\n0x379c0000, 0x379c8000, 0x379d0000, 0x379d8000, 0x379e0000, 0x379e8000,\r\n0x379f0000, 0x379f8000, 0x37a00000, 0x37a08000, 0x37a10000, 0x37a18000,\r\n0x37a20000, 0x37a28000, 0x37a30000, 0x37a38000, 0x37a40000, 0x37a48000,\r\n0x37a50000, 0x37a58000, 0x37a60000, 0x37a68000, 0x37a70000, 0x37a78000,\r\n0x37a80000, 0x37a88000, 0x37a90000, 0x37a98000, 0x37aa0000, 0x37aa8000,\r\n0x37ab0000, 0x37ab8000, 0x37ac0000, 0x37ac8000, 0x37ad0000, 0x37ad8000,\r\n0x37ae0000, 0x37ae8000, 0x37af0000, 0x37af8000, 0x37b00000, 0x37b08000,\r\n0x37b10000, 0x37b18000, 0x37b20000, 0x37b28000, 0x37b30000, 0x37b38000,\r\n0x37b40000, 0x37b48000, 0x37b50000, 0x37b58000, 0x37b60000, 0x37b68000,\r\n0x37b70000, 0x37b78000, 0x37b80000, 0x37b88000, 0x37b90000, 0x37b98000,\r\n0x37ba0000, 0x37ba8000, 0x37bb0000, 0x37bb8000, 0x37bc0000, 0x37bc8000,\r\n0x37bd0000, 0x37bd8000, 0x37be0000, 0x37be8000, 0x37bf0000, 0x37bf8000,\r\n0x37c00000, 0x37c08000, 0x37c10000, 0x37c18000, 0x37c20000, 0x37c28000,\r\n0x37c30000, 0x37c38000, 0x37c40000, 0x37c48000, 0x37c50000, 0x37c58000,\r\n0x37c60000, 0x37c68000, 0x37c70000, 0x37c78000, 0x37c80000, 0x37c88000,\r\n0x37c90000, 0x37c98000, 0x37ca0000, 0x37ca8000, 0x37cb0000, 0x37cb8000,\r\n0x37cc0000, 0x37cc8000, 0x37cd0000, 0x37cd8000, 0x37ce0000, 0x37ce8000,\r\n0x37cf0000, 0x37cf8000, 0x37d00000, 0x37d08000, 0x37d10000, 0x37d18000,\r\n0x37d20000, 0x37d28000, 0x37d30000, 0x37d38000, 0x37d40000, 0x37d48000,\r\n0x37d50000, 0x37d58000, 0x37d60000, 0x37d68000, 0x37d70000, 0x37d78000,\r\n0x37d80000, 0x37d88000, 0x37d90000, 0x37d98000, 0x37da0000, 0x37da8000,\r\n0x37db0000, 0x37db8000, 0x37dc0000, 0x37dc8000, 0x37dd0000, 0x37dd8000,\r\n0x37de0000, 0x37de8000, 0x37df0000, 0x37df8000, 0x37e00000, 0x37e08000,\r\n0x37e10000, 0x37e18000, 0x37e20000, 0x37e28000, 0x37e30000, 0x37e38000,\r\n0x37e40000, 0x37e48000, 0x37e50000, 0x37e58000, 0x37e60000, 0x37e68000,\r\n0x37e70000, 0x37e78000, 0x37e80000, 0x37e88000, 0x37e90000, 0x37e98000,\r\n0x37ea0000, 0x37ea8000, 0x37eb0000, 0x37eb8000, 0x37ec0000, 0x37ec8000,\r\n0x37ed0000, 0x37ed8000, 0x37ee0000, 0x37ee8000, 0x37ef0000, 0x37ef8000,\r\n0x37f00000, 0x37f08000, 0x37f10000, 0x37f18000, 0x37f20000, 0x37f28000,\r\n0x37f30000, 0x37f38000, 0x37f40000, 0x37f48000, 0x37f50000, 0x37f58000,\r\n0x37f60000, 0x37f68000, 0x37f70000, 0x37f78000, 0x37f80000, 0x37f88000,\r\n0x37f90000, 0x37f98000, 0x37fa0000, 0x37fa8000, 0x37fb0000, 0x37fb8000,\r\n0x37fc0000, 0x37fc8000, 0x37fd0000, 0x37fd8000, 0x37fe0000, 0x37fe8000,\r\n0x37ff0000, 0x37ff8000, 0x38000000, 0x38004000, 0x38008000, 0x3800c000,\r\n0x38010000, 0x38014000, 0x38018000, 0x3801c000, 0x38020000, 0x38024000,\r\n0x38028000, 0x3802c000, 0x38030000, 0x38034000, 0x38038000, 0x3803c000,\r\n0x38040000, 0x38044000, 0x38048000, 0x3804c000, 0x38050000, 0x38054000,\r\n0x38058000, 0x3805c000, 0x38060000, 0x38064000, 0x38068000, 0x3806c000,\r\n0x38070000, 0x38074000, 0x38078000, 0x3807c000, 0x38080000, 0x38084000,\r\n0x38088000, 0x3808c000, 0x38090000, 0x38094000, 0x38098000, 0x3809c000,\r\n0x380a0000, 0x380a4000, 0x380a8000, 0x380ac000, 0x380b0000, 0x380b4000,\r\n0x380b8000, 0x380bc000, 0x380c0000, 0x380c4000, 0x380c8000, 0x380cc000,\r\n0x380d0000, 0x380d4000, 0x380d8000, 0x380dc000, 0x380e0000, 0x380e4000,\r\n0x380e8000, 0x380ec000, 0x380f0000, 0x380f4000, 0x380f8000, 0x380fc000,\r\n0x38100000, 0x38104000, 0x38108000, 0x3810c000, 0x38110000, 0x38114000,\r\n0x38118000, 0x3811c000, 0x38120000, 0x38124000, 0x38128000, 0x3812c000,\r\n0x38130000, 0x38134000, 0x38138000, 0x3813c000, 0x38140000, 0x38144000,\r\n0x38148000, 0x3814c000, 0x38150000, 0x38154000, 0x38158000, 0x3815c000,\r\n0x38160000, 0x38164000, 0x38168000, 0x3816c000, 0x38170000, 0x38174000,\r\n0x38178000, 0x3817c000, 0x38180000, 0x38184000, 0x38188000, 0x3818c000,\r\n0x38190000, 0x38194000, 0x38198000, 0x3819c000, 0x381a0000, 0x381a4000,\r\n0x381a8000, 0x381ac000, 0x381b0000, 0x381b4000, 0x381b8000, 0x381bc000,\r\n0x381c0000, 0x381c4000, 0x381c8000, 0x381cc000, 0x381d0000, 0x381d4000,\r\n0x381d8000, 0x381dc000, 0x381e0000, 0x381e4000, 0x381e8000, 0x381ec000,\r\n0x381f0000, 0x381f4000, 0x381f8000, 0x381fc000, 0x38200000, 0x38204000,\r\n0x38208000, 0x3820c000, 0x38210000, 0x38214000, 0x38218000, 0x3821c000,\r\n0x38220000, 0x38224000, 0x38228000, 0x3822c000, 0x38230000, 0x38234000,\r\n0x38238000, 0x3823c000, 0x38240000, 0x38244000, 0x38248000, 0x3824c000,\r\n0x38250000, 0x38254000, 0x38258000, 0x3825c000, 0x38260000, 0x38264000,\r\n0x38268000, 0x3826c000, 0x38270000, 0x38274000, 0x38278000, 0x3827c000,\r\n0x38280000, 0x38284000, 0x38288000, 0x3828c000, 0x38290000, 0x38294000,\r\n0x38298000, 0x3829c000, 0x382a0000, 0x382a4000, 0x382a8000, 0x382ac000,\r\n0x382b0000, 0x382b4000, 0x382b8000, 0x382bc000, 0x382c0000, 0x382c4000,\r\n0x382c8000, 0x382cc000, 0x382d0000, 0x382d4000, 0x382d8000, 0x382dc000,\r\n0x382e0000, 0x382e4000, 0x382e8000, 0x382ec000, 0x382f0000, 0x382f4000,\r\n0x382f8000, 0x382fc000, 0x38300000, 0x38304000, 0x38308000, 0x3830c000,\r\n0x38310000, 0x38314000, 0x38318000, 0x3831c000, 0x38320000, 0x38324000,\r\n0x38328000, 0x3832c000, 0x38330000, 0x38334000, 0x38338000, 0x3833c000,\r\n0x38340000, 0x38344000, 0x38348000, 0x3834c000, 0x38350000, 0x38354000,\r\n0x38358000, 0x3835c000, 0x38360000, 0x38364000, 0x38368000, 0x3836c000,\r\n0x38370000, 0x38374000, 0x38378000, 0x3837c000, 0x38380000, 0x38384000,\r\n0x38388000, 0x3838c000, 0x38390000, 0x38394000, 0x38398000, 0x3839c000,\r\n0x383a0000, 0x383a4000, 0x383a8000, 0x383ac000, 0x383b0000, 0x383b4000,\r\n0x383b8000, 0x383bc000, 0x383c0000, 0x383c4000, 0x383c8000, 0x383cc000,\r\n0x383d0000, 0x383d4000, 0x383d8000, 0x383dc000, 0x383e0000, 0x383e4000,\r\n0x383e8000, 0x383ec000, 0x383f0000, 0x383f4000, 0x383f8000, 0x383fc000,\r\n0x38400000, 0x38404000, 0x38408000, 0x3840c000, 0x38410000, 0x38414000,\r\n0x38418000, 0x3841c000, 0x38420000, 0x38424000, 0x38428000, 0x3842c000,\r\n0x38430000, 0x38434000, 0x38438000, 0x3843c000, 0x38440000, 0x38444000,\r\n0x38448000, 0x3844c000, 0x38450000, 0x38454000, 0x38458000, 0x3845c000,\r\n0x38460000, 0x38464000, 0x38468000, 0x3846c000, 0x38470000, 0x38474000,\r\n0x38478000, 0x3847c000, 0x38480000, 0x38484000, 0x38488000, 0x3848c000,\r\n0x38490000, 0x38494000, 0x38498000, 0x3849c000, 0x384a0000, 0x384a4000,\r\n0x384a8000, 0x384ac000, 0x384b0000, 0x384b4000, 0x384b8000, 0x384bc000,\r\n0x384c0000, 0x384c4000, 0x384c8000, 0x384cc000, 0x384d0000, 0x384d4000,\r\n0x384d8000, 0x384dc000, 0x384e0000, 0x384e4000, 0x384e8000, 0x384ec000,\r\n0x384f0000, 0x384f4000, 0x384f8000, 0x384fc000, 0x38500000, 0x38504000,\r\n0x38508000, 0x3850c000, 0x38510000, 0x38514000, 0x38518000, 0x3851c000,\r\n0x38520000, 0x38524000, 0x38528000, 0x3852c000, 0x38530000, 0x38534000,\r\n0x38538000, 0x3853c000, 0x38540000, 0x38544000, 0x38548000, 0x3854c000,\r\n0x38550000, 0x38554000, 0x38558000, 0x3855c000, 0x38560000, 0x38564000,\r\n0x38568000, 0x3856c000, 0x38570000, 0x38574000, 0x38578000, 0x3857c000,\r\n0x38580000, 0x38584000, 0x38588000, 0x3858c000, 0x38590000, 0x38594000,\r\n0x38598000, 0x3859c000, 0x385a0000, 0x385a4000, 0x385a8000, 0x385ac000,\r\n0x385b0000, 0x385b4000, 0x385b8000, 0x385bc000, 0x385c0000, 0x385c4000,\r\n0x385c8000, 0x385cc000, 0x385d0000, 0x385d4000, 0x385d8000, 0x385dc000,\r\n0x385e0000, 0x385e4000, 0x385e8000, 0x385ec000, 0x385f0000, 0x385f4000,\r\n0x385f8000, 0x385fc000, 0x38600000, 0x38604000, 0x38608000, 0x3860c000,\r\n0x38610000, 0x38614000, 0x38618000, 0x3861c000, 0x38620000, 0x38624000,\r\n0x38628000, 0x3862c000, 0x38630000, 0x38634000, 0x38638000, 0x3863c000,\r\n0x38640000, 0x38644000, 0x38648000, 0x3864c000, 0x38650000, 0x38654000,\r\n0x38658000, 0x3865c000, 0x38660000, 0x38664000, 0x38668000, 0x3866c000,\r\n0x38670000, 0x38674000, 0x38678000, 0x3867c000, 0x38680000, 0x38684000,\r\n0x38688000, 0x3868c000, 0x38690000, 0x38694000, 0x38698000, 0x3869c000,\r\n0x386a0000, 0x386a4000, 0x386a8000, 0x386ac000, 0x386b0000, 0x386b4000,\r\n0x386b8000, 0x386bc000, 0x386c0000, 0x386c4000, 0x386c8000, 0x386cc000,\r\n0x386d0000, 0x386d4000, 0x386d8000, 0x386dc000, 0x386e0000, 0x386e4000,\r\n0x386e8000, 0x386ec000, 0x386f0000, 0x386f4000, 0x386f8000, 0x386fc000,\r\n0x38700000, 0x38704000, 0x38708000, 0x3870c000, 0x38710000, 0x38714000,\r\n0x38718000, 0x3871c000, 0x38720000, 0x38724000, 0x38728000, 0x3872c000,\r\n0x38730000, 0x38734000, 0x38738000, 0x3873c000, 0x38740000, 0x38744000,\r\n0x38748000, 0x3874c000, 0x38750000, 0x38754000, 0x38758000, 0x3875c000,\r\n0x38760000, 0x38764000, 0x38768000, 0x3876c000, 0x38770000, 0x38774000,\r\n0x38778000, 0x3877c000, 0x38780000, 0x38784000, 0x38788000, 0x3878c000,\r\n0x38790000, 0x38794000, 0x38798000, 0x3879c000, 0x387a0000, 0x387a4000,\r\n0x387a8000, 0x387ac000, 0x387b0000, 0x387b4000, 0x387b8000, 0x387bc000,\r\n0x387c0000, 0x387c4000, 0x387c8000, 0x387cc000, 0x387d0000, 0x387d4000,\r\n0x387d8000, 0x387dc000, 0x387e0000, 0x387e4000, 0x387e8000, 0x387ec000,\r\n0x387f0000, 0x387f4000, 0x387f8000, 0x387fc000, 0x38000000, 0x38002000,\r\n0x38004000, 0x38006000, 0x38008000, 0x3800a000, 0x3800c000, 0x3800e000,\r\n0x38010000, 0x38012000, 0x38014000, 0x38016000, 0x38018000, 0x3801a000,\r\n0x3801c000, 0x3801e000, 0x38020000, 0x38022000, 0x38024000, 0x38026000,\r\n0x38028000, 0x3802a000, 0x3802c000, 0x3802e000, 0x38030000, 0x38032000,\r\n0x38034000, 0x38036000, 0x38038000, 0x3803a000, 0x3803c000, 0x3803e000,\r\n0x38040000, 0x38042000, 0x38044000, 0x38046000, 0x38048000, 0x3804a000,\r\n0x3804c000, 0x3804e000, 0x38050000, 0x38052000, 0x38054000, 0x38056000,\r\n0x38058000, 0x3805a000, 0x3805c000, 0x3805e000, 0x38060000, 0x38062000,\r\n0x38064000, 0x38066000, 0x38068000, 0x3806a000, 0x3806c000, 0x3806e000,\r\n0x38070000, 0x38072000, 0x38074000, 0x38076000, 0x38078000, 0x3807a000,\r\n0x3807c000, 0x3807e000, 0x38080000, 0x38082000, 0x38084000, 0x38086000,\r\n0x38088000, 0x3808a000, 0x3808c000, 0x3808e000, 0x38090000, 0x38092000,\r\n0x38094000, 0x38096000, 0x38098000, 0x3809a000, 0x3809c000, 0x3809e000,\r\n0x380a0000, 0x380a2000, 0x380a4000, 0x380a6000, 0x380a8000, 0x380aa000,\r\n0x380ac000, 0x380ae000, 0x380b0000, 0x380b2000, 0x380b4000, 0x380b6000,\r\n0x380b8000, 0x380ba000, 0x380bc000, 0x380be000, 0x380c0000, 0x380c2000,\r\n0x380c4000, 0x380c6000, 0x380c8000, 0x380ca000, 0x380cc000, 0x380ce000,\r\n0x380d0000, 0x380d2000, 0x380d4000, 0x380d6000, 0x380d8000, 0x380da000,\r\n0x380dc000, 0x380de000, 0x380e0000, 0x380e2000, 0x380e4000, 0x380e6000,\r\n0x380e8000, 0x380ea000, 0x380ec000, 0x380ee000, 0x380f0000, 0x380f2000,\r\n0x380f4000, 0x380f6000, 0x380f8000, 0x380fa000, 0x380fc000, 0x380fe000,\r\n0x38100000, 0x38102000, 0x38104000, 0x38106000, 0x38108000, 0x3810a000,\r\n0x3810c000, 0x3810e000, 0x38110000, 0x38112000, 0x38114000, 0x38116000,\r\n0x38118000, 0x3811a000, 0x3811c000, 0x3811e000, 0x38120000, 0x38122000,\r\n0x38124000, 0x38126000, 0x38128000, 0x3812a000, 0x3812c000, 0x3812e000,\r\n0x38130000, 0x38132000, 0x38134000, 0x38136000, 0x38138000, 0x3813a000,\r\n0x3813c000, 0x3813e000, 0x38140000, 0x38142000, 0x38144000, 0x38146000,\r\n0x38148000, 0x3814a000, 0x3814c000, 0x3814e000, 0x38150000, 0x38152000,\r\n0x38154000, 0x38156000, 0x38158000, 0x3815a000, 0x3815c000, 0x3815e000,\r\n0x38160000, 0x38162000, 0x38164000, 0x38166000, 0x38168000, 0x3816a000,\r\n0x3816c000, 0x3816e000, 0x38170000, 0x38172000, 0x38174000, 0x38176000,\r\n0x38178000, 0x3817a000, 0x3817c000, 0x3817e000, 0x38180000, 0x38182000,\r\n0x38184000, 0x38186000, 0x38188000, 0x3818a000, 0x3818c000, 0x3818e000,\r\n0x38190000, 0x38192000, 0x38194000, 0x38196000, 0x38198000, 0x3819a000,\r\n0x3819c000, 0x3819e000, 0x381a0000, 0x381a2000, 0x381a4000, 0x381a6000,\r\n0x381a8000, 0x381aa000, 0x381ac000, 0x381ae000, 0x381b0000, 0x381b2000,\r\n0x381b4000, 0x381b6000, 0x381b8000, 0x381ba000, 0x381bc000, 0x381be000,\r\n0x381c0000, 0x381c2000, 0x381c4000, 0x381c6000, 0x381c8000, 0x381ca000,\r\n0x381cc000, 0x381ce000, 0x381d0000, 0x381d2000, 0x381d4000, 0x381d6000,\r\n0x381d8000, 0x381da000, 0x381dc000, 0x381de000, 0x381e0000, 0x381e2000,\r\n0x381e4000, 0x381e6000, 0x381e8000, 0x381ea000, 0x381ec000, 0x381ee000,\r\n0x381f0000, 0x381f2000, 0x381f4000, 0x381f6000, 0x381f8000, 0x381fa000,\r\n0x381fc000, 0x381fe000, 0x38200000, 0x38202000, 0x38204000, 0x38206000,\r\n0x38208000, 0x3820a000, 0x3820c000, 0x3820e000, 0x38210000, 0x38212000,\r\n0x38214000, 0x38216000, 0x38218000, 0x3821a000, 0x3821c000, 0x3821e000,\r\n0x38220000, 0x38222000, 0x38224000, 0x38226000, 0x38228000, 0x3822a000,\r\n0x3822c000, 0x3822e000, 0x38230000, 0x38232000, 0x38234000, 0x38236000,\r\n0x38238000, 0x3823a000, 0x3823c000, 0x3823e000, 0x38240000, 0x38242000,\r\n0x38244000, 0x38246000, 0x38248000, 0x3824a000, 0x3824c000, 0x3824e000,\r\n0x38250000, 0x38252000, 0x38254000, 0x38256000, 0x38258000, 0x3825a000,\r\n0x3825c000, 0x3825e000, 0x38260000, 0x38262000, 0x38264000, 0x38266000,\r\n0x38268000, 0x3826a000, 0x3826c000, 0x3826e000, 0x38270000, 0x38272000,\r\n0x38274000, 0x38276000, 0x38278000, 0x3827a000, 0x3827c000, 0x3827e000,\r\n0x38280000, 0x38282000, 0x38284000, 0x38286000, 0x38288000, 0x3828a000,\r\n0x3828c000, 0x3828e000, 0x38290000, 0x38292000, 0x38294000, 0x38296000,\r\n0x38298000, 0x3829a000, 0x3829c000, 0x3829e000, 0x382a0000, 0x382a2000,\r\n0x382a4000, 0x382a6000, 0x382a8000, 0x382aa000, 0x382ac000, 0x382ae000,\r\n0x382b0000, 0x382b2000, 0x382b4000, 0x382b6000, 0x382b8000, 0x382ba000,\r\n0x382bc000, 0x382be000, 0x382c0000, 0x382c2000, 0x382c4000, 0x382c6000,\r\n0x382c8000, 0x382ca000, 0x382cc000, 0x382ce000, 0x382d0000, 0x382d2000,\r\n0x382d4000, 0x382d6000, 0x382d8000, 0x382da000, 0x382dc000, 0x382de000,\r\n0x382e0000, 0x382e2000, 0x382e4000, 0x382e6000, 0x382e8000, 0x382ea000,\r\n0x382ec000, 0x382ee000, 0x382f0000, 0x382f2000, 0x382f4000, 0x382f6000,\r\n0x382f8000, 0x382fa000, 0x382fc000, 0x382fe000, 0x38300000, 0x38302000,\r\n0x38304000, 0x38306000, 0x38308000, 0x3830a000, 0x3830c000, 0x3830e000,\r\n0x38310000, 0x38312000, 0x38314000, 0x38316000, 0x38318000, 0x3831a000,\r\n0x3831c000, 0x3831e000, 0x38320000, 0x38322000, 0x38324000, 0x38326000,\r\n0x38328000, 0x3832a000, 0x3832c000, 0x3832e000, 0x38330000, 0x38332000,\r\n0x38334000, 0x38336000, 0x38338000, 0x3833a000, 0x3833c000, 0x3833e000,\r\n0x38340000, 0x38342000, 0x38344000, 0x38346000, 0x38348000, 0x3834a000,\r\n0x3834c000, 0x3834e000, 0x38350000, 0x38352000, 0x38354000, 0x38356000,\r\n0x38358000, 0x3835a000, 0x3835c000, 0x3835e000, 0x38360000, 0x38362000,\r\n0x38364000, 0x38366000, 0x38368000, 0x3836a000, 0x3836c000, 0x3836e000,\r\n0x38370000, 0x38372000, 0x38374000, 0x38376000, 0x38378000, 0x3837a000,\r\n0x3837c000, 0x3837e000, 0x38380000, 0x38382000, 0x38384000, 0x38386000,\r\n0x38388000, 0x3838a000, 0x3838c000, 0x3838e000, 0x38390000, 0x38392000,\r\n0x38394000, 0x38396000, 0x38398000, 0x3839a000, 0x3839c000, 0x3839e000,\r\n0x383a0000, 0x383a2000, 0x383a4000, 0x383a6000, 0x383a8000, 0x383aa000,\r\n0x383ac000, 0x383ae000, 0x383b0000, 0x383b2000, 0x383b4000, 0x383b6000,\r\n0x383b8000, 0x383ba000, 0x383bc000, 0x383be000, 0x383c0000, 0x383c2000,\r\n0x383c4000, 0x383c6000, 0x383c8000, 0x383ca000, 0x383cc000, 0x383ce000,\r\n0x383d0000, 0x383d2000, 0x383d4000, 0x383d6000, 0x383d8000, 0x383da000,\r\n0x383dc000, 0x383de000, 0x383e0000, 0x383e2000, 0x383e4000, 0x383e6000,\r\n0x383e8000, 0x383ea000, 0x383ec000, 0x383ee000, 0x383f0000, 0x383f2000,\r\n0x383f4000, 0x383f6000, 0x383f8000, 0x383fa000, 0x383fc000, 0x383fe000,\r\n0x38400000, 0x38402000, 0x38404000, 0x38406000, 0x38408000, 0x3840a000,\r\n0x3840c000, 0x3840e000, 0x38410000, 0x38412000, 0x38414000, 0x38416000,\r\n0x38418000, 0x3841a000, 0x3841c000, 0x3841e000, 0x38420000, 0x38422000,\r\n0x38424000, 0x38426000, 0x38428000, 0x3842a000, 0x3842c000, 0x3842e000,\r\n0x38430000, 0x38432000, 0x38434000, 0x38436000, 0x38438000, 0x3843a000,\r\n0x3843c000, 0x3843e000, 0x38440000, 0x38442000, 0x38444000, 0x38446000,\r\n0x38448000, 0x3844a000, 0x3844c000, 0x3844e000, 0x38450000, 0x38452000,\r\n0x38454000, 0x38456000, 0x38458000, 0x3845a000, 0x3845c000, 0x3845e000,\r\n0x38460000, 0x38462000, 0x38464000, 0x38466000, 0x38468000, 0x3846a000,\r\n0x3846c000, 0x3846e000, 0x38470000, 0x38472000, 0x38474000, 0x38476000,\r\n0x38478000, 0x3847a000, 0x3847c000, 0x3847e000, 0x38480000, 0x38482000,\r\n0x38484000, 0x38486000, 0x38488000, 0x3848a000, 0x3848c000, 0x3848e000,\r\n0x38490000, 0x38492000, 0x38494000, 0x38496000, 0x38498000, 0x3849a000,\r\n0x3849c000, 0x3849e000, 0x384a0000, 0x384a2000, 0x384a4000, 0x384a6000,\r\n0x384a8000, 0x384aa000, 0x384ac000, 0x384ae000, 0x384b0000, 0x384b2000,\r\n0x384b4000, 0x384b6000, 0x384b8000, 0x384ba000, 0x384bc000, 0x384be000,\r\n0x384c0000, 0x384c2000, 0x384c4000, 0x384c6000, 0x384c8000, 0x384ca000,\r\n0x384cc000, 0x384ce000, 0x384d0000, 0x384d2000, 0x384d4000, 0x384d6000,\r\n0x384d8000, 0x384da000, 0x384dc000, 0x384de000, 0x384e0000, 0x384e2000,\r\n0x384e4000, 0x384e6000, 0x384e8000, 0x384ea000, 0x384ec000, 0x384ee000,\r\n0x384f0000, 0x384f2000, 0x384f4000, 0x384f6000, 0x384f8000, 0x384fa000,\r\n0x384fc000, 0x384fe000, 0x38500000, 0x38502000, 0x38504000, 0x38506000,\r\n0x38508000, 0x3850a000, 0x3850c000, 0x3850e000, 0x38510000, 0x38512000,\r\n0x38514000, 0x38516000, 0x38518000, 0x3851a000, 0x3851c000, 0x3851e000,\r\n0x38520000, 0x38522000, 0x38524000, 0x38526000, 0x38528000, 0x3852a000,\r\n0x3852c000, 0x3852e000, 0x38530000, 0x38532000, 0x38534000, 0x38536000,\r\n0x38538000, 0x3853a000, 0x3853c000, 0x3853e000, 0x38540000, 0x38542000,\r\n0x38544000, 0x38546000, 0x38548000, 0x3854a000, 0x3854c000, 0x3854e000,\r\n0x38550000, 0x38552000, 0x38554000, 0x38556000, 0x38558000, 0x3855a000,\r\n0x3855c000, 0x3855e000, 0x38560000, 0x38562000, 0x38564000, 0x38566000,\r\n0x38568000, 0x3856a000, 0x3856c000, 0x3856e000, 0x38570000, 0x38572000,\r\n0x38574000, 0x38576000, 0x38578000, 0x3857a000, 0x3857c000, 0x3857e000,\r\n0x38580000, 0x38582000, 0x38584000, 0x38586000, 0x38588000, 0x3858a000,\r\n0x3858c000, 0x3858e000, 0x38590000, 0x38592000, 0x38594000, 0x38596000,\r\n0x38598000, 0x3859a000, 0x3859c000, 0x3859e000, 0x385a0000, 0x385a2000,\r\n0x385a4000, 0x385a6000, 0x385a8000, 0x385aa000, 0x385ac000, 0x385ae000,\r\n0x385b0000, 0x385b2000, 0x385b4000, 0x385b6000, 0x385b8000, 0x385ba000,\r\n0x385bc000, 0x385be000, 0x385c0000, 0x385c2000, 0x385c4000, 0x385c6000,\r\n0x385c8000, 0x385ca000, 0x385cc000, 0x385ce000, 0x385d0000, 0x385d2000,\r\n0x385d4000, 0x385d6000, 0x385d8000, 0x385da000, 0x385dc000, 0x385de000,\r\n0x385e0000, 0x385e2000, 0x385e4000, 0x385e6000, 0x385e8000, 0x385ea000,\r\n0x385ec000, 0x385ee000, 0x385f0000, 0x385f2000, 0x385f4000, 0x385f6000,\r\n0x385f8000, 0x385fa000, 0x385fc000, 0x385fe000, 0x38600000, 0x38602000,\r\n0x38604000, 0x38606000, 0x38608000, 0x3860a000, 0x3860c000, 0x3860e000,\r\n0x38610000, 0x38612000, 0x38614000, 0x38616000, 0x38618000, 0x3861a000,\r\n0x3861c000, 0x3861e000, 0x38620000, 0x38622000, 0x38624000, 0x38626000,\r\n0x38628000, 0x3862a000, 0x3862c000, 0x3862e000, 0x38630000, 0x38632000,\r\n0x38634000, 0x38636000, 0x38638000, 0x3863a000, 0x3863c000, 0x3863e000,\r\n0x38640000, 0x38642000, 0x38644000, 0x38646000, 0x38648000, 0x3864a000,\r\n0x3864c000, 0x3864e000, 0x38650000, 0x38652000, 0x38654000, 0x38656000,\r\n0x38658000, 0x3865a000, 0x3865c000, 0x3865e000, 0x38660000, 0x38662000,\r\n0x38664000, 0x38666000, 0x38668000, 0x3866a000, 0x3866c000, 0x3866e000,\r\n0x38670000, 0x38672000, 0x38674000, 0x38676000, 0x38678000, 0x3867a000,\r\n0x3867c000, 0x3867e000, 0x38680000, 0x38682000, 0x38684000, 0x38686000,\r\n0x38688000, 0x3868a000, 0x3868c000, 0x3868e000, 0x38690000, 0x38692000,\r\n0x38694000, 0x38696000, 0x38698000, 0x3869a000, 0x3869c000, 0x3869e000,\r\n0x386a0000, 0x386a2000, 0x386a4000, 0x386a6000, 0x386a8000, 0x386aa000,\r\n0x386ac000, 0x386ae000, 0x386b0000, 0x386b2000, 0x386b4000, 0x386b6000,\r\n0x386b8000, 0x386ba000, 0x386bc000, 0x386be000, 0x386c0000, 0x386c2000,\r\n0x386c4000, 0x386c6000, 0x386c8000, 0x386ca000, 0x386cc000, 0x386ce000,\r\n0x386d0000, 0x386d2000, 0x386d4000, 0x386d6000, 0x386d8000, 0x386da000,\r\n0x386dc000, 0x386de000, 0x386e0000, 0x386e2000, 0x386e4000, 0x386e6000,\r\n0x386e8000, 0x386ea000, 0x386ec000, 0x386ee000, 0x386f0000, 0x386f2000,\r\n0x386f4000, 0x386f6000, 0x386f8000, 0x386fa000, 0x386fc000, 0x386fe000,\r\n0x38700000, 0x38702000, 0x38704000, 0x38706000, 0x38708000, 0x3870a000,\r\n0x3870c000, 0x3870e000, 0x38710000, 0x38712000, 0x38714000, 0x38716000,\r\n0x38718000, 0x3871a000, 0x3871c000, 0x3871e000, 0x38720000, 0x38722000,\r\n0x38724000, 0x38726000, 0x38728000, 0x3872a000, 0x3872c000, 0x3872e000,\r\n0x38730000, 0x38732000, 0x38734000, 0x38736000, 0x38738000, 0x3873a000,\r\n0x3873c000, 0x3873e000, 0x38740000, 0x38742000, 0x38744000, 0x38746000,\r\n0x38748000, 0x3874a000, 0x3874c000, 0x3874e000, 0x38750000, 0x38752000,\r\n0x38754000, 0x38756000, 0x38758000, 0x3875a000, 0x3875c000, 0x3875e000,\r\n0x38760000, 0x38762000, 0x38764000, 0x38766000, 0x38768000, 0x3876a000,\r\n0x3876c000, 0x3876e000, 0x38770000, 0x38772000, 0x38774000, 0x38776000,\r\n0x38778000, 0x3877a000, 0x3877c000, 0x3877e000, 0x38780000, 0x38782000,\r\n0x38784000, 0x38786000, 0x38788000, 0x3878a000, 0x3878c000, 0x3878e000,\r\n0x38790000, 0x38792000, 0x38794000, 0x38796000, 0x38798000, 0x3879a000,\r\n0x3879c000, 0x3879e000, 0x387a0000, 0x387a2000, 0x387a4000, 0x387a6000,\r\n0x387a8000, 0x387aa000, 0x387ac000, 0x387ae000, 0x387b0000, 0x387b2000,\r\n0x387b4000, 0x387b6000, 0x387b8000, 0x387ba000, 0x387bc000, 0x387be000,\r\n0x387c0000, 0x387c2000, 0x387c4000, 0x387c6000, 0x387c8000, 0x387ca000,\r\n0x387cc000, 0x387ce000, 0x387d0000, 0x387d2000, 0x387d4000, 0x387d6000,\r\n0x387d8000, 0x387da000, 0x387dc000, 0x387de000, 0x387e0000, 0x387e2000,\r\n0x387e4000, 0x387e6000, 0x387e8000, 0x387ea000, 0x387ec000, 0x387ee000,\r\n0x387f0000, 0x387f2000, 0x387f4000, 0x387f6000, 0x387f8000, 0x387fa000,\r\n0x387fc000, 0x387fe000\r\n};\r\n\r\nstatic uint16_t m__offset[64] = {\r\n0x0000, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0000, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400,\r\n0x0400, 0x0400, 0x0400, 0x0400\r\n};\r\n\r\nstatic uint32_t m__exponent[64] = {\r\n0x00000000, 0x00800000, 0x01000000, 0x01800000, 0x02000000, 0x02800000,\r\n0x03000000, 0x03800000, 0x04000000, 0x04800000, 0x05000000, 0x05800000,\r\n0x06000000, 0x06800000, 0x07000000, 0x07800000, 0x08000000, 0x08800000,\r\n0x09000000, 0x09800000, 0x0a000000, 0x0a800000, 0x0b000000, 0x0b800000,\r\n0x0c000000, 0x0c800000, 0x0d000000, 0x0d800000, 0x0e000000, 0x0e800000,\r\n0x0f000000, 0x47800000, 0x80000000, 0x80800000, 0x81000000, 0x81800000,\r\n0x82000000, 0x82800000, 0x83000000, 0x83800000, 0x84000000, 0x84800000,\r\n0x85000000, 0x85800000, 0x86000000, 0x86800000, 0x87000000, 0x87800000,\r\n0x88000000, 0x88800000, 0x89000000, 0x89800000, 0x8a000000, 0x8a800000,\r\n0x8b000000, 0x8b800000, 0x8c000000, 0x8c800000, 0x8d000000, 0x8d800000,\r\n0x8e000000, 0x8e800000, 0x8f000000, 0xc7800000\r\n};\r\n\r\nstatic uint16_t m__base[512] = {\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\r\n0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040,\r\n0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x0c00, 0x1000, 0x1400, 0x1800, 0x1c00,\r\n0x2000, 0x2400, 0x2800, 0x2c00, 0x3000, 0x3400, 0x3800, 0x3c00, 0x4000, 0x4400,\r\n0x4800, 0x4c00, 0x5000, 0x5400, 0x5800, 0x5c00, 0x6000, 0x6400, 0x6800, 0x6c00,\r\n0x7000, 0x7400, 0x7800, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,\r\n0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\r\n0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8001,\r\n0x8002, 0x8004, 0x8008, 0x8010, 0x8020, 0x8040, 0x8080, 0x8100, 0x8200, 0x8400,\r\n0x8800, 0x8c00, 0x9000, 0x9400, 0x9800, 0x9c00, 0xa000, 0xa400, 0xa800, 0xac00,\r\n0xb000, 0xb400, 0xb800, 0xbc00, 0xc000, 0xc400, 0xc800, 0xcc00, 0xd000, 0xd400,\r\n0xd800, 0xdc00, 0xe000, 0xe400, 0xe800, 0xec00, 0xf000, 0xf400, 0xf800, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00, 0xfc00,\r\n0xfc00, 0xfc00\r\n};\r\n\r\nstatic uint8_t  m__shift[512] = {\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x17,\r\n0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0f, 0x0e, 0x0d, 0x0d, 0x0d, 0x0d,\r\n0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,\r\n0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0d, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13,\r\n0x12, 0x11, 0x10, 0x0f, 0x0e, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,\r\n0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,\r\n0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,\r\n0x18, 0x18, 0x18, 0x18, 0x0d\r\n};\r\n\r\nMIAPI float m_half2float(uint16_t h)\r\n{\r\n   union {\r\n      float flt;\r\n      uint32_t  num;\r\n   } out;\r\n\r\n   int n = h >> 10;\r\n\r\n   out.num = m__mantissa[ (h & 0x3ff) + m__offset[n]] + m__exponent[n];\r\n   return out.flt;\r\n}\r\n\r\nMIAPI uint16_t m_float2half(float flt)\r\n{\r\n   union {\r\n      float flt;\r\n      uint32_t  num;\r\n   } in;\r\n\r\n   uint32_t n, j;\r\n\r\n   in.flt = flt;\r\n   n = in.num;\r\n   j = (n >> 23) & 0x1ff;\r\n\r\n   return (uint16_t) ((uint32_t) m__base[j] + ((n & 0x007fffff) >> m__shift[j]));\r\n}\r\n\r\nMIAPI int m_type_sizeof(char type)\r\n{\r\n   switch (type) {\r\n   case M_BYTE:\r\n   case M_UBYTE:\r\n      return sizeof(uint8_t);\r\n      break;\r\n   case M_SHORT:\r\n   case M_USHORT:\r\n   case M_HALF:\r\n      return sizeof(uint16_t);\r\n      break;\r\n   case M_BOOL:\r\n   case M_INT:\r\n   case M_UINT:\r\n      return sizeof(uint32_t);\r\n      break;\r\n   case M_FLOAT:\r\n      return sizeof(float);\r\n      break;\r\n   case M_DOUBLE:\r\n      return sizeof(double);\r\n      break;\r\n   default:\r\n      assert(0);\r\n      return 0;\r\n   }\r\n}\r\n\r\nMIAPI void m_image_create(struct m_image *image, char type, int width, int height, int comp)\r\n{\r\n   int size = width * height * comp;\r\n   assert(size > 0);\r\n\r\n   /* already allocated */\r\n   if (image->data != 0 && type == image->type && width == image->width && height == image->height && comp == image->comp)\r\n      return;\r\n\r\n   M_SAFE_FREE(image->data);\r\n\r\n   image->data = malloc(size * m_type_sizeof(type));\r\n   if( !image->data ) \r\n      printf(\"BAD ALLOC:m_image_create\\n\");\r\n   image->type = type;\r\n   image->width = width;\r\n   image->height = height;\r\n   image->comp = comp;\r\n   image->size = size;\r\n}\r\n\r\nMIAPI void m_image_destroy(struct m_image *image)\r\n{\r\n   M_SAFE_FREE(image->data);\r\n   memset(image, 0, sizeof(struct m_image));\r\n}\r\n\r\nMIAPI void m_image_copy(struct m_image *dest, const struct m_image *src)\r\n{\r\n   m_image_create(dest, src->type, src->width, src->height, src->comp);\r\n   \r\n   switch (dest->type) {\r\n   case M_BYTE:\r\n   case M_UBYTE:\r\n      memcpy(dest->data, src->data, dest->size*sizeof(uint8_t));\r\n      break;\r\n   case M_SHORT:\r\n   case M_USHORT:\r\n   case M_HALF:\r\n      memcpy(dest->data, src->data, dest->size*sizeof(uint16_t));\r\n      break;\r\n   case M_INT:\r\n   case M_UINT:\r\n      memcpy(dest->data, src->data, dest->size*sizeof(uint32_t));\r\n      break;\r\n   case M_FLOAT:\r\n      memcpy(dest->data, src->data, dest->size*sizeof(float));\r\n      break;\r\n   default:\r\n      assert(0);\r\n      break;\r\n   }\r\n}\r\n\r\nMIAPI void m_image_copy_sub_image(struct m_image *dest, const struct m_image *src, int x, int y, int w, int h)\r\n{\r\n   #define M_COPY_SUBI(T)\\\r\n   {\\\r\n      T *sData = (T *)src->data + (miny * src->width + minx) * comp;\\\r\n      T *dData = (T *)dest->data;\\\r\n      int y;\\\r\n      for (y = miny; y <= maxy; y++) {\\\r\n         memcpy(dData, sData, dstep * sizeof(T));\\\r\n         dData += dstep;\\\r\n         sData += sstep;\\\r\n      }\\\r\n   }\r\n\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_copy_sub_image(dest, &tmp, x, y, w, h);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      int comp = src->comp;\r\n      int minx = M_MAX(0, x);\r\n      int miny = M_MAX(0, y);\r\n      int maxx = M_CLAMP(x + w - 1, 0, src->width - 1);\r\n      int maxy = M_CLAMP(y + h - 1, 0, src->height - 1);\r\n      int dwidth = 1 + maxx - minx;\r\n      int dheight = 1 + maxy - miny;\r\n      int sstep = src->width * comp;\r\n      int dstep = dwidth * comp;\r\n\r\n      m_image_create(dest, src->type, dwidth, dheight, src->comp);\r\n      \r\n      switch(src->type)\r\n      {\r\n      case M_BYTE:\r\n      case M_UBYTE:\r\n         M_COPY_SUBI(uint8_t);\r\n         break;\r\n      case M_SHORT:\r\n      case M_USHORT:\r\n      case M_HALF:\r\n         M_COPY_SUBI(uint16_t);\r\n         break;\r\n      case M_INT:\r\n      case M_UINT:\r\n         M_COPY_SUBI(uint32_t);\r\n         break;\r\n      case M_FLOAT:\r\n         M_COPY_SUBI(float);\r\n         break;\r\n      default:\r\n         assert(0);\r\n         break;\r\n      }\r\n   }\r\n\r\n   #undef M_COPY_SUBI\r\n}\r\n\r\nMIAPI void m_image_ubyte_to_float(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_ubyte_to_float(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      uint8_t *src_data;\r\n      float *dest_data;\r\n      float ubyte_div = 1.0f / 255.0f;\r\n      int i;\r\n\r\n      m_image_create(dest, M_FLOAT, src->width, src->height, src->comp);\r\n\r\n      src_data = (uint8_t *)src->data;\r\n      dest_data = (float *)dest->data;\r\n      for (i = 0; i < src->size; i++)\r\n         dest_data[i] = (float)src_data[i] * ubyte_div;\r\n   }\r\n}\r\n\r\nMIAPI void m_image_ushort_to_float(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_ushort_to_float(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      uint16_t *src_data;\r\n      float *dest_data;\r\n      float ushort_div = 1.0f / (float)65535;\r\n      int i;\r\n\r\n      m_image_create(dest, M_FLOAT, src->width, src->height, src->comp);\r\n\r\n      src_data = (uint16_t *)src->data;\r\n      dest_data = (float *)dest->data;\r\n      for (i = 0; i < src->size; i++)\r\n         dest_data[i] = (float)src_data[i] * ushort_div;\r\n   }\r\n}\r\n\r\nMIAPI void m_image_half_to_float(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_half_to_float(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      uint16_t *src_data;\r\n      float *dest_data;\r\n      int i;\r\n\r\n      m_image_create(dest, M_FLOAT, src->width, src->height, src->comp);\r\n\r\n      src_data = (uint16_t *)src->data;\r\n      dest_data = (float *)dest->data;\r\n      for (i = 0; i < src->size; i++)\r\n         dest_data[i] = m_half2float(src_data[i]);\r\n   }\r\n}\r\n\r\nMIAPI void m_image_float_to_ubyte(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_float_to_ubyte(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      float *src_data;\r\n      uint8_t *dest_data;\r\n      int i;\r\n\r\n      m_image_create(dest, M_UBYTE, src->width, src->height, src->comp);\r\n\r\n      src_data = (float *)src->data;\r\n      dest_data = (uint8_t *)dest->data;\r\n      for (i = 0; i < src->size; i++) {\r\n         int x = (int)(src_data[i] * 255.0f + 0.5f);\r\n         dest_data[i] = (uint8_t)M_CLAMP(x, 0, 255);\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_float_to_ushort(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_float_to_ushort(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      float *src_data;\r\n      uint16_t *dest_data;\r\n      int i;\r\n\r\n      m_image_create(dest, M_USHORT, src->width, src->height, src->comp);\r\n\r\n      src_data = (float *)src->data;\r\n      dest_data = (uint16_t *)dest->data;\r\n      for (i = 0; i < src->size; i++) {\r\n         int x = (int)(src_data[i] * 65535);\r\n         dest_data[i] = (uint16_t)M_CLAMP(x, 0, 65535);\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_float_to_half(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_float_to_half(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      float *src_data;\r\n      uint16_t *dest_data;\r\n      int i;\r\n\r\n      m_image_create(dest, M_HALF, src->width, src->height, src->comp);\r\n\r\n      src_data = (float *)src->data;\r\n      dest_data = (uint16_t *)dest->data;\r\n      for (i = 0; i < src->size; i++)\r\n         dest_data[i] = m_float2half(src_data[i]);\r\n   }\r\n}\r\n\r\nMIAPI void m_image_extract_component(struct m_image *dest, const struct m_image *src, int c)\r\n{\r\n   #define M_EXTRACT(T)\\\r\n   {\\\r\n      T *dest_pixel = (T *)dest->data;\\\r\n      T *src_pixel = (T *)src->data;\\\r\n      for (i = 0; i < size; i += comp) {\\\r\n         (*dest_pixel) = src_pixel[c];\\\r\n         dest_pixel++;\\\r\n         src_pixel += comp;\\\r\n      }\\\r\n   }\r\n\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_extract_component(dest, &tmp, c);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      int width = src->width;\r\n      int height = src->height;\r\n      int comp = src->comp;\r\n      int size = src->size;\r\n      int i;\r\n\r\n      if(c >= src->comp) {\r\n         assert(0);\r\n         return;\r\n      }\r\n\r\n      m_image_create(dest, src->type, width, height, 1);\r\n\r\n      switch(src->type)\r\n      {\r\n      case M_BYTE:\r\n      case M_UBYTE:\r\n         M_EXTRACT(uint8_t);\r\n         break;\r\n      case M_SHORT:\r\n      case M_USHORT:\r\n      case M_HALF:\r\n         M_EXTRACT(uint16_t);\r\n         break;\r\n      case M_INT:\r\n      case M_UINT:\r\n         M_EXTRACT(uint32_t);\r\n         break;\r\n      case M_FLOAT:\r\n         M_EXTRACT(float);\r\n         break;\r\n      default:\r\n         assert(0);\r\n         break;\r\n      }\r\n   }\r\n\r\n   #undef M_EXTRACT\r\n}\r\n\r\nMIAPI void m_image_reframe_zero(struct m_image *dest, const struct m_image *src, int left, int top, int right, int bottom)\r\n{\r\n   #define M_REFRAME(T)\\\r\n   {\\\r\n      T *src_data;\\\r\n      T *src_pixel;\\\r\n      T *dest_pixel;\\\r\n      int c;\\\r\n      int x, y;\\\r\n      m_image_create(dest, src->type, width2, height2, comp);\\\r\n      src_data = (T *)src->data;\\\r\n      dest_pixel = (T *)dest->data;\\\r\n      for (y = 0; y < height2; y++) {\\\r\n         int ys = y - top;\\\r\n         for (x = 0; x < width2; x++) {\\\r\n            int xs = x - left;\\\r\n            if (ys >= 0 && ys < height && xs >= 0 && xs < width) {\\\r\n               src_pixel = src_data + (ys * width + xs) * comp;\\\r\n               for (c = 0; c < comp; c++)\\\r\n                  dest_pixel[c] = src_pixel[c];\\\r\n            }\\\r\n            else {\\\r\n               for (c = 0; c < comp; c++)\\\r\n                  dest_pixel[c] = 0;\\\r\n            }\\\r\n            dest_pixel += comp;\\\r\n         }\\\r\n      }\\\r\n   }\r\n\r\n   if(left != 0 || top != 0 || right != 0 || bottom != 0) {\r\n\r\n      if (dest == src) {\r\n         struct m_image tmp = M_IMAGE_IDENTITY();\r\n         m_image_copy(&tmp, src);\r\n         m_image_reframe_zero(dest, &tmp, left, top, right, bottom);\r\n         m_image_destroy(&tmp);\r\n      }\r\n      else {\r\n         int comp = src->comp;\r\n         int width = src->width;\r\n         int height = src->height;\r\n         int width2 = width + left + right;\r\n         int height2 = height + top + bottom;\r\n\r\n         if(width2 > 0 && height2 > 0) {\r\n\r\n            switch(src->type) {\r\n            case M_BYTE:\r\n            case M_UBYTE:\r\n               M_REFRAME(uint8_t);\r\n               break;\r\n            case M_SHORT:\r\n            case M_USHORT:\r\n            case M_HALF:\r\n               M_REFRAME(uint16_t);\r\n               break;\r\n            case M_INT:\r\n            case M_UINT:\r\n               M_REFRAME(uint32_t);\r\n               break;\r\n            case M_FLOAT:\r\n               M_REFRAME(float);\r\n               break;\r\n            default:\r\n               assert(0);\r\n               break;\r\n            }\r\n         }\r\n         else {\r\n            assert(0);\r\n         }\r\n      }\r\n   }\r\n   else {\r\n      m_image_copy(dest, src);\r\n   }\r\n\r\n   #undef M_REFRAME\r\n}\r\n\r\nMIAPI void m_image_reframe(struct m_image *dest, const struct m_image *src, int left, int top, int right, int bottom)\r\n{\r\n   #define M_REFRAME(T)\\\r\n   {\\\r\n      T *src_data;\\\r\n      T *src_pixel;\\\r\n      T *dest_pixel;\\\r\n      int c;\\\r\n      int x, y;\\\r\n      m_image_create(dest, src->type, width2, height2, comp);\\\r\n      src_data = (T *)src->data;\\\r\n      dest_pixel = (T *)dest->data;\\\r\n      for (y = 0; y < height2; y++) {\\\r\n         T *src_y;\\\r\n         int ys = y - top;\\\r\n         src_y = src_data + M_CLAMP(ys, 0, hm1) * width * comp;\\\r\n         for (x = 0; x < width2; x++) {\\\r\n            int xs = x - left;\\\r\n            src_pixel = src_y + M_CLAMP(xs, 0, wm1) * comp;\\\r\n            for (c = 0; c < comp; c++)\\\r\n               dest_pixel[c] = src_pixel[c];\\\r\n            dest_pixel += comp;\\\r\n         }\\\r\n      }\\\r\n   }\r\n\r\n   if(left != 0 || top != 0 || right != 0 || bottom != 0) {\r\n\r\n      if (dest == src) {\r\n         struct m_image tmp = M_IMAGE_IDENTITY();\r\n         m_image_copy(&tmp, src);\r\n         m_image_reframe(dest, &tmp, left, top, right, bottom);\r\n         m_image_destroy(&tmp);\r\n      }\r\n      else {\r\n         int comp = src->comp;\r\n         int width = src->width;\r\n         int height = src->height;\r\n         int width2 = width + left + right;\r\n         int height2 = height + top + bottom;\r\n         int wm1 = width - 1;\r\n         int hm1 = height - 1;\r\n\r\n         if(width2 > 0 && height2 > 0) {\r\n\r\n            switch(src->type) {\r\n            case M_BYTE:\r\n            case M_UBYTE:\r\n               M_REFRAME(uint8_t);\r\n               break;\r\n            case M_SHORT:\r\n            case M_USHORT:\r\n            case M_HALF:\r\n               M_REFRAME(uint16_t);\r\n               break;\r\n            case M_INT:\r\n            case M_UINT:\r\n               M_REFRAME(uint32_t);\r\n               break;\r\n            case M_FLOAT:\r\n               M_REFRAME(float);\r\n               break;\r\n            default:\r\n               assert(0);\r\n               break;\r\n            }\r\n         }\r\n         else {\r\n            assert(0);\r\n         }\r\n      }\r\n   }\r\n   else {\r\n      m_image_copy(dest, src);\r\n   }\r\n\r\n   #undef M_REFRAME\r\n}\r\n\r\nMIAPI void m_image_rotate_left(struct m_image *dest, const struct m_image *src)\r\n{\r\n   #define M_ROTATE_L(T)\\\r\n   {\\\r\n      T *src_data = (T *)src->data;\\\r\n      T *dest_pixel = (T *)dest->data;\\\r\n      for (y = 0; y < width;  y++)\\\r\n      for (x = 0; x < height; x++) {\\\r\n         T *src_pixel = src_data + (x * width + (width - 1 - y)) * comp;\\\r\n         for (c = 0; c < comp; c++)\\\r\n            dest_pixel[c] = src_pixel[c];\\\r\n         dest_pixel += comp;\\\r\n      }\\\r\n   }\r\n\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_rotate_left(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      int width = src->width;\r\n      int height = src->height;\r\n      int comp = src->comp;\r\n      int x, y, c;\r\n\r\n      m_image_create(dest, src->type, height, width, comp);\r\n\r\n      switch(src->type)\r\n      {\r\n      case M_BYTE:\r\n      case M_UBYTE:\r\n         M_ROTATE_L(uint8_t);\r\n         break;\r\n      case M_SHORT:\r\n      case M_USHORT:\r\n      case M_HALF:\r\n         M_ROTATE_L(uint16_t);\r\n         break;\r\n      case M_INT:\r\n      case M_UINT:\r\n         M_ROTATE_L(uint32_t);\r\n         break;\r\n      case M_FLOAT:\r\n         M_ROTATE_L(float);\r\n         break;\r\n      default:\r\n         assert(0);\r\n         break;\r\n      }\r\n   }\r\n\r\n   #undef M_ROTATE_L\r\n}\r\n\r\nMIAPI void m_image_rotate_right(struct m_image *dest, const struct m_image *src)\r\n{\r\n   #define M_ROTATE_R(T)\\\r\n   {\\\r\n      T *src_data = (T *)src->data;\\\r\n      T *dest_pixel = (T *)dest->data;\\\r\n      for (y = 0; y < width;  y++)\\\r\n      for (x = 0; x < height; x++) {\\\r\n         T *src_pixel = src_data + ((height - 1 - x) * width + y) * comp;\\\r\n         for (c = 0; c < comp; c++)\\\r\n            dest_pixel[c] = src_pixel[c];\\\r\n         dest_pixel += comp;\\\r\n      }\\\r\n   }\r\n\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_rotate_right(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      int width = src->width;\r\n      int height = src->height;\r\n      int comp = src->comp;\r\n      int x, y, c;\r\n\r\n      m_image_create(dest, src->type, height, width, comp);\r\n\r\n      switch(src->type)\r\n      {\r\n      case M_BYTE:\r\n      case M_UBYTE:\r\n         M_ROTATE_R(uint8_t);\r\n         break;\r\n      case M_SHORT:\r\n      case M_USHORT:\r\n      case M_HALF:\r\n         M_ROTATE_R(uint16_t);\r\n         break;\r\n      case M_INT:\r\n      case M_UINT:\r\n         M_ROTATE_R(uint32_t);\r\n         break;\r\n      case M_FLOAT:\r\n         M_ROTATE_R(float);\r\n         break;\r\n      default:\r\n         assert(0);\r\n         break;\r\n      }\r\n   }\r\n\r\n   #undef M_ROTATE_R\r\n}\r\n\r\nMIAPI void m_image_rotate_180(struct m_image *dest, const struct m_image *src)\r\n{\r\n   #define M_ROTATE_180(T)\\\r\n   {\\\r\n      T *src_data = (T *)src->data;\\\r\n      T *dest_pixel = (T *)dest->data;\\\r\n      for (y = 0; y < height;  y++)\\\r\n      for (x = 0; x < width; x++) {\\\r\n         T *src_pixel = src_data + ((height - 1 - y) * width + (width - 1 - x)) * comp;\\\r\n         for (c = 0; c < comp; c++)\\\r\n            dest_pixel[c] = src_pixel[c];\\\r\n         dest_pixel += comp;\\\r\n      }\\\r\n   }\r\n\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_rotate_180(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      int width = src->width;\r\n      int height = src->height;\r\n      int comp = src->comp;\r\n      int x, y, c;\r\n\r\n      m_image_create(dest, src->type, width, height, comp);\r\n\r\n      switch(src->type)\r\n      {\r\n      case M_BYTE:\r\n      case M_UBYTE:\r\n         M_ROTATE_180(uint8_t);\r\n         break;\r\n      case M_SHORT:\r\n      case M_USHORT:\r\n      case M_HALF:\r\n         M_ROTATE_180(uint16_t);\r\n         break;\r\n      case M_INT:\r\n      case M_UINT:\r\n         M_ROTATE_180(uint32_t);\r\n         break;\r\n      case M_FLOAT:\r\n         M_ROTATE_180(float);\r\n         break;\r\n      default:\r\n         assert(0);\r\n         break;\r\n      }\r\n   }\r\n\r\n   #undef M_ROTATE_180\r\n}\r\n\r\nMIAPI void m_image_mirror_x(struct m_image *dest, const struct m_image *src)\r\n{\r\n   #define M_MIRROR_X(T)\\\r\n   {\\\r\n      T *src_data = (T *)src->data;\\\r\n      T *dest_pixel = (T *)dest->data;\\\r\n      for (y = 0; y < height;  y++)\\\r\n      for (x = 0; x < width; x++) {\\\r\n         T *src_pixel = src_data + (y * width + (width - 1 - x)) * comp;\\\r\n         for (c = 0; c < comp; c++)\\\r\n            dest_pixel[c] = src_pixel[c];\\\r\n         dest_pixel += comp;\\\r\n      }\\\r\n   }\r\n\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_mirror_x(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      int width = src->width;\r\n      int height = src->height;\r\n      int comp = src->comp;\r\n      int x, y, c;\r\n\r\n      m_image_create(dest, src->type, width, height, comp);\r\n\r\n      switch(src->type)\r\n      {\r\n      case M_BYTE:\r\n      case M_UBYTE:\r\n         M_MIRROR_X(uint8_t);\r\n         break;\r\n      case M_SHORT:\r\n      case M_USHORT:\r\n      case M_HALF:\r\n         M_MIRROR_X(uint16_t);\r\n         break;\r\n      case M_INT:\r\n      case M_UINT:\r\n         M_MIRROR_X(uint32_t);\r\n         break;\r\n      case M_FLOAT:\r\n         M_MIRROR_X(float);\r\n         break;\r\n      default:\r\n         assert(0);\r\n         break;\r\n      }\r\n   }\r\n\r\n   #undef M_MIRROR_X\r\n}\r\n\r\nMIAPI void m_image_mirror_y(struct m_image *dest, const struct m_image *src)\r\n{\r\n   #define M_MIRROR_Y(T)\\\r\n   {\\\r\n      T *src_data = (T *)src->data;\\\r\n      T *dest_pixel = (T *)dest->data;\\\r\n      for (y = 0; y < height;  y++)\\\r\n      for (x = 0; x < width; x++) {\\\r\n         T *src_pixel = src_data + ((height - 1 - y) * width + x) * comp;\\\r\n         for (c = 0; c < comp; c++)\\\r\n            dest_pixel[c] = src_pixel[c];\\\r\n         dest_pixel += comp;\\\r\n      }\\\r\n   }\r\n\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n\t  m_image_mirror_y(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      int width = src->width;\r\n      int height = src->height;\r\n      int comp = src->comp;\r\n      int x, y, c;\r\n\r\n      m_image_create(dest, src->type, width, height, comp);\r\n\r\n      switch(src->type)\r\n      {\r\n      case M_BYTE:\r\n      case M_UBYTE:\r\n         M_MIRROR_Y(uint8_t);\r\n         break;\r\n      case M_SHORT:\r\n      case M_USHORT:\r\n      case M_HALF:\r\n         M_MIRROR_Y(uint16_t);\r\n         break;\r\n      case M_INT:\r\n      case M_UINT:\r\n         M_MIRROR_Y(uint32_t);\r\n         break;\r\n      case M_FLOAT:\r\n         M_MIRROR_Y(float);\r\n         break;\r\n      default:\r\n         assert(0);\r\n         break;\r\n      }\r\n   }\r\n\r\n   #undef M_MIRROR_Y\r\n}\r\n\r\nMIAPI void m_image_premultiply(struct m_image *dest, const struct m_image *src)\r\n{\r\n   float *dest_p, *src_p;\r\n   int i;\r\n   \r\n   assert(src->size > 0 && src->type == M_FLOAT && src->comp == 4);\r\n\r\n   m_image_create(dest, M_FLOAT, src->width, src->height, 4);\r\n   dest_p = (float *)dest->data;\r\n   src_p = (float *)src->data;\r\n\r\n   for (i = 0; i < src->size; i+=4) {\r\n      dest_p[0] = src_p[0] * src_p[3];\r\n      dest_p[1] = src_p[1] * src_p[3];\r\n      dest_p[2] = src_p[2] * src_p[3];\r\n      dest_p[3] = src_p[3];\r\n      dest_p += 4;\r\n      src_p += 4;\r\n   }\r\n}\r\n\r\nMIAPI void m_image_unpremultiply(struct m_image *dest, const struct m_image *src)\r\n{\r\n   float *dest_p, *src_p;\r\n   int i;\r\n   \r\n   assert(src->size > 0 && src->type == M_FLOAT && src->comp == 4);\r\n\r\n   m_image_create(dest, M_FLOAT, src->width, src->height, 4);\r\n   dest_p = (float *)dest->data;\r\n   src_p = (float *)src->data;\r\n\r\n   for (i = 0; i < src->size; i+=4) {\r\n      if (src_p[3] > 0.0f) {\r\n         float x = 1.0f / src_p[3];\r\n         dest_p[0] = src_p[0] * x;\r\n         dest_p[1] = src_p[1] * x;\r\n         dest_p[2] = src_p[2] * x;\r\n      }\r\n      else {\r\n         dest_p[0] = 0;\r\n         dest_p[1] = 0;\r\n         dest_p[2] = 0;\r\n      }\r\n      dest_p[3] = src_p[3];\r\n      dest_p += 4;\r\n      src_p += 4;\r\n   }\r\n}\r\n\r\nMIAPI void m_image_sRGB_to_linear(struct m_image *dest, const struct m_image *src)\r\n{\r\n   float *dest_p, *src_p;\r\n   int i, c, comp3 = M_MIN(src->comp, 3);\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n   m_image_create(dest, M_FLOAT, src->width, src->height, src->comp);\r\n   dest_p = (float *)dest->data;\r\n   src_p = (float *)src->data;\r\n\r\n   if (dest == src) {\r\n      #pragma omp parallel for schedule(dynamic, 8)\r\n      for (i = 0; i < src->size; i+=src->comp) {\r\n         m_sRGB_to_linear(dest_p+i, src_p+i, comp3);\r\n      }\r\n   }\r\n   else {\r\n      #pragma omp parallel for schedule(dynamic, 8)\r\n      for (i = 0; i < src->size; i+=src->comp) {\r\n         m_sRGB_to_linear(dest_p+i, src_p+i, comp3);\r\n         for (c = comp3; c < src->comp; c++)\r\n            dest_p[i+c] = src_p[i+c];\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_linear_to_sRGB(struct m_image *dest, const struct m_image *src)\r\n{\r\n   float *dest_p, *src_p;\r\n   int i, c, comp3 = M_MIN(src->comp, 3);\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n   m_image_create(dest, M_FLOAT, src->width, src->height, src->comp);\r\n   dest_p = (float *)dest->data;\r\n   src_p = (float *)src->data;\r\n\r\n   if (dest == src) {\r\n      #pragma omp parallel for schedule(dynamic, 8)\r\n      for (i = 0; i < src->size; i+=src->comp) {\r\n         m_linear_to_sRGB(dest_p+i, src_p+i, comp3);\r\n      }\r\n   }\r\n   else {\r\n      #pragma omp parallel for schedule(dynamic, 8)\r\n      for (i = 0; i < src->size; i+=src->comp) {\r\n         m_linear_to_sRGB(dest_p+i, src_p+i, comp3);\r\n         for (c = comp3; c < src->comp; c++)\r\n            dest_p[i+c] = src_p[i+c];\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_summed_area(struct m_image *dest, const struct m_image *src)\r\n{\r\n   float *src_pixel;\r\n   float *dest_pixel;\r\n   int width = src->width;\r\n   int height = src->height;\r\n   int comp = src->comp;\r\n   int x, y, c;\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n   if (dest != src)\r\n      m_image_copy(dest, src);\r\n\r\n   /* horiz sum */\r\n   dest_pixel = (float *)dest->data;\r\n   for (y = 0; y < height; y++) {\r\n      float *prev_pixel = dest_pixel;\r\n      dest_pixel += comp;\r\n\r\n      for (x = 1; x < width; x++) {\r\n         for (c = 0; c < comp; c++)\r\n            dest_pixel[c] += prev_pixel[c];\r\n\r\n         prev_pixel = dest_pixel;\r\n         dest_pixel += comp;\r\n      }\r\n   }\r\n\r\n   /* vertical sum */\r\n   src_pixel = (float *)dest->data;\r\n   dest_pixel = (float *)dest->data + width * comp;\r\n   for (y = 1; y < height; y++)\r\n   for (x = 0; x < width; x++) {\r\n\r\n      for (c = 0; c < comp; c++)\r\n         dest_pixel[c] += src_pixel[c];\r\n\r\n      src_pixel += comp;\r\n      dest_pixel += comp;\r\n   }\r\n}\r\n\r\nMIAPI void m_image_convolution_h_raw(struct m_image *dest, const struct m_image *src, float *kernel, int size)\r\n{\r\n   float *src_data;\r\n   float *dest_data;\r\n   int radius = (size - 1) / 2;\r\n   int width = src->width - radius * 2;\r\n   int height = src->height;\r\n   int comp = src->comp;\r\n   int y, ystep, ystepc;\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n   /* create destination images */\r\n   m_image_create(dest, M_FLOAT, width, height, comp);\r\n   \r\n   /* clear */\r\n   memset(dest->data, 0, dest->size * sizeof(float));\r\n\r\n   src_data = (float *)src->data;\r\n   dest_data = (float *)dest->data;\r\n   ystep = width * comp;\r\n   ystepc = src->width * comp;\r\n\r\n   #pragma omp parallel for schedule(dynamic, 8)\r\n   for (y = 0; y < height; y++) {\r\n\r\n      float *dest_pixel = dest_data + y * ystep;\r\n      float *src_pixel_y = src_data + y * ystepc;\r\n      int x;\r\n\r\n      for (x = 0; x < width; x++) {\r\n\r\n         float *src_pixel;\r\n         int i, k;\r\n\r\n         src_pixel = src_pixel_y + (x * comp);\r\n\r\n         /* apply kernel */\r\n         for (k = 0; k < size; k++) {\r\n            float v = kernel[k];\r\n            for (i = 0; i < comp; i++)\r\n               dest_pixel[i] += (*src_pixel++) * v;\r\n         }\r\n\r\n         dest_pixel += comp;\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_convolution_v_raw(struct m_image *dest, const struct m_image *src, float *kernel, int size)\r\n{\r\n   float *src_data;\r\n   float *dest_data;\r\n   int radius = (size - 1) / 2; \r\n   int width = src->width;\r\n   int height = src->height - radius * 2;\r\n   int comp = src->comp;\r\n\r\n   int y, ystep;\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n   /* create destination images */\r\n   m_image_create(dest, M_FLOAT, width, height, comp);\r\n   \r\n   /* clear */\r\n   memset(dest->data, 0, dest->size * sizeof(float));\r\n\r\n   src_data = (float *)src->data;\r\n   dest_data = (float *)dest->data;\r\n   ystep = width * comp;\r\n\r\n   #pragma omp parallel for schedule(dynamic, 8)\r\n   for (y = 0; y < height; y++) {\r\n\r\n      float *dest_pixel = dest_data + y * ystep;\r\n      int x;\r\n\r\n      for (x = 0; x < width; x++) {\r\n\r\n         float *src_pixel;\r\n         int i, k;\r\n\r\n         src_pixel = src_data + (y * width + x) * comp;\r\n\r\n         /* apply kernel */\r\n         for (k = 0; k < size; k++) {\r\n            float v = kernel[k];\r\n            for (i = 0; i < comp; i++)\r\n               dest_pixel[i] += src_pixel[i] * v;\r\n            src_pixel += ystep;\r\n         }\r\n         \r\n         dest_pixel += comp;\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_convolution_h(struct m_image *dest, const struct m_image *src, float *kernel, int size)\r\n{\r\n   struct m_image mask = M_IMAGE_IDENTITY();\r\n   struct m_image tmp = M_IMAGE_IDENTITY();\r\n   float *destp;\r\n   int radius = (size - 1) / 2;\r\n   int x, y, c;\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n   /* create source and destination images */\r\n   m_image_reframe_zero(&tmp, src, radius, 0, radius, 0); /* apply clamped margin */\r\n   m_image_convolution_h_raw(dest, &tmp, kernel, size);\r\n\r\n   /* create gaussian mask */\r\n   m_image_create(&tmp, M_FLOAT, src->width + radius * 2, 1, 1);\r\n   for (x = 0; x < radius; x++)\r\n      ((float *)tmp.data)[x] = 0;\r\n   for (; x < (tmp.width - radius); x++)\r\n      ((float *)tmp.data)[x] = 1;\r\n   for (; x < tmp.width; x++)\r\n      ((float *)tmp.data)[x] = 0; \r\n   m_image_convolution_h_raw(&mask, &tmp, kernel, size);\r\n\r\n   /* mask */\r\n   for (x = 0; x < mask.width; x++)\r\n      ((float *)mask.data)[x] = 1.0f / ((float *)mask.data)[x]; \r\n\r\n   destp = (float *)dest->data;\r\n   for (y = 0; y < dest->height; y++) {\r\n      for (x = 0; x < dest->width; x++) {\r\n         for (c = 0; c < dest->comp; c++)\r\n            destp[c] *= ((float *)mask.data)[x];\r\n         destp += dest->comp;\r\n      }\r\n   }\r\n\r\n   m_image_destroy(&mask);\r\n   m_image_destroy(&tmp);\r\n}\r\n\r\nMIAPI void m_image_convolution_v(struct m_image *dest, const struct m_image *src, float *kernel, int size)\r\n{\r\n   struct m_image tmp = M_IMAGE_IDENTITY();\r\n   struct m_image mask = M_IMAGE_IDENTITY();\r\n   float *destp;\r\n   int radius = (size - 1) / 2;\r\n   int x, y, c;\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n   /* create source and destination images */\r\n   m_image_reframe_zero(&tmp, src, 0, radius, 0, radius); /* apply clamped margin */\r\n   m_image_convolution_v_raw(dest, &tmp, kernel, size);\r\n\r\n   /* create gaussian mask */\r\n   m_image_create(&tmp, M_FLOAT, 1, src->height + radius * 2, 1);\r\n   for (y = 0; y < radius; y++)\r\n      ((float *)tmp.data)[y] = 0;\r\n   for (; y < (tmp.height - radius); y++)\r\n      ((float *)tmp.data)[y] = 1;\r\n   for (; y < tmp.height; y++)\r\n      ((float *)tmp.data)[y] = 0; \r\n   m_image_convolution_v_raw(&mask, &tmp, kernel, size);\r\n\r\n   /* mask */\r\n   destp = (float *)dest->data;\r\n   for (y = 0; y < dest->height; y++) {\r\n      float idiv = 1.0f / ((float *)mask.data)[y];\r\n      for (x = 0; x < dest->width; x++) {\r\n         for (c = 0; c < dest->comp; c++)\r\n            destp[c] *= idiv;\r\n         destp += dest->comp;\r\n      }\r\n   }\r\n\r\n   m_image_destroy(&mask);\r\n   m_image_destroy(&tmp);\r\n}\r\n\r\nMIAPI void m_image_gaussian_blur(struct m_image *dest, const struct m_image *src, float dx, float dy)\r\n{\r\n   struct m_image tmp = M_IMAGE_IDENTITY();\r\n   float *kernelx = NULL, *kernely = NULL;\r\n   int kernelx_size = (int)(dx / 0.65f + 0.5f) * 2 + 1;\r\n   int kernely_size = (int)(dy / 0.65f + 0.5f) * 2 + 1;\r\n   \r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n   /* exit */\r\n   if (dx < FLT_EPSILON && dy < FLT_EPSILON) {\r\n      if (dest != src) m_image_copy(dest, src);\r\n     return;\r\n   }\r\n\r\n   /* x blur */\r\n   if (dx > 0) {\r\n      kernelx = (float *)malloc(kernelx_size * sizeof(float));\r\n      m_gaussian_kernel(kernelx, kernelx_size, dx);\r\n      if (dy > 0)\r\n         m_image_convolution_h(&tmp, src, kernelx, kernelx_size);\r\n      else\r\n         m_image_convolution_h(dest, src, kernelx, kernelx_size);\r\n   }\r\n\r\n   /* y blur */\r\n   if (dy > 0) {\r\n      kernely = (float *)malloc(kernely_size * sizeof(float));\r\n      m_gaussian_kernel(kernely, kernely_size, dy);\r\n      if (dx > 0)\r\n         m_image_convolution_v(dest, &tmp, kernely, kernely_size);\r\n      else\r\n         m_image_convolution_v(dest, src, kernely, kernely_size);\r\n   }\r\n\r\n   m_image_destroy(&tmp);\r\n   if(kernely) free(kernely);\r\n   if(kernelx) free(kernelx);\r\n}\r\n\r\nMIAPI void m_image_grey(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_grey(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      float *src_pixel;\r\n      float *dest_pixel;\r\n      int size = src->size;\r\n      int i, c = src->comp;\r\n\r\n      assert(src->size > 0 && src->type == M_FLOAT && src->comp > 2);\r\n      \r\n      m_image_create(dest, M_FLOAT, src->width, src->height, 1);\r\n\r\n      src_pixel = (float *)src->data;\r\n      dest_pixel = (float *)dest->data;\r\n\r\n      for (i = 0; i < size; i+=c) {\r\n         float v = src_pixel[0] * 0.3f + src_pixel[1] * 0.5f + src_pixel[2] * 0.2f;\r\n         *dest_pixel = v;\r\n         dest_pixel++;\r\n         src_pixel+=c;\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_max(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_max(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      float *src_pixel;\r\n      float *dest_pixel;\r\n      int size = src->size;\r\n      int i, j, c = src->comp;\r\n\r\n      assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n      m_image_create(dest, M_FLOAT, src->width, src->height, 1);\r\n\r\n      src_pixel = (float *)src->data;\r\n      dest_pixel = (float *)dest->data;\r\n\r\n      for (i = 0; i < size; i+=c) {\r\n         float v = src_pixel[0];\r\n         for (j = 1; j < c; j++)\r\n            v = M_MAX(v, src_pixel[j]);\r\n         *dest_pixel = v;\r\n         dest_pixel++;\r\n         src_pixel+=c;\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_max_abs(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m_image_max_abs(dest, &tmp);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      float *src_pixel;\r\n      float *dest_pixel;\r\n      int size = src->size;\r\n      int i, j, c = src->comp;\r\n\r\n      assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n      m_image_create(dest, M_FLOAT, src->width, src->height, 1);\r\n\r\n      src_pixel = (float *)src->data;\r\n      dest_pixel = (float *)dest->data;\r\n\r\n      for (i = 0; i < size; i+=c) {\r\n         float v = fabsf(src_pixel[0]);\r\n         for (j = 1; j < c; j++)\r\n            v = M_MAX(v, fabsf(src_pixel[j]));\r\n         *dest_pixel = v;\r\n         dest_pixel++;\r\n         src_pixel+=c;\r\n      }\r\n   }\r\n}\r\n\r\nstatic float m__convolve_pixel(float *data, int width, float *kernel)\r\n{\r\n   float sum = 0; int i, j;\r\n   for (i = 0; i < 3; i++) {\r\n      float *pixel = data + width * i;\r\n      for (j = 0; j < 3; j++) {\r\n         sum += (*pixel) * (*kernel);\r\n         pixel++;\r\n         kernel++;\r\n      }\r\n   }\r\n   return sum;\r\n}\r\n\r\nMIAPI void m_image_sobel(struct m_image *dest, const struct m_image *src)\r\n{\r\n   struct m_image copy = M_IMAGE_IDENTITY();\r\n   float ky[9] = {-1, -2, -1, 0, 0, 0, 1, 2, 1};\r\n   float kx[9] = {-1, 0, 1, -2, 0, 2, -1, 0, 1};\r\n   int width = src->width;\r\n   int height = src->height;\r\n   int w2 = width + 2;\r\n   int y;\r\n   \r\n   assert(src->size > 0 && src->type == M_FLOAT && src->comp == 1);\r\n\r\n   /* create source and destination images */\r\n   m_image_reframe(&copy, src, 1, 1, 1, 1); /* apply clamped margin */\r\n   m_image_create(dest, M_FLOAT, width, height, 2);\r\n   \r\n   #pragma omp parallel for schedule(dynamic, 8)\r\n   for (y = 0; y < height; y++) {\r\n     float * src_pixel = (float*)copy.data + y * w2;\r\n     float * dest_pixel = (float*)dest->data + y * width * 2;\r\n     int x;\r\n      for (x = 0; x < width; x++) {\r\n         dest_pixel[0] = m__convolve_pixel(src_pixel, w2, kx);\r\n         dest_pixel[1] = m__convolve_pixel(src_pixel, w2, ky);\r\n         src_pixel++;\r\n         dest_pixel += 2;\r\n      }\r\n   }\r\n\r\n   m_image_destroy(&copy);\r\n}\r\n\r\nMIAPI void m_image_harris(struct m_image *dest, const struct m_image *src, float radius)\r\n{\r\n   struct m_image tmp1 = M_IMAGE_IDENTITY();\r\n   struct m_image tmp2 = M_IMAGE_IDENTITY();\r\n\r\n   /* sobel */\r\n   m_image_sobel(&tmp1, src);\r\n   \r\n   /* sst */\r\n   m_image_create(&tmp2, M_FLOAT, src->width, src->height, 3);\r\n   m_sst((float *)tmp2.data, (float *)tmp1.data, src->width * src->height);\r\n   \r\n   /* blur */\r\n   m_image_copy(&tmp1, &tmp2);\r\n   m_image_gaussian_blur(&tmp2, &tmp1, radius, radius);\r\n   \r\n   /* harris response */\r\n   m_image_create(dest, M_FLOAT, src->width, src->height, 1);\r\n   m_harris_response((float *)dest->data, (float *)tmp2.data, src->width * src->height);\r\n\r\n   m_image_destroy(&tmp1);\r\n   m_image_destroy(&tmp2);\r\n}\r\n\r\n#define M_WRITE_PIXEL(dest, x0, y0, v) {*(dest + w * (y0) + (x0)) = v;}\r\n#define M_PUSH_PIXEL(x2, y2) if((stack_i+3) < stack_size && m__test_pixel(data, w, h, x2, y2, ref)) {\\\r\n   stack_i+=2;\\\r\n   stack[stack_i] = (uint16_t)(x2);\\\r\n   stack[stack_i+1] = (uint16_t)(y2);\\\r\n   M_WRITE_PIXEL(data, x2, y2, value);\\\r\n}\r\n\r\nstatic int m__test_pixel(uint8_t *src, int w, int h, int x, int y, uint8_t ref)\r\n{\r\n   if (! (x >= 0 && x < w && y >= 0 && y < h))\r\n      return 0;\r\n   return (*(src + w * y + x) == ref);\r\n}\r\n\r\nMIAPI int m_image_floodfill_4x(struct m_image *dest, int x, int y, uint8_t ref, uint8_t value, uint16_t *stack, int stack_size)\r\n{\r\n   uint8_t *data = (uint8_t *)dest->data;\r\n   int w = dest->width;\r\n   int h = dest->height;\r\n   int stack_i = 0;\r\n\r\n   assert(dest->size > 0 && dest->type == M_UBYTE);\r\n\r\n   if(! m__test_pixel(data, w, h, x, y, ref))\r\n      return 0;\r\n\r\n   stack[0] = (uint16_t)x;\r\n   stack[1] = (uint16_t)y;\r\n   M_WRITE_PIXEL(data, x, y, value);\r\n\r\n   while (stack_i >= 0) {\r\n\r\n      x = stack[stack_i];\r\n      y = stack[stack_i+1];\r\n      stack_i-=2;\r\n\r\n      M_PUSH_PIXEL(x + 1, y)\r\n      M_PUSH_PIXEL(x - 1, y)\r\n      M_PUSH_PIXEL(x, y + 1)\r\n      M_PUSH_PIXEL(x, y - 1)\r\n   }\r\n\r\n   return 1;\r\n}\r\n\r\nMIAPI int m_image_floodfill_8x(struct m_image *dest, int x, int y, uint8_t ref, uint8_t value, uint16_t *stack, int stack_size)\r\n{\r\n   uint8_t *data = (uint8_t *)dest->data;\r\n   int w = dest->width;\r\n   int h = dest->height;\r\n   int stack_i = 0;\r\n\r\n   assert(dest->size > 0 && dest->type == M_UBYTE);\r\n\r\n   if(! m__test_pixel(data, w, h, x, y, ref))\r\n      return 0;\r\n\r\n   stack[0] = (uint16_t)x;\r\n   stack[1] = (uint16_t)y;\r\n   M_WRITE_PIXEL(data, x, y, value);\r\n\r\n   while (stack_i >= 0) {\r\n\r\n      x = stack[stack_i];\r\n      y = stack[stack_i+1];\r\n      stack_i-=2;\r\n\r\n      M_PUSH_PIXEL(x + 1, y)\r\n      M_PUSH_PIXEL(x - 1, y)\r\n      M_PUSH_PIXEL(x, y + 1)\r\n      M_PUSH_PIXEL(x, y - 1)\r\n      M_PUSH_PIXEL(x + 1, y + 1)\r\n      M_PUSH_PIXEL(x + 1, y - 1)\r\n      M_PUSH_PIXEL(x - 1, y + 1)\r\n      M_PUSH_PIXEL(x - 1, y - 1)\r\n   }\r\n\r\n   return 1;\r\n}\r\n\r\n#undef M_WRITE_PIXEL\r\n#undef M_PUSH_PIXEL\r\n\r\nstatic void m__dilate_erode(struct m_image *dest, const struct m_image *src, uint8_t ref, uint8_t value, int copy)\r\n{\r\n   uint8_t *src_data = (uint8_t *)src->data;\r\n   uint8_t *src_pixel = src_data;\r\n   uint8_t *dest_pixel;\r\n   int w = src->width;\r\n   int h = src->height;\r\n   int y;\r\n\r\n   assert(src->size > 0 && src->type == M_UBYTE);\r\n\r\n   m_image_create(dest, M_UBYTE, w, h, 1);\r\n   dest_pixel = (uint8_t *)dest->data;\r\n   if (copy)\r\n      memcpy(dest_pixel, src_data, dest->size * sizeof(char));\r\n   else\r\n      memset(dest_pixel, 0, dest->size * sizeof(char));\r\n\r\n   for (y=0; y<h; y++) {\r\n\r\n      int x;\r\n      for (x=0; x<w; x++) {\r\n\r\n         uint8_t c1, c2, c3, c4, c5;\r\n         c1 = *src_pixel;\r\n\r\n         if (c1 == ref) {\r\n            c2 = x > 0 ? *(src_data + y * w + (x - 1)) : c1;\r\n            c3 = y > 0 ? *(src_data + (y - 1) * w + x) : c1;\r\n            c4 = (x + 1) < w ? *(src_data + y * w + x + 1) : c1;\r\n            c5 = (y + 1) < h ? *(src_data + (y + 1) * w + x) : c1;\r\n            if (c2 != c1 || c3 != c1 || c4 != c1 || c5 != c1)\r\n               *dest_pixel = value;\r\n         }\r\n\r\n         src_pixel++;\r\n         dest_pixel++;\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_dilate(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m__dilate_erode(dest, &tmp, 0, 255, 1);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      m__dilate_erode(dest, src, 0, 255, 1);\r\n   }\r\n}\r\n\r\nMIAPI void m_image_erode(struct m_image *dest, const struct m_image *src)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m__dilate_erode(dest, &tmp, 255, 0, 1);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else { \r\n      m__dilate_erode(dest, src, 255, 0, 1);\r\n   }\r\n}\r\n\r\nMIAPI void m_image_edge_4x(struct m_image *dest, const struct m_image *src, uint8_t ref)\r\n{\r\n   if (dest == src) {\r\n      struct m_image tmp = M_IMAGE_IDENTITY();\r\n      m_image_copy(&tmp, src);\r\n      m__dilate_erode(dest, &tmp, ref, 255, 0);\r\n      m_image_destroy(&tmp);\r\n   }\r\n   else {\r\n      m__dilate_erode(dest, src, ref, 255, 0);\r\n   }\r\n}\r\n\r\n/* Following C code from the article\r\n   \"Efficient Binary Image Thinning using Neighborhood Maps\"\r\n   by Joseph M. Cychosz, in \"Graphics Gems IV\", Academic Press, 1994\r\n   Thins the image using Rosenfeld's parallel thinning algorithm.\r\n*/\r\n\r\n/* Direction m__masks:\r\n   N    S    W    E\r\n*/\r\nstatic int m__masks[] = {0200, 0002, 0040, 0010};\r\n\r\n/* True if pixel neighbor map indicates the pixel is 8-simple and\r\n   not an end point and thus can be deleted.  The neighborhood\r\n   map is defined as an integer of bits abcdefghi with a non-zero\r\n   bit representing a non-zero pixel.  The bit assignment for the\r\n   neighborhood is:\r\n\r\n            a b c\r\n            d e f\r\n            g h i\r\n*/\r\nstatic uint8_t m__delete_map[512] = {\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,\r\n      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\r\n      1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\r\n\r\nMIAPI void m_image_thin(struct m_image *dest)\r\n{\r\n   uint8_t *data; /* image data */\r\n   uint8_t ** ip; /* scanline pointers, ip[y][x] */\r\n   uint8_t * qb;  /* Neighborhood maps of previous scanline */\r\n   int xsize, ysize;    /* Image resolution */\r\n   int x, y;            /* Pixel location */\r\n   int i;               /* Pass index */\r\n   int pc = 0;          /* Pass count */\r\n   int count = 1;       /* Deleted pixel count */\r\n   int p, q;            /* Neighborhood maps of adjacent cells */\r\n   int m;               /* Deletion direction mask */\r\n\r\n   assert(dest->size > 0 && dest->type == M_UBYTE);\r\n\r\n   data = (uint8_t *)dest->data;\r\n   xsize = dest->width;\r\n   ysize = dest->height;\r\n\r\n   qb = (uint8_t *)malloc(xsize * sizeof(char));\r\n   qb[xsize-1] = 0; /* Used for lower-right pixel */\r\n\r\n   /* alloc scanline pointers */\r\n   ip = (uint8_t **)malloc(sizeof(void *) * ysize);\r\n   \r\n   /* set scanline pointers */\r\n   for (y=0; y<ysize; y++) {\r\n      ip[y] = data + y*xsize;\r\n   }\r\n\r\n   while (count) { /* Scan image while deletions */\r\n   \r\n      pc++;\r\n      count = 0;\r\n\r\n      for (i=0; i<4; i++) {\r\n\r\n         m = m__masks[i];\r\n         \r\n         /* Build initial previous scan buffer */\r\n         p = ip[0][0] != 0;\r\n         for (x=0; x<xsize-1; x++) {\r\n            p = ((p<<1)&0006) | (ip[0][x+1] != 0);\r\n            qb[x] = (uint8_t)p;\r\n         }\r\n         \r\n         /* Scan image for pixel deletion candidates */\r\n         for (y=0; y<ysize-1; y++) {\r\n            q = qb[0];\r\n            p = ((q<<3)&0110) | (ip[y+1][0] != 0);\r\n            \r\n            for (x=0; x<xsize-1; x++) {\r\n               q = qb[x];\r\n               p = ((p<<1)&0666) | ((q<<3)&0110) | (ip[y+1][x+1] != 0);\r\n               qb[x] = (uint8_t)p;\r\n\r\n               if (((p&m) == 0) && m__delete_map[p]) {\r\n                  if (ip[y][x] != 0) {\r\n                     count++;\r\n                     ip[y][x] = 0;\r\n                  }\r\n               }\r\n            }\r\n            \r\n            /* Process right edge pixel */\r\n            p = (p<<1)&0666;\r\n            if ((p&m) == 0 && m__delete_map[p]) {\r\n               if (ip[y][xsize-1] != 0) {\r\n                  count++;\r\n                  ip[y][xsize-1] = 0;\r\n               }\r\n            }\r\n         }\r\n         \r\n         /* Process bottom scan line */\r\n         for (x=0; x<xsize; x++) {\r\n            q = qb[x];\r\n            p = ((p<<1)&0666) | ((q<<3)&0110);\r\n            if ((p&m) == 0 && m__delete_map[p]) {\r\n               if (ip[ysize-1][x] != 0) {\r\n                  count++;\r\n                  ip[ysize-1][x] = 0;\r\n               }\r\n            }\r\n         }\r\n      }\r\n   }\r\n\r\n   free(qb);\r\n   free(ip);\r\n}\r\n\r\nMIAPI void m_image_non_max_supp(struct m_image *dest, const struct m_image *src, int radius, float threshold)\r\n{\r\n   float *src_data, *dest_data;\r\n   float *src_pixel, *dest_pixel;\r\n   int width = src->width;\r\n   int height = src->height;\r\n   int x, y;\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT && src->comp == 1);\r\n\r\n   m_image_copy(dest, src);\r\n\r\n   src_data = (float *)src->data;\r\n   dest_data = (float *)dest->data;\r\n   src_pixel = src_data;\r\n   dest_pixel = dest_data;\r\n\r\n   for (y = 0; y < height; y++)\r\n   for (x = 0; x < width; x++) {\r\n\r\n      int minx, miny, maxx, maxy, xx, yy;\r\n\r\n      if (*src_pixel < threshold) {\r\n         *dest_pixel = 0;\r\n         goto end;\r\n      }\r\n\r\n      minx = M_MAX(0, x - radius);\r\n      miny = M_MAX(0, y - radius);\r\n      maxx = M_MIN(width - 1, x + radius);\r\n      maxy = M_MIN(height - 1, y + radius);\r\n\r\n      for (yy = miny; yy <= maxy; yy++)\r\n      for (xx = minx; xx <= maxx; xx++) {\r\n\r\n         float *src_pixel2 = src_data + yy*width + xx;\r\n         if (*src_pixel2 > *src_pixel) {\r\n            *dest_pixel = 0;\r\n            goto end;\r\n         }\r\n      }\r\n\r\n      end:\r\n      src_pixel++;\r\n      dest_pixel++;\r\n   }\r\n}\r\n\r\nMIAPI int m_image_corner_harris(const struct m_image *src, int margin, float radius, float threshold, int *corners, int max_count)\r\n{\r\n   struct m_image harris = M_IMAGE_IDENTITY();\r\n   struct m_image nms = M_IMAGE_IDENTITY();\r\n   float *pixel;\r\n   int width = src->width;\r\n   int height = src->height;\r\n   int wm = width - margin;\r\n   int hm = height - margin;\r\n   int x, y, count;\r\n\r\n   if (width <= (margin * 2) || height <= (margin * 2))\r\n      return 0;\r\n\r\n   m_image_harris(&harris, src, radius);\r\n   m_image_non_max_supp(&nms, &harris, (int)(radius) + 1, threshold);\r\n\r\n   count = 0;\r\n   pixel = (float *)nms.data;\r\n\r\n   for (y = 0; y < height; y++)\r\n   for (x = 0; x < width; x++) {\r\n\r\n      if (count == max_count)\r\n         goto end;\r\n\r\n      if ((*pixel) > 0 && x >= margin && y >= margin && x < wm && y < hm) {\r\n         corners[count*2]   = x;\r\n         corners[count*2+1] = y;\r\n         count++;\r\n      }\r\n      pixel++;\r\n   }\r\n\r\n   end:\r\n   m_image_destroy(&nms);\r\n   m_image_destroy(&harris);\r\n   return count;\r\n}\r\n\r\nMIAPI void m_image_sub_pixel(const struct m_image *src, float x, float y, float *result)\r\n{\r\n   float *colors0, *colors1, *colors2, *colors3;\r\n   float *src_data = (float *)src->data;\r\n   int width = src->width;\r\n   int height = src->height;\r\n   int comp = src->comp;\r\n   int c;\r\n   float fx, fy;\r\n   int wm = width - 1;\r\n   int hm = height - 1;\r\n   int ix, iy, ix2, iy2;\r\n\r\n   ix = (int)x;\r\n   iy = (int)y;\r\n   fx = x - (float)ix;\r\n   fy = y - (float)iy;\r\n   fx = M_MAX(fx, 0);\r\n   fy = M_MAX(fy, 0);\r\n   \r\n   ix = M_CLAMP(ix, 0, wm);\r\n   iy = M_CLAMP(iy, 0, hm);\r\n   ix2 = ix + 1;\r\n   iy2 = iy + 1;\r\n   ix2 = M_MIN(ix2, wm);\r\n   iy2 = M_MIN(iy2, hm);\r\n   \r\n   colors0 = src_data + (width * iy  + ix)  * comp;\r\n   colors1 = src_data + (width * iy  + ix2) * comp;\r\n   colors2 = src_data + (width * iy2 + ix)  * comp;\r\n   colors3 = src_data + (width * iy2 + ix2) * comp;\r\n   \r\n   for(c = 0; c < comp; c++) {\r\n      float A = colors0[c] + (colors2[c] - colors0[c]) * fy;\r\n      float B = colors1[c] + (colors3[c] - colors1[c]) * fy;\r\n      result[c] = A + (B - A) * fx;\r\n   }\r\n}\r\n\r\n/* slow TODO better */\r\nstatic void m__bilinear(struct m_image *dest, const struct m_image *src, float dx, float dy, float offset)\r\n{\r\n   float *dest_data = (float *)dest->data;\r\n   int width = dest->width;\r\n   int height = dest->height;\r\n   int comp = src->comp;\r\n   int y, ystep = width * comp;\r\n\r\n   #pragma omp parallel for schedule(dynamic, 8)\r\n   for (y = 0; y < height; y++) {\r\n      float *dest_pixel = dest_data + y * ystep; int x;\r\n      for (x = 0; x < width; x++) {\r\n         m_image_sub_pixel(src, ((float)x + 0.5f) * dx + offset, ((float)y + 0.5f) * dy + offset, dest_pixel);\r\n         dest_pixel += comp;\r\n      }\r\n   }\r\n}\r\n\r\nMIAPI void m_image_pyrdown(struct m_image *dest, const struct m_image *src)\r\n{\r\n   struct m_image tmp = M_IMAGE_IDENTITY();\r\n   float *src_data;\r\n   float *dest_pixel;\r\n   int width = src->width;\r\n   int height = src->height;\r\n   int comp = src->comp;\r\n   int comp2 = comp * 2;\r\n   int ystep = width * comp * 2;\r\n   int w2 = width / 2;\r\n   int h2 = height / 2;\r\n   int x, y, i;\r\n\r\n   m_image_gaussian_blur(&tmp, src, 1.5f, 1.5f);\r\n   m_image_create(dest, M_FLOAT, w2, h2, comp);\r\n\r\n   src_data = (float *)tmp.data;\r\n   dest_pixel = (float *)dest->data;\r\n\r\n   for (y = 0; y < h2; y++) {\r\n      float *src_pixel = src_data + y * ystep;\r\n      for (x = 0; x < w2; x++) {\r\n         for (i = 0; i < comp; i++)\r\n            dest_pixel[i] = src_pixel[i];\r\n         dest_pixel += comp;\r\n         src_pixel += comp2;\r\n      }\r\n   }\r\n\r\n   m_image_destroy(&tmp);\r\n}\r\n\r\nMIAPI void m_image_resize(struct m_image *dest, const struct m_image *src, int new_width, int new_height)\r\n{\r\n   struct m_image tmp = M_IMAGE_IDENTITY();\r\n   int width = src->width;\r\n   int height = src->height;\r\n   int comp = src->comp;\r\n   float rx = (float)width / (float)new_width;\r\n   float ry = (float)height / (float)new_height;\r\n\r\n   assert(src->size > 0 && src->type == M_FLOAT);\r\n\r\n   if (rx > 1.0f || ry > 1.0f) {\r\n      m_image_gaussian_blur(&tmp, src, M_MAX(0.0f, rx - 1.0f), M_MAX(0.0f, ry - 1.0f));\r\n      m_image_create(dest, M_FLOAT, new_width, new_height, comp);\r\n      m__bilinear(dest, &tmp, rx, ry, -0.5f);\r\n   }\r\n   else {\r\n      if (dest == src) {\r\n         m_image_copy(&tmp, src);\r\n         src = &tmp;\r\n      }\r\n      m_image_create(dest, M_FLOAT, new_width, new_height, comp);\r\n      m__bilinear(dest, src, rx, ry, -0.5f);\r\n   }\r\n\r\n   m_image_destroy(&tmp);\r\n}\r\n\r\n#endif /* M_IMAGE_IMPLEMENTATION */\r\n"
  },
  {
    "path": "include/m_math.h",
    "content": "/*======================================================================\r\n Maratis Tiny C Library\r\n version 1.0\r\n------------------------------------------------------------------------\r\n Copyright (c) 2015 Anael Seghezzi <www.maratis3d.org>\r\n\r\n This software is provided 'as-is', without any express or implied\r\n warranty. In no event will the authors be held liable for any damages\r\n arising from the use of this software.\r\n\r\n Permission is granted to anyone to use this software for any purpose,\r\n including commercial applications, and to alter it and redistribute it\r\n freely, subject to the following restrictions:\r\n\r\n 1. The origin of this software must not be misrepresented; you must not\r\n    claim that you wrote the original software. If you use this software\r\n    in a product, an acknowledgment in the product documentation would\r\n    be appreciated but is not required.\r\n\r\n 2. Altered source versions must be plainly marked as such, and must not\r\n    be misrepresented as being the original software.\r\n\r\n 3. This notice may not be removed or altered from any source\r\n    distribution.\r\n\r\n========================================================================*/\r\n/*\r\n   Math with C/OpenCL portability:\r\n   - vector manipulation\r\n   - interpolation (cubic, catmullrom)\r\n   - quaternion basics\r\n   - matrix (projection, transformation...)\r\n   - random number generator\r\n   - 2d routines\r\n   - 3d routines:\r\n      - voxeliser (tri-box overlap)\r\n      - raytracing (sphere, plane, box, triangle)\r\n   \r\n   to create the implementation,\r\n   #define M_MATH_IMPLEMENTATION\r\n   in *one* C/CPP file that includes this file.\r\n*/\r\n\r\n#ifndef M_MATH_H\r\n#define M_MATH_H\r\n\r\n#define M_MATH_VERSION 1\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n#ifndef MMAPI\r\n#define MMAPI extern\r\n#endif\r\n\r\n/* basic math */\r\n#ifndef M_PI\r\n#define M_PI 3.14159265358979323846\r\n#endif\r\n#define M_DEG_TO_RAD 0.01745329251994329576\r\n#define M_RAD_TO_DEG 57.29577951308232087679\r\n\r\n#ifndef M_MIN\r\n#define M_MIN(a, b) (((a) < (b)) ? (a) : (b))\r\n#endif\r\n#ifndef M_MAX\r\n#define M_MAX(a, b) (((a) > (b)) ? (a) : (b))\r\n#endif\r\n#ifndef M_ABS\r\n#define M_ABS(a) (((a) < 0) ? -(a) : (a))\r\n#endif\r\n#ifndef M_CLAMP\r\n#define M_CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))\r\n#endif\r\n\r\n#define M_ISPOWEROFTWO(x) (((x&(x - 1)) == 0) && (x != 0))\r\n\r\n/* vector math */\r\ntypedef struct {float x, y, z;} float3; /* float3 (doesn't exist in opencl) */\r\n\r\n/* opencl/c */\r\n#ifdef __OPENCL_VERSION__\r\n   #define M_DOT2(A, B) dot((A).xy, (B).xy)\r\n   #define M_DOT3(A, B) dot((float4)((A).x, (A).y, (A).z, 0), (float4)((B).x, (B).y, (B).z, 0.0f))\r\n   #define M_DOT4(A, B) dot(A, B)\r\n   #define M_LENGHT2(src) length(src)\r\n   #define M_LENGHT3(src) length((float4)((src).x, (src).y, (src).z, 0.0f))\r\n   #define M_LENGHT4(src) length(src)\r\n   #define M_MIN2(dest, A, B) { (dest).xy = min(A.xy, B.xy); }\r\n   #define M_MIN3(dest, A, B) { (dest).x = M_MIN((A).x, (B).x); (dest).y = M_MIN((A).y, (B).y); (dest).z = M_MIN((A).z, (B).z); }\r\n   #define M_MIN4(dest, A, B) { (dest) = min(A, B); }\r\n   #define M_MAX2(dest, A, B) { (dest).xy = max(A.xy, B.xy); }\r\n   #define M_MAX3(dest, A, B) { (dest).x = M_MAX((A).x, (B).x); (dest).y = M_MAX((A).y, (B).y); (dest).z = M_MAX((A).z, (B).z); }\r\n   #define M_MAX4(dest, A, B) { (dest) = max(A, B); }\r\n   #define M_NORMALIZE2(dest, src) { (dest).xy = normalize((src).xy); }\r\n   #define M_NORMALIZE4(dest, src) { (dest) = normalize(src); }\r\n#else\r\n   typedef struct {float x, y;} float2;       /* float2 */\r\n   typedef struct {float x, y, z, w;} float4; /* float4 */\r\n   #define M_DOT2(A, B) ((A).x * (B).x + (A).y * (B).y)\r\n   #define M_DOT3(A, B) ((A).x * (B).x + (A).y * (B).y + (A).z * (B).z)\r\n   #define M_DOT4(A, B) ((A).x * (B).x + (A).y * (B).y + (A).z * (B).z + (A).w * (B).w)\r\n   #define M_LENGHT2(src) sqrtf((src).x * (src).x + (src).y * (src).y)\r\n   #define M_LENGHT3(src) sqrtf((src).x * (src).x + (src).y * (src).y + (src).z * (src).z)\r\n   #define M_LENGHT4(src) sqrtf((src).x * (src).x + (src).y * (src).y + (src).z * (src).z + (src).w * (src).w)\r\n   #define M_MIN2(dest, A, B) { (dest).x = M_MIN((A).x, (B).x); (dest).y = M_MIN((A).y, (B).y); }\r\n   #define M_MIN3(dest, A, B) { M_MIN2(dest, A, B); (dest).z = M_MIN((A).z, (B).z); }\r\n   #define M_MIN4(dest, A, B) { M_MIN3(dest, A, B); (dest).w = M_MIN((A).w, (B).w); }\r\n   #define M_MAX2(dest, A, B) { (dest).x = M_MAX((A).x, (B).x); (dest).y = M_MAX((A).y, (B).y); }\r\n   #define M_MAX3(dest, A, B) { M_MAX2(dest, A, B); (dest).z = M_MAX((A).z, (B).z); }\r\n   #define M_MAX4(dest, A, B) { M_MAX3(dest, A, B); (dest).w = M_MAX((A).w, (B).w); }\r\n   #define M_NORMALIZE2(dest, src){ float l = M_LENGHT2(src);\\\r\n      if (l > 0) { l = 1.0f / l; (dest).x = (src).x * l; (dest).y = (src).y * l; }\\\r\n      else { (dest).x = (dest).y = 0.0f; }}\r\n   #define M_NORMALIZE4(dest, src){ float l = M_LENGHT4(src);\\\r\n      if (l > 0) { l = 1.0f / l; (dest).x = (src).x * l; (dest).y = (src).y * l; (dest).z = (src).z * l; (dest).w = (src).w * l; }\\\r\n      else { (dest).x = (dest).y = (dest).z = (dest).w = 0.0f; }}\r\n#endif\r\n\r\n#define M_NORMALIZE3(dest, src){ float l = M_LENGHT3(src);\\\r\n   if (l > 0) { l = 1.0f / l; (dest).x = (src).x * l; (dest).y = (src).y * l; (dest).z = (src).z * l; }\\\r\n   else { (dest).x = (dest).y = (dest).z = 0.0f; }}\r\n\r\n#define M_CROSS2(A, B) ((A).x * (B).y - (A).y * (B).x)\r\n#define M_CROSS3(dest, A, B) { (dest).x = (A).y * (B).z - (A).z * (B).y; (dest).y = (A).z * (B).x - (A).x * (B).z; (dest).z = (A).x * (B).y - (A).y * (B).x; }\r\n\r\n#define M_ADD2(dest, A, B) { (dest).x = (A).x + (B).x; (dest).y = (A).y + (B).y; }\r\n#define M_ADD3(dest, A, B) { M_ADD2(dest, A, B) (dest).z = (A).z + (B).z; }\r\n#define M_ADD4(dest, A, B) { M_ADD3(dest, A, B) (dest).w = (A).w + (B).w; }\r\n\r\n#define M_SUB2(dest, A, B) { (dest).x = (A).x - (B).x; (dest).y = (A).y - (B).y; }\r\n#define M_SUB3(dest, A, B) { M_SUB2(dest, A, B) (dest).z = (A).z - (B).z; }\r\n#define M_SUB4(dest, A, B) { M_SUB3(dest, A, B) (dest).w = (A).w - (B).w; }\r\n\r\n#define M_MUL2(dest, A, B) { (dest).x = (A).x * (B).x; (dest).y = (A).y * (B).y; }\r\n#define M_MUL3(dest, A, B) { M_MUL2(dest, A, B) (dest).z = (A).z * (B).z; }\r\n#define M_MUL4(dest, A, B) { M_MUL3(dest, A, B) (dest).w = (A).w * (B).w; }\r\n\r\n#define M_DIV2(dest, A, B) { (dest).x = (A).x / (B).x; (dest).y = (A).y / (B).y; }\r\n#define M_DIV3(dest, A, B) { M_DIV2(dest, A, B) (dest).z = (A).z / (B).z; }\r\n#define M_DIV4(dest, A, B) { M_DIV3(dest, A, B) (dest).w = (A).w / (B).w; }\r\n\r\n/* basic math */\r\nMMAPI unsigned int m_next_power_of_two(unsigned int x);\r\n\r\n/* rand (Marsaglia MWC generator) */\r\ntypedef struct {unsigned int z, w;} m_rand_desc;\r\n#define M_RAND_DESC_DEFAULT() {362436069, 521288629}\r\n\r\nMMAPI unsigned int m_rand_user(m_rand_desc *desc);\r\nMMAPI float m_randf_user(m_rand_desc *desc);\r\n\r\nMMAPI void m_srand(unsigned int z, unsigned int w);\r\nMMAPI unsigned int m_rand(void);\r\nMMAPI float m_randf(void);\r\n\r\n/* interpolation */\r\nMMAPI float m_interpolation_cubic(float y0, float y1, float y2, float y3, float mu);\r\nMMAPI float m_interpolation_catmullrom(float y0, float y1, float y2, float y3, float mu);\r\n\r\n/* quaternion, angles in radian */\r\n#define M_QUAT_IDENTITY() {0.0f, 0.0f, 0.0f, 0.99999999f}\r\n\r\nMMAPI void m_quat_identity(float4 *dest);\r\nMMAPI void m_quat_normalize(float4 *dest, const float4 *src);\r\nMMAPI void m_quat_rotation_axis(float4 *dest, const float3 *axis, float angle);\r\nMMAPI void m_quat_rotation_euler(float4 *dest, const float3 *euler);\r\nMMAPI void m_quat_mul(float4 *dest, const float4 *A, const float4 *B);\r\nMMAPI void m_quat_slerp(float4 *dest, const float4 *A, const float4 *B, float mu);\r\nMMAPI void m_quat_extract_axis_angle(float3 *axis, float *angle, const float4 *quat);\r\n\r\n/* matrix 4x4 (float 16), angles in radian */\r\n#define M_MAT4_IDENTITY() {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}\r\n\r\nMMAPI void m_mat4_identity(float *dest);\r\nMMAPI void m_mat4_perspective(float *dest, float fov, float ratio, float znear, float zfar);\r\nMMAPI void m_mat4_ortho(float *dest, float left, float right, float bottom, float top, float znear, float zfar);\r\nMMAPI void m_mat4_lookat(float *dest, const float3 *pos, const float3 *dir, const float3 *up);\r\nMMAPI void m_mat4_translation(float *dest, const float3 *translation);\r\nMMAPI void m_mat4_rotation_axis(float *dest, const float3 *axis, float angle);\r\nMMAPI void m_mat4_rotation_euler(float *dest, const float3 *euler);\r\nMMAPI void m_mat4_scale(float *dest, const float3 *scale);\r\nMMAPI void m_mat4_mul(float *dest, const float *A, const float *B);\r\nMMAPI void m_mat4_transpose(float *dest, const float *src);\r\nMMAPI void m_mat4_inverse_transpose(float *dest, const float *src);\r\nMMAPI void m_mat4_inverse(float *dest, const float *src);\r\nMMAPI void m_mat4_extract_euler(float3 *dest, const float *matrix);\r\nMMAPI void m_mat4_rotate3(float3 *dest, const float *matrix, const float3 *src);\r\nMMAPI void m_mat4_inverse_rotate3(float3 *dest, const float *matrix, const float3 *src);\r\nMMAPI void m_mat4_transform3(float3 *dest, const float *matrix, const float3 *src);\r\nMMAPI void m_mat4_transform4(float4 *dest, const float *matrix, const float4 *src);\r\n\r\n/* 2d */\r\nMMAPI int   m_2d_line_to_line_intersection(float2 *dest, float2 *p11, float2 *p12, float2 *p21, float2 *p22);\r\nMMAPI int   m_2d_box_to_box_collision(float2 *min1, float2 *max1, float2 *min2, float2 *max2);\r\nMMAPI float m_2d_polygon_area(float2 *points, int count);\r\nMMAPI float m_2d_polyline_length(float2 *points, int count);\r\n\r\n/* 3d */\r\nMMAPI int   m_3d_box_to_box_collision(float3 *min1, float3 *max1, float3 *min2, float3 *max2);\r\nMMAPI int   m_3d_ray_box_intersection_in_out(float3 *ray_origin, float3 *ray_direction, float3 *box_min, float3 *box_max, float *in, float *out);\r\nMMAPI int   m_3d_ray_sphere_intersection_in_out(float3 *ray_origin, float3 *ray_direction, float3 *sphere_origin, float sphere_radius2, float *in, float *out);\r\nMMAPI int   m_3d_tri_box_overlap(float3 *box_center, float3 *box_half_size, float3 *vert1, float3 *vert2, float3 *vert3);\r\nMMAPI float m_3d_polyline_length(float3 *points, int count);\r\nMMAPI float m_3d_ray_plane_intersection(float3 *ray_origin, float3 *ray_direction, float3 *plane_origin, float3 *plane_normal);\r\nMMAPI float m_3d_ray_sphere_intersection(float3 *ray_origin, float3 *ray_direction, float3 *sphere_origin, float sphere_radius2);\r\nMMAPI float m_3d_ray_box_intersection(float3 *ray_origin, float3 *ray_direction, float3 *box_min, float3 *box_max);\r\nMMAPI float m_3d_ray_triangle_intersection(float3 *ray_origin, float3 *ray_direction, float3 *vert1, float3 *vert2, float3 *vert3, float *u, float *v);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n/*\r\n----------------------------------------------------------------------*/\r\n#endif /* M_MATH_H */\r\n\r\n#ifdef M_MATH_IMPLEMENTATION\r\n\r\n#ifndef __OPENCL_VERSION__\r\n#include <math.h>\r\n#endif\r\n\r\nstatic m_rand_desc m__rand_global_desc = M_RAND_DESC_DEFAULT();\r\n\r\nMMAPI unsigned int m_next_power_of_two(unsigned int x)\r\n{\r\n   if (x == 0)\r\n      return 0;\r\n   x--;\r\n   x |= x >> 1;\r\n   x |= x >> 2;\r\n   x |= x >> 4;\r\n   x |= x >> 8;\r\n   x |= x >> 16;\r\n   x++;\r\n   return x;\r\n}\r\n\r\nMMAPI unsigned int m_rand_user(m_rand_desc *desc)\r\n{\r\n   desc->z = 36969 * (desc->z & 65535) + (desc->z >> 16);\r\n   desc->w = 18000 * (desc->w & 65535) + (desc->w >> 16);\r\n   return (desc->z << 16) + desc->w;\r\n}\r\n\r\nMMAPI float m_randf_user(m_rand_desc *desc)\r\n{\r\n   unsigned int u = m_rand_user(desc);\r\n   return (u + 1.0) * 2.328306435454494e-10;\r\n}\r\n\r\nMMAPI void m_srand(unsigned int z, unsigned int w)\r\n{\r\n   m__rand_global_desc.z = z;\r\n   m__rand_global_desc.w = w;\r\n}\r\n\r\nMMAPI unsigned int m_rand(void)\r\n{\r\n   return m_rand_user(&m__rand_global_desc);\r\n}\r\n\r\nMMAPI float m_randf(void)\r\n{\r\n   return m_randf_user(&m__rand_global_desc);\r\n}\r\n\r\nMMAPI float m_interpolation_cubic(float y0, float y1, float y2, float y3, float mu)\r\n{\r\n   float a0, a1, a2, a3, mu2;\r\n   mu2 = mu * mu;\r\n   a0 = y3 - y2 - y0 + y1;\r\n   a1 = y0 - y1 - a0;\r\n   a2 = y2 - y0;\r\n   a3 = y1;\r\n   return (a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3);\r\n}\r\n\r\nMMAPI float m_interpolation_catmullrom(float y0, float y1, float y2, float y3, float mu)\r\n{\r\n   float a0, a1, a2, a3, mu2;\r\n   mu2 = mu * mu;\r\n   a0 = -0.5f * y0 + 1.5f * y1 - 1.5f * y2 + 0.5f * y3;\r\n   a1 = y0 - 2.5f * y1 + 2.0f * y2 - 0.5f * y3;\r\n   a2 = -0.5f * y0 + 0.5f * y2;\r\n   a3 = y1;\r\n   return (a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3);\r\n}\r\n\r\nMMAPI void m_quat_identity(float4 *dest)\r\n{\r\n   static float4 ident = M_QUAT_IDENTITY();\r\n   dest->x = ident.x;\r\n   dest->y = ident.y;\r\n   dest->z = ident.z;\r\n   dest->w = ident.w;\r\n}\r\n\r\nMMAPI void m_quat_normalize(float4 *dest, const float4 *src)\r\n{\r\n   float l = M_LENGHT4(*src);\r\n   if (l > 0.00000001f) {\r\n      float m = 1.0f / l;\r\n      dest->x = src->x * m;\r\n      dest->y = src->y * m;\r\n      dest->z = src->z * m;\r\n      dest->w = src->w * m;\r\n   }\r\n   else {\r\n      m_quat_identity(dest);\r\n   }\r\n}\r\n\r\nMMAPI void m_quat_rotation_axis(float4 *dest, const float3 *axis, float angle)\r\n{\r\n   float ha = angle * 0.5f;\r\n   float sina = sinf(ha);\r\n   float cosa = cosf(ha);\r\n   dest->x = sina * axis->x;\r\n   dest->y = sina * axis->y;\r\n   dest->z = sina * axis->z;\r\n   dest->w = cosa;\r\n   m_quat_normalize(dest, dest);\r\n}\r\n\r\nMMAPI void m_quat_rotation_euler(float4 *dest, const float3 *euler)\r\n{\r\n   float ti = euler->x * 0.5f;\r\n   float tj = euler->y * 0.5f;\r\n   float th = euler->z * 0.5f;\r\n   float ci = cosf(ti);\r\n   float cj = cosf(tj);\r\n   float ch = cosf(th);\r\n   float si = sinf(ti);\r\n   float sj = sinf(tj);\r\n   float sh = sinf(th);\r\n   float cc = ci*ch;\r\n   float cs = ci*sh;\r\n   float sc = si*ch;\r\n   float ss = si*sh;\r\n   dest->x = cj*sc - sj*cs;\r\n   dest->y = cj*ss + sj*cc;\r\n   dest->z = cj*cs - sj*sc;\r\n   dest->w = cj*cc + sj*ss;\r\n}\r\n\r\nMMAPI void m_quat_mul(float4 *dest, const float4 *A, const float4 *B)\r\n{\r\n   dest->x = (B->w * A->x) + (B->x * A->w) + (B->y * A->z) - (B->z * A->y);\r\n   dest->y = (B->w * A->y) + (B->y * A->w) + (B->z * A->x) - (B->x * A->z);\r\n   dest->z = (B->w * A->z) + (B->z * A->w) + (B->x * A->y) - (B->y * A->x);\r\n   dest->w = (B->w * A->w) - (B->x * A->x) - (B->y * A->y) - (B->z * A->z);\r\n}\r\n\r\nMMAPI void m_quat_slerp(float4 *dest, const float4 *A, const float4 *B, float mu)\r\n{\r\n   float4 C;\r\n   float dot = A->x * B->x + A->y * B->y + A->z * B->z + A->w * B->w;\r\n\r\n   if (dot < 0) {\r\n      dot = -dot;\r\n      C.x = -B->x;\r\n      C.y = -B->y;\r\n      C.z = -B->z;\r\n      C.w = -B->w;\r\n   }\r\n   else {\r\n      C.x = B->x;\r\n      C.y = B->y;\r\n      C.z = B->z;\r\n      C.w = B->w;\r\n   }\r\n\r\n   if (dot < 0.95f) {\r\n      float a = acosf(dot);\r\n      float f1 = sinf(a * (1.0f - mu));\r\n      float f2 = sinf(a * mu);\r\n      float f3 = sinf(a);\r\n      dest->x = (A->x * f1 + C.x * f2) / f3;\r\n      dest->y = (A->y * f1 + C.y * f2) / f3;\r\n      dest->z = (A->z * f1 + C.z * f2) / f3;\r\n      dest->w = (A->w * f1 + C.w * f2) / f3;\r\n   }\r\n   /* linear interpolation */\r\n   else {\r\n      float imu = 1.0f - mu;\r\n      dest->x = A->x * imu + C.x * mu;\r\n      dest->y = A->y * imu + C.y * mu;\r\n      dest->z = A->z * imu + C.z * mu;\r\n      dest->w = A->w * imu + C.w * mu;\r\n      m_quat_normalize(dest, dest); \r\n   }\r\n}\r\n\r\nMMAPI void m_quat_extract_axis_angle(float3 *axis, float *angle, const float4 *quat)\r\n{\r\n   float a, s;\r\n   float v = M_CLAMP(quat->w, -1.0f, 1.0f);\r\n\r\n   a = acosf(v);\r\n   s = sinf(a);\r\n\r\n   if (s != 0) {\r\n      float m = 1.0f / s;\r\n      axis->x = quat->x * m;\r\n      axis->y = quat->y * m;\r\n      axis->z = quat->z * m;\r\n   }\r\n   else {\r\n      axis->x = 0.0f;\r\n      axis->y = 1.0f;\r\n      axis->z = 0.0f;\r\n   }\r\n   *angle = a * 2.0f;\r\n}\r\n\r\nMMAPI void m_mat4_identity(float *dest)\r\n{\r\n   static float ident[16] = M_MAT4_IDENTITY(); int i;\r\n   for (i = 0; i < 16; i++)\r\n      dest[i] = ident[i];\r\n}\r\n\r\nMMAPI void m_mat4_perspective(float *dest, float fov, float ratio, float znear, float zfar)\r\n{\r\n   float ymax, xmax;\r\n   float left, right, bottom, top;\r\n   float temp, temp2, temp3, temp4;\r\n\r\n   ymax = znear * tanf(fov);\r\n   xmax = ymax * ratio;\r\n    \r\n   left = -xmax;\r\n   right = xmax;\r\n   bottom = -ymax;\r\n   top = ymax;\r\n\r\n   temp = 2.0f * znear;\r\n   temp2 = right - left;\r\n   temp3 = top - bottom;\r\n   temp4 = zfar - znear;\r\n\r\n   dest[0] = temp / temp2;\r\n   dest[1] = 0.0f;\r\n   dest[2] = 0.0f;\r\n   dest[3] = 0.0f;\r\n\r\n   dest[4] = 0.0f;\r\n   dest[5] = temp / temp3;\r\n   dest[6] = 0.0f;\r\n   dest[7] = 0.0f;\r\n\r\n   dest[8] = (right + left) / temp2;\r\n   dest[9] = (top + bottom) / temp3;\r\n   dest[10] = (-zfar - znear) / temp4;\r\n   dest[11] = -1.0f;\r\n\r\n   dest[12] = 0.0f;\r\n   dest[13] = 0.0f;\r\n   dest[14] = (-temp * zfar) / temp4;\r\n   dest[15] = 0.0f;\r\n}\r\n\r\nMMAPI void m_mat4_ortho(float *dest, float left, float right, float bottom, float top, float znear, float zfar)\r\n{\r\n   if (right == left || top == bottom || zfar == znear) // invalid\r\n      return;\r\n\r\n   dest[0] = 2.0f / (right-left);\r\n   dest[1] = 0.0f;\r\n   dest[2] = 0.0f;\r\n   dest[3] = 0.0f;\r\n\r\n   dest[4] = 0.0f;\r\n   dest[5] = 2.0f / (top-bottom);\r\n   dest[6] = 0.0f;\r\n   dest[7] = 0.0f;\r\n\r\n   dest[8] = 0.0f;\r\n   dest[9] = 0.0f;\r\n   dest[10] = -2.0f / (zfar-znear);\r\n   dest[11] = 0.0f;\r\n\r\n   dest[12] = -(right + left) / (right - left);\r\n   dest[13] = -(top + bottom) / (top - bottom);\r\n   dest[14] = -(zfar + znear) / (zfar - znear);\r\n   dest[15] = 1.0f;\r\n}\r\n\r\nMMAPI void m_mat4_lookat(float *dest, const float3 *pos, const float3 *dir, const float3 *up)\r\n{\r\n   float3 lftn, upn, dirn;\r\n\r\n   M_CROSS3(lftn, *dir, *up);\r\n   M_CROSS3(upn, lftn, *dir);\r\n   M_NORMALIZE3(lftn, lftn);\r\n   M_NORMALIZE3(upn, upn);\r\n   M_NORMALIZE3(dirn, *dir);\r\n\r\n   dest[0] = lftn.x;\r\n   dest[1] = upn.x;\r\n   dest[2] = -dirn.x;\r\n   dest[3] = 0.0f;\r\n\r\n   dest[4] = lftn.y;\r\n   dest[5] = upn.y;\r\n   dest[6] = -dirn.y;\r\n   dest[7] = 0.0f;\r\n\r\n   dest[8] = lftn.z;\r\n   dest[9] = upn.z;\r\n   dest[10] = -dirn.z;\r\n   dest[11] = 0.0f;\r\n\r\n   dest[12] = -M_DOT3(lftn, *pos);\r\n   dest[13] = -M_DOT3(upn, *pos);\r\n   dest[14] = M_DOT3(dirn, *pos);\r\n   dest[15] = 1.0f;\r\n}\r\n\r\nMMAPI void m_mat4_translation(float *dest, const float3 *translation)\r\n{\r\n   dest[12] = translation->x;\r\n   dest[13] = translation->y;\r\n   dest[14] = translation->z;\r\n}\r\n\r\nMMAPI void m_mat4_rotation_axis(float *dest, const float3 *axis, float angle)\r\n{\r\n   float sina = sinf(angle);\r\n   float cosa = cosf(angle);\r\n   float icosa = 1.0f - cosa;\r\n\r\n   dest[0] = axis->x * axis->x + cosa * (1.0f - axis->x * axis->x);\r\n   dest[1] = axis->x * axis->y * icosa + sina * axis->z;\r\n   dest[2] = axis->x * axis->z * icosa - sina * axis->y;\r\n\r\n   dest[4] = axis->x * axis->y * icosa - sina * axis->z;\r\n   dest[5] = axis->y * axis->y + cosa * (1.0f - axis->y * axis->y);\r\n   dest[6] = axis->y * axis->z * icosa + sina * axis->x;\r\n\r\n   dest[8] = axis->x * axis->z * icosa + sina * axis->y;\r\n   dest[9] = axis->y * axis->z * icosa - sina * axis->x;\r\n   dest[10] = axis->z * axis->z + cosa * (1.0f - axis->z * axis->z);\r\n}\r\n\r\nMMAPI void m_mat4_rotation_euler(float *dest, const float3 *euler)\r\n{\r\n   float cr = cosf(euler->x);\r\n   float sr = sinf(euler->x);\r\n   float cp = cosf(euler->y);\r\n   float sp = sinf(euler->y);\r\n   float cy = cosf(euler->z);\r\n   float sy = sinf(euler->z);\r\n   float srsp = sr * sp;\r\n   float crsp = cr * sp;\r\n\r\n   dest[0] = cp * cy;\r\n   dest[1] = cp * sy;\r\n   dest[2] = -sp;\r\n\r\n   dest[4] = srsp * cy - cr * sy;\r\n   dest[5] = srsp * sy + cr * cy;\r\n   dest[6] = sr * cp;\r\n\r\n   dest[8] = crsp * cy + sr * sy;\r\n   dest[9] = crsp * sy - sr * cy;\r\n   dest[10]= cr * cp;\r\n}\r\n\r\nMMAPI void m_mat4_scale(float *dest, const float3 *scale)\r\n{\r\n   dest[0] = scale->x;\r\n   dest[5] = scale->y;\r\n   dest[10] = scale->z;\r\n}\r\n\r\nMMAPI void m_mat4_mul(float *dest, const float *A, const float *B)\r\n{\r\n   dest[0] = A[0] * B[0] + A[4] * B[1] + A[8] * B[2] + A[12] * B[3];\r\n   dest[1] = A[1] * B[0] + A[5] * B[1] + A[9] * B[2] + A[13] * B[3];\r\n   dest[2] = A[2] * B[0] + A[6] * B[1] + A[10] * B[2] + A[14] * B[3];\r\n   dest[3] = A[3] * B[0] + A[7] * B[1] + A[11] * B[2] + A[15] * B[3];\r\n   dest[4] = A[0] * B[4] + A[4] * B[5] + A[8] * B[6] + A[12] * B[7];\r\n   dest[5] = A[1] * B[4] + A[5] * B[5] + A[9] * B[6] + A[13] * B[7];\r\n   dest[6] = A[2] * B[4] + A[6] * B[5] + A[10] * B[6] + A[14] * B[7];\r\n   dest[7] = A[3] * B[4] + A[7] * B[5] + A[11] * B[6] + A[15] * B[7];\r\n   dest[8] = A[0] * B[8] + A[4] * B[9] + A[8] * B[10] + A[12] * B[11];\r\n   dest[9] = A[1] * B[8] + A[5] * B[9] + A[9] * B[10] + A[13] * B[11];\r\n   dest[10] = A[2] * B[8] + A[6] * B[9] + A[10] * B[10] + A[14] * B[11];\r\n   dest[11] = A[3] * B[8] + A[7] * B[9] + A[11] * B[10] + A[15] * B[11];\r\n   dest[12] = A[0] * B[12] + A[4] * B[13] + A[8] * B[14] + A[12] * B[15];\r\n   dest[13] = A[1] * B[12] + A[5] * B[13] + A[9] * B[14] + A[13] * B[15];\r\n   dest[14] = A[2] * B[12] + A[6] * B[13] + A[10] * B[14] + A[14] * B[15];\r\n   dest[15] = A[3] * B[12] + A[7] * B[13] + A[11] * B[14] + A[15] * B[15];\r\n}\r\n\r\nMMAPI void m_mat4_transpose(float *dest, const float *src)\r\n{\r\n   dest[0] =  src[0]; dest[1] =  src[4]; dest[2] =  src[8];  dest[3] =  src[12];\r\n   dest[4] =  src[1]; dest[5] =  src[5]; dest[6] =  src[9];  dest[7] =  src[13];\r\n   dest[8] =  src[2]; dest[9] =  src[6]; dest[10] = src[10]; dest[11] = src[14];\r\n   dest[12] = src[3]; dest[13] = src[7]; dest[14] = src[11]; dest[15] = src[15];\r\n}\r\n\r\nMMAPI void m_mat4_inverse_transpose(float *dest, const float *src)\r\n{\r\n   float tmp[12];\r\n   float det;\r\n\r\n   // calculate pairs for first 8 elements (cofactors)\r\n   tmp[0] =  src[10] * src[15];\r\n   tmp[1] =  src[11] * src[14];\r\n   tmp[2] =  src[9] *  src[15];\r\n   tmp[3] =  src[11] * src[13];\r\n   tmp[4] =  src[9] *  src[14];\r\n   tmp[5] =  src[10] * src[13];\r\n   tmp[6] =  src[8] *  src[15];\r\n   tmp[7] =  src[11] * src[12];\r\n   tmp[8] =  src[8] *  src[14];\r\n   tmp[9] =  src[10] * src[12];\r\n   tmp[10] = src[8] *  src[13];\r\n   tmp[11] = src[9] *  src[12];\r\n\r\n   // calculate first 8 elements (cofactors)\r\n   dest[0] = tmp[0]*src[5] + tmp[3]*src[6] + tmp[4]*src[7]\r\n           - tmp[1]*src[5] - tmp[2]*src[6] - tmp[5]*src[7];\r\n\r\n   dest[1] = tmp[1]*src[4] + tmp[6]*src[6] + tmp[9]*src[7]\r\n            -tmp[0]*src[4] - tmp[7]*src[6] - tmp[8]*src[7];\r\n\r\n   dest[2] = tmp[2]*src[4] + tmp[7]*src[5] + tmp[10]*src[7]\r\n            -tmp[3]*src[4] - tmp[6]*src[5] - tmp[11]*src[7];\r\n\r\n   dest[3] = tmp[5]*src[4] + tmp[8]*src[5] + tmp[11]*src[6]\r\n            -tmp[4]*src[4] - tmp[9]*src[5] - tmp[10]*src[6];\r\n\r\n   dest[4] = tmp[1]*src[1] + tmp[2]*src[2] + tmp[5]*src[3]\r\n            -tmp[0]*src[1] - tmp[3]*src[2] - tmp[4]*src[3];\r\n\r\n   dest[5] = tmp[0]*src[0] + tmp[7]*src[2] + tmp[8]*src[3]\r\n            -tmp[1]*src[0] - tmp[6]*src[2] - tmp[9]*src[3];\r\n\r\n   dest[6] = tmp[3]*src[0] + tmp[6]*src[1] + tmp[11]*src[3]\r\n            -tmp[2]*src[0] - tmp[7]*src[1] - tmp[10]*src[3];\r\n\r\n   dest[7] = tmp[4]*src[0] + tmp[9]*src[1] + tmp[10]*src[2]\r\n            -tmp[5]*src[0] - tmp[8]*src[1] - tmp[11]*src[2];\r\n\r\n   // calculate pairs for second 8 elements (cofactors)\r\n   tmp[0] =  src[2] * src[7];\r\n   tmp[1] =  src[3] * src[6];\r\n   tmp[2] =  src[1] * src[7];\r\n   tmp[3] =  src[3] * src[5];\r\n   tmp[4] =  src[1] * src[6];\r\n   tmp[5] =  src[2] * src[5];\r\n   tmp[6] =  src[0] * src[7];\r\n   tmp[7] =  src[3] * src[4];\r\n   tmp[8] =  src[0] * src[6];\r\n   tmp[9] =  src[2] * src[4];\r\n   tmp[10] = src[0] * src[5];\r\n   tmp[11] = src[1] * src[4];\r\n\r\n   // calculate second 8 elements (cofactors)\r\n   dest[8] = tmp[0]*src[13] + tmp[3]*src[14] + tmp[4]*src[15]\r\n            -tmp[1]*src[13] - tmp[2]*src[14] - tmp[5]*src[15];\r\n\r\n   dest[9] = tmp[1]*src[12] + tmp[6]*src[14] + tmp[9]*src[15]\r\n            -tmp[0]*src[12] - tmp[7]*src[14] - tmp[8]*src[15];\r\n\r\n   dest[10] = tmp[2]*src[12] + tmp[7]*src[13] + tmp[10]*src[15]\r\n             -tmp[3]*src[12] - tmp[6]*src[13] - tmp[11]*src[15];\r\n\r\n   dest[11] = tmp[5]*src[12] + tmp[8]*src[13] + tmp[11]*src[14]\r\n             -tmp[4]*src[12] - tmp[9]*src[13] - tmp[10]*src[14];\r\n\r\n   dest[12] = tmp[2]*src[10] + tmp[5]*src[11] + tmp[1]*src[9]\r\n             -tmp[4]*src[11] - tmp[0]*src[9] - tmp[3]*src[10];\r\n\r\n   dest[13] = tmp[8]*src[11] + tmp[0]*src[8] + tmp[7]*src[10]\r\n             -tmp[6]*src[10] - tmp[9]*src[11] - tmp[1]*src[8];\r\n\r\n   dest[14] = tmp[6]*src[9] + tmp[11]*src[11] + tmp[3]*src[8]\r\n             -tmp[10]*src[11] - tmp[2]*src[8] - tmp[7]*src[9];\r\n\r\n   dest[15] = tmp[10]*src[10] + tmp[4]*src[8] + tmp[9]*src[9]\r\n             -tmp[8]*src[9] - tmp[11]*src[10] - tmp[5]*src[8];\r\n\r\n   // calculate determinant\r\n   det = src[0] * dest[0]\r\n       + src[1] * dest[1]\r\n       + src[2] * dest[2]\r\n       + src[3] * dest[3];\r\n\r\n   if (det == 0.0f) {\r\n      m_mat4_identity(dest);\r\n   }\r\n   else {\r\n      float m = 1.0f / det; int i;\r\n      for (i = 0; i < 16; i++)\r\n         dest[i] *= m;\r\n   }\r\n}\r\n\r\nMMAPI void m_mat4_inverse(float *dest, const float *src)\r\n{\r\n   float tmp[16];\r\n   m_mat4_inverse_transpose(tmp, src);\r\n   m_mat4_transpose(dest, tmp);\r\n}\r\n\r\nMMAPI void m_mat4_extract_euler(float3 *dest, const float *matrix)\r\n{\r\n   float cy = sqrtf(matrix[0] * matrix[0] + matrix[1] * matrix[1]);\r\n   if (cy > (16.0 * 1.192092896e-07F)) {\r\n\r\n      float3 euler1;\r\n      float3 euler2;\r\n\r\n      euler1.x = atan2f( matrix[6], matrix[10]);\r\n      euler1.y = atan2f(-matrix[2], cy);\r\n      euler1.z = atan2f( matrix[1], matrix[0]);\r\n      \r\n      euler2.x = atan2f(-matrix[6], -matrix[10]);\r\n      euler2.y = atan2f(-matrix[2], -cy);\r\n      euler2.z = atan2f(-matrix[1], -matrix[0]);\r\n      \r\n      if ((M_ABS(euler1.x) + M_ABS(euler1.y) + M_ABS(euler1.z)) > \r\n          (M_ABS(euler2.x) + M_ABS(euler2.y) + M_ABS(euler2.z)))\r\n      {\r\n         dest->x = euler2.x;\r\n         dest->y = euler2.y;\r\n         dest->z = euler2.z;\r\n      }\r\n      else\r\n      {\r\n         dest->x = euler1.x;\r\n         dest->y = euler1.y;\r\n         dest->z = euler1.z;\r\n      }\r\n   }\r\n   else {\r\n      dest->x = atan2f(-matrix[9], matrix[5]);\r\n      dest->y = atan2f(-matrix[2], cy);\r\n      dest->z = 0.0f;\r\n   }\r\n}\r\n\r\nMMAPI void m_mat4_rotate3(float3 *dest, const float *matrix, const float3 *src)\r\n{\r\n   dest->x = matrix[0] * src->x + matrix[4] * src->y + matrix[8] * src->z;\r\n   dest->y = matrix[1] * src->x + matrix[5] * src->y + matrix[9] * src->z;\r\n   dest->z = matrix[2] * src->x + matrix[6] * src->y + matrix[10] * src->z;\r\n}\r\n\r\nMMAPI void m_mat4_inverse_rotate3(float3 *dest, const float *matrix, const float3 *src)\r\n{\r\n   dest->x = matrix[0] * src->x + matrix[1] * src->y + matrix[2] * src->z;\r\n   dest->y = matrix[4] * src->x + matrix[5] * src->y + matrix[6] * src->z;\r\n   dest->z = matrix[8] * src->x + matrix[9] * src->y + matrix[10] * src->z;\r\n}\r\n\r\nMMAPI void m_mat4_transform3(float3 *dest, const float *matrix, const float3 *src)\r\n{\r\n   dest->x = matrix[0] * src->x + matrix[4] * src->y + matrix[8] * src->z + matrix[12];\r\n   dest->y = matrix[1] * src->x + matrix[5] * src->y + matrix[9] * src->z + matrix[13];\r\n   dest->z = matrix[2] * src->x + matrix[6] * src->y + matrix[10] * src->z + matrix[14];\r\n}\r\n\r\nMMAPI void m_mat4_transform4(float4 *dest, const float *matrix, const float4 *src)\r\n{\r\n   dest->x = matrix[0] * src->x + matrix[4] * src->y + matrix[8] * src->z + matrix[12] * src->w;\r\n   dest->y = matrix[1] * src->x + matrix[5] * src->y + matrix[9] * src->z + matrix[13] * src->w;\r\n   dest->z = matrix[2] * src->x + matrix[6] * src->y + matrix[10] * src->z + matrix[14] * src->w;\r\n   dest->w = matrix[3] * src->x + matrix[7] * src->y + matrix[11] * src->z + matrix[15] * src->w;\r\n}\r\n\r\nMMAPI float m_2d_polygon_area(float2 *points, int count)\r\n{\r\n   float fx, fy, a; int p;\r\n   if (count < 3)\r\n      return 0;\r\n\r\n   fx = points[count - 1].x * points[0].y;\r\n   fy = points[count - 1].y * points[0].x;\r\n\r\n   for (p = 1; p < count; p++) {\r\n      fx += points[p - 1].x * points[p].y;\r\n      fy += points[p - 1].y * points[p].x;\r\n   }\r\n\r\n   a = (fx - fy) * 0.5f;\r\n   return M_ABS(a);\r\n}\r\n\r\nMMAPI float m_2d_polyline_length(float2 *points, int count)\r\n{\r\n   float l = 0; int p;\r\n   for (p = 1; p < count; p++) {\r\n      float2 v; M_SUB2(v, points[p], points[p - 1]);\r\n      l += M_LENGHT2(v);\r\n   }\r\n   return l;\r\n}\r\n\r\nMMAPI int m_2d_line_to_line_intersection(float2 *dest, float2 *p11, float2 *p12, float2 *p21, float2 *p22)\r\n{\r\n   float2 DP, QA, QB;\r\n   float d, la, lb;\r\n\r\n   DP.x = p21->x - p11->x ; DP.y = p21->y - p11->y;\r\n   QA.x = p12->x - p11->x ; QA.y = p12->y - p11->y;\r\n   QB.x = p22->x - p21->x ; QB.y = p22->y - p21->y;\r\n\r\n   d = QA.y * QB.x - QB.y * QA.x;\r\n   if (d == 0)\r\n      return 0;\r\n      \r\n   la = (QB.x * DP.y - QB.y * DP.x) / d;\r\n   if (la < 0 || la > 1)\r\n      return 0;\r\n\r\n   lb = (QA.x * DP.y - QA.y * DP.x) / d;\r\n   if (lb < 0 || lb > 1)\r\n      return 0;\r\n\r\n   dest->x = p11->x + la * QA.x;\r\n   dest->y = p11->y + la * QA.y;\r\n   return 1;\r\n}\r\n\r\nMMAPI int m_2d_box_to_box_collision(float2 *min1, float2 *max1, float2 *min2, float2 *max2)\r\n{\r\n   return !(\r\n   (min1->x > max2->x) || (max1->x < min2->x) ||\r\n   (min1->y > max2->y) || (max1->y < min2->y));\r\n}\r\n\r\nMMAPI float m_3d_polyline_length(float3 *points, int count)\r\n{\r\n   float l = 0; int p;\r\n   for (p = 1; p < count; p++) {\r\n      float3 v; M_ADD3(v, points[p], points[p - 1]);\r\n      l += M_LENGHT3(v);\r\n   }\r\n   return l;\r\n}\r\n\r\nMMAPI int m_3d_box_to_box_collision(float3 *min1, float3 *max1, float3 *min2, float3 *max2)\r\n{\r\n   return !(\r\n   (min1->x > max2->x) || (max1->x < min2->x) ||\r\n   (min1->y > max2->y) || (max1->y < min2->y) ||\r\n   (min1->z > max2->z) || (max1->z < min2->z));\r\n}\r\n\r\nMMAPI int m_3d_ray_box_intersection_in_out(float3 *ray_origin, float3 *ray_direction, float3 *box_min, float3 *box_max, float *in, float *out)\r\n{\r\n   float3 idir;\r\n   float3 tmin, tmax;\r\n   float3 tnear, tfar;\r\n   float tnx, tny, tfy;\r\n   float in0, out0;\r\n\r\n   idir.x = 1.0f / ray_direction->x;\r\n   idir.y = 1.0f / ray_direction->y;\r\n   idir.z = 1.0f / ray_direction->z;\r\n   tmin.x = (box_min->x - ray_origin->x) * idir.x;\r\n   tmin.y = (box_min->y - ray_origin->y) * idir.y;\r\n   tmin.z = (box_min->z - ray_origin->z) * idir.z;\r\n   tmax.x = (box_max->x - ray_origin->x) * idir.x;\r\n   tmax.y = (box_max->y - ray_origin->y) * idir.y;\r\n   tmax.z = (box_max->z - ray_origin->z) * idir.z;\r\n\r\n   M_MIN3(tnear, tmin, tmax);\r\n   M_MAX3(tfar,  tmin, tmax);\r\n\r\n   tnx = M_MAX(tnear.x, 0.0f);\r\n   tny = M_MAX(tnear.y, tnear.z);\r\n   tfy = M_MIN(tfar.y, tfar.z);\r\n\r\n   in0 = M_MAX(tnx, tny);\r\n   out0 = M_MIN(tfar.x, tfy);\r\n    \r\n   if (out0 > 0.0f && in0 < out0) {\r\n      *in = in0;\r\n      *out = out0;\r\n      return 1;\r\n   }\r\n   return 0;\r\n}\r\n\r\nMMAPI int m_3d_ray_sphere_intersection_in_out(float3 *ray_origin, float3 *ray_direction, float3 *sphere_origin, float sphere_radius2, float *in, float *out)\r\n{\r\n   float3 vec;\r\n   float b, det;\r\n\r\n   M_SUB3(vec, *sphere_origin, *ray_origin);\r\n   b = M_DOT3(vec, *ray_direction);\r\n   det = b * b - M_DOT3(vec, vec) + sphere_radius2;\r\n\r\n   if (det < 0) return 0;\r\n   else det = sqrtf(det);\r\n   *in = b - det;\r\n   *out = b + det;\r\n   return 1;\r\n}\r\n\r\nMMAPI float m_3d_ray_plane_intersection(float3 *ray_origin, float3 *ray_direction, float3 *plane_origin, float3 *plane_normal)\r\n{\r\n   float constant = -M_DOT3(*plane_normal, *plane_origin);\r\n   float normal_dot = M_DOT3(*plane_normal, *ray_direction);\r\n   float plane_dist = M_DOT3(*plane_normal, *ray_origin) + constant;\r\n   return -plane_dist / normal_dot;\r\n}\r\n\r\nMMAPI float m_3d_ray_sphere_intersection(float3 *ray_origin, float3 *ray_direction, float3 *sphere_origin, float sphere_radius2)\r\n{\r\n   float3 vec;\r\n   float b, det;\r\n\r\n   M_SUB3(vec, *sphere_origin, *ray_origin);\r\n   b = M_DOT3(vec, *ray_direction);\r\n   det = b * b - M_DOT3(vec, vec) + sphere_radius2;\r\n\r\n   if (det < 0) return 0;\r\n   else det = sqrtf(det);\r\n   return b - det;\r\n}\r\n\r\n/* Ray-box intersection using IEEE numerical properties to ensure that the\r\n   test is both robust and efficient, as described in:\r\n   Amy Williams, Steve Barrus, R. Keith Morley, and Peter Shirley\r\n   \"An Efficient and Robust Ray-Box Intersection Algorithm\"\r\n   Journal of graphics tools, 10(1):49-54, 2005\r\n*/\r\nMMAPI float m_3d_ray_box_intersection(float3 *ray_origin, float3 *ray_direction, float3 *box_min, float3 *box_max)\r\n{\r\n   float tmin, tmax, tymin, tymax, tzmin, tzmax;\r\n   float3 parameters[2];\r\n   float3 inv_direction = {\r\n      1 / ray_direction->x,\r\n      1 / ray_direction->y,\r\n      1 / ray_direction->z\r\n   };\r\n   int sign[3];\r\n\r\n   parameters[0] = *box_min;\r\n   parameters[1] = *box_max;\r\n\r\n   sign[0] = (inv_direction.x < 0);\r\n   sign[1] = (inv_direction.y < 0);\r\n   sign[2] = (inv_direction.z < 0);\r\n\r\n   tmin =  (parameters[sign[0]].x - ray_origin->x) * inv_direction.x;\r\n   tymin = (parameters[sign[1]].y - ray_origin->y) * inv_direction.y;\r\n   tmax =  (parameters[1 - sign[0]].x - ray_origin->x) * inv_direction.x;\r\n   tymax = (parameters[1 - sign[1]].y - ray_origin->y) * inv_direction.y;\r\n   \r\n   if ((tmin > tymax) || (tymin > tmax))\r\n      return 0;\r\n  \r\n   if (tymin > tmin) tmin = tymin;\r\n   if (tymax < tmax) tmax = tymax;\r\n\r\n   tzmin = (parameters[sign[2]].z - ray_origin->z) * inv_direction.z;\r\n   tzmax = (parameters[1 - sign[2]].z - ray_origin->z) * inv_direction.z;\r\n\r\n   if ((tmin > tzmax) || (tzmin > tmax))\r\n      return 0;\r\n      \r\n   if (tzmin > tmin) tmin = tzmin;\r\n   if (tzmax < tmax) tmax = tzmax;\r\n\r\n   return tmin;\r\n}\r\n\r\nMMAPI float m_3d_ray_triangle_intersection(float3 *ray_origin, float3 *ray_direction, float3 *vert1, float3 *vert2, float3 *vert3, float *u, float *v)\r\n{\r\n   float3 edge1, edge2;\r\n   float3 pvec, tvec, qvec;\r\n   float det, inv_det;\r\n\r\n   M_SUB3(edge1, *vert2, *vert1);\r\n   M_SUB3(edge2, *vert3, *vert1);\r\n   M_CROSS3(pvec, *ray_direction, edge2);\r\n\r\n   det = M_DOT3(edge1, pvec);\r\n   if (det == 0)\r\n      return 0;\r\n      \r\n   inv_det = 1.0f / det;\r\n   M_SUB3(tvec, *ray_origin, *vert1);\r\n\r\n   /* u parameter */\r\n   *u = M_DOT3(tvec, pvec) * inv_det;\r\n   if (*u < 0.0f || *u > 1.0f)\r\n      return 0;\r\n      \r\n   M_CROSS3(qvec, tvec, edge1);\r\n   \r\n   /* v parameter */\r\n   *v = M_DOT3(*ray_direction, qvec) * inv_det;\r\n   \r\n   /* inverted comparison (to catch NaNs) */\r\n   if (*v >= 0.0f && ((*u) + (*v)) <= 1.0f)\r\n      return M_DOT3(edge2, qvec) * inv_det;\r\n\r\n   return 0;\r\n}\r\n\r\n/********************************************************/\r\n/* AABB-triangle overlap test code                      */\r\n/* by Tomas Akenine-Mller                              */\r\n/* Function: int triBoxOverlap(float boxcenter[3],      */\r\n/*          float boxhalfsize[3],float triverts[3][3]); */\r\n/* History:                                             */\r\n/*   2001-03-05: released the code in its first version */\r\n/*   2001-06-18: changed the order of the tests, faster */\r\n/*                                                      */\r\n/* Acknowledgement: Many thanks to Pierre Terdiman for  */\r\n/* suggestions and discussions on how to optimize code. */\r\n/* Thanks to David Hunt for finding a \">=\"-bug!         */\r\n/********************************************************/\r\n\r\n#ifndef M_FIND_MIN_MAX_3\r\n#define M_FIND_MIN_MAX_3(x0, x1, x2, min, max)\\\r\n   min = max = x0;\\\r\n   if (x1 < min) min=x1;\\\r\n   if (x1 > max) max=x1;\\\r\n   if (x2 < min) min=x2;\\\r\n   if (x2 > max) max=x2;\r\n#endif\r\n\r\nstatic int m__plane_box_overlap(float3 *normal, float3 *vert, float3 *maxbox)\r\n{\r\n   float3 vmin, vmax;\r\n   if (normal->x > 0.0f) { vmin.x = -maxbox->x - vert->x; vmax.x =  maxbox->x - vert->x; }\r\n   else                  { vmin.x =  maxbox->x - vert->x; vmax.x = -maxbox->x - vert->x; }\r\n   if (normal->y > 0.0f) { vmin.y = -maxbox->y - vert->y; vmax.y =  maxbox->y - vert->y; }\r\n   else                  { vmin.y =  maxbox->y - vert->y; vmax.y = -maxbox->y - vert->y; }\r\n   if (normal->z > 0.0f) { vmin.z = -maxbox->z - vert->z; vmax.z =  maxbox->z - vert->z; }\r\n   else                  { vmin.z =  maxbox->z - vert->z; vmax.z = -maxbox->z - vert->z; }\r\n   if (M_DOT3(*normal, vmin) > 0.0f) return 0;\r\n   if (M_DOT3(*normal, vmax) >= 0.0f) return 1;\r\n   return 0;\r\n}\r\n\r\n/*======================== X-tests ========================*/\r\n#define M_AXISTEST_X01(a, b, fa, fb)\\\r\n   p0 = a*v0.y - b*v0.z;\\\r\n   p2 = a*v2.y - b*v2.z;\\\r\n   if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;}\\\r\n   rad = fa * boxhalfsize->y + fb * boxhalfsize->z;\\\r\n   if(min>rad || max<-rad) return 0;\r\n\r\n#define M_AXISTEST_X2(a, b, fa, fb)\\\r\n   p0 = a*v0.y - b*v0.z;\\\r\n   p1 = a*v1.y - b*v1.z;\\\r\n   if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;}\\\r\n   rad = fa * boxhalfsize->y + fb * boxhalfsize->z;\\\r\n   if(min>rad || max<-rad) return 0;\r\n\r\n/*======================== Y-tests ========================*/\r\n#define M_AXISTEST_Y02(a, b, fa, fb)\\\r\n   p0 = -a*v0.x + b*v0.z;\\\r\n   p2 = -a*v2.x + b*v2.z;\\\r\n   if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;}\\\r\n   rad = fa * boxhalfsize->x + fb * boxhalfsize->z;\\\r\n   if(min>rad || max<-rad) return 0;\r\n\r\n#define M_AXISTEST_Y1(a, b, fa, fb)\\\r\n   p0 = -a*v0.x + b*v0.z;\\\r\n   p1 = -a*v1.x + b*v1.z;\\\r\n   if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;}\\\r\n   rad = fa * boxhalfsize->x + fb * boxhalfsize->z;\\\r\n   if(min>rad || max<-rad) return 0;\r\n\r\n/*======================== Z-tests ========================*/\r\n#define M_AXISTEST_Z12(a, b, fa, fb)\\\r\n   p1 = a*v1.x - b*v1.y;\\\r\n   p2 = a*v2.x - b*v2.y;\\\r\n   if(p2<p1) {min=p2; max=p1;} else {min=p1; max=p2;}\\\r\n   rad = fa * boxhalfsize->x + fb * boxhalfsize->y;\\\r\n   if(min>rad || max<-rad) return 0;\r\n\r\n#define M_AXISTEST_Z0(a, b, fa, fb)\\\r\n   p0 = a*v0.x - b*v0.y;\\\r\n   p1 = a*v1.x - b*v1.y;\\\r\n   if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;}\\\r\n   rad = fa * boxhalfsize->x + fb * boxhalfsize->y;\\\r\n   if(min>rad || max<-rad) return 0;\r\n\r\nMMAPI int m_3d_tri_box_overlap(float3 *boxcenter, float3 *boxhalfsize, float3 *vert1, float3 *vert2, float3 *vert3)\r\n{\r\n   /*    use separating axis theorem to test overlap between triangle and box */\r\n   /*    need to test for overlap in these directions: */\r\n   /*    1) the {x,y,z}-directions (actually, since we use the AABB of the triangle */\r\n   /*       we do not even need to test these) */\r\n   /*    2) normal of the triangle */\r\n   /*    3) crossproduct(edge from tri, {x,y,z}-directin) */\r\n   /*       this gives 3x3=9 more tests */\r\n\r\n   float3 v0, v1, v2;\r\n   float3 normal, e0, e1, e2;\r\n   float min, max, p0, p1, p2, rad, fex, fey, fez;\r\n\r\n   /* This is the fastest branch on Sun */\r\n   /* move everything so that the boxcenter is in (0,0,0) */\r\n   M_SUB3(v0, *vert1, *boxcenter);\r\n   M_SUB3(v1, *vert2, *boxcenter);\r\n   M_SUB3(v2, *vert3, *boxcenter);\r\n\r\n   /* compute triangle edges */\r\n   M_SUB3(e0, v1, v0);      /* tri edge 0 */\r\n   M_SUB3(e1, v2, v1);      /* tri edge 1 */\r\n   M_SUB3(e2, v0, v2);      /* tri edge 2 */\r\n\r\n   /* Bullet 3:  */\r\n   /*  test the 9 tests first (this was faster) */\r\n   fex = M_ABS(e0.x);\r\n   fey = M_ABS(e0.y);\r\n   fez = M_ABS(e0.z);\r\n   M_AXISTEST_X01(e0.z, e0.y, fez, fey);\r\n   M_AXISTEST_Y02(e0.z, e0.x, fez, fex);\r\n   M_AXISTEST_Z12(e0.y, e0.x, fey, fex);\r\n\r\n   fex = M_ABS(e1.x);\r\n   fey = M_ABS(e1.y);\r\n   fez = M_ABS(e1.z);\r\n   M_AXISTEST_X01(e1.z, e1.y, fez, fey);\r\n   M_AXISTEST_Y02(e1.z, e1.x, fez, fex);\r\n   M_AXISTEST_Z0(e1.y, e1.x, fey, fex);\r\n\r\n   fex = M_ABS(e2.x);\r\n   fey = M_ABS(e2.y);\r\n   fez = M_ABS(e2.z);\r\n   M_AXISTEST_X2(e2.z, e2.y, fez, fey);\r\n   M_AXISTEST_Y1(e2.z, e2.x, fez, fex);\r\n   M_AXISTEST_Z12(e2.y, e2.x, fey, fex);\r\n\r\n   /* Bullet 1: */\r\n   /*  first test overlap in the {x,y,z}-directions */\r\n   /*  find min, max of the triangle each direction, and test for overlap in */\r\n   /*  that direction -- this is equivalent to testing a minimal AABB around */\r\n   /*  the triangle against the AABB */\r\n\r\n   /* test in X-direction */\r\n   M_FIND_MIN_MAX_3(v0.x, v1.x, v2.x, min, max);\r\n   if (min > boxhalfsize->x || max < -boxhalfsize->x) return 0;\r\n\r\n   /* test in Y-direction */\r\n   M_FIND_MIN_MAX_3(v0.y, v1.y, v2.y, min, max);\r\n   if (min > boxhalfsize->y || max < -boxhalfsize->y) return 0;\r\n\r\n   /* test in Z-direction */\r\n   M_FIND_MIN_MAX_3(v0.z, v1.z, v2.z, min, max);\r\n   if (min > boxhalfsize->z || max < -boxhalfsize->z) return 0;\r\n\r\n   /* Bullet 2: */\r\n   /*  test if the box intersects the plane of the triangle */\r\n   /*  compute plane equation of triangle: normal*x+d=0 */\r\n   M_CROSS3(normal, e0, e1);\r\n   if (! m__plane_box_overlap(&normal, &v0, boxhalfsize)) return 0;\r\n\r\n   return 1;   /* box and triangle overlaps */\r\n}\r\n\r\n#undef M_AXISTEST_X01\r\n#undef M_AXISTEST_X2\r\n#undef M_AXISTEST_Y02\r\n#undef M_AXISTEST_Y1\r\n#undef M_AXISTEST_Z12\r\n#undef M_AXISTEST_Z0\r\n\r\n#endif /* M_MATH_IMPLEMENTATION */"
  },
  {
    "path": "include/m_path_finding.h",
    "content": "/*======================================================================\n Maratis Tiny C Library\n version 1.0\n------------------------------------------------------------------------\n Copyright (c) 2016 Anael Seghezzi <www.maratis3d.org>\n\n This software is provided 'as-is', without any express or implied\n warranty. In no event will the authors be held liable for any damages\n arising from the use of this software.\n\n Permission is granted to anyone to use this software for any purpose,\n including commercial applications, and to alter it and redistribute it\n freely, subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would\n    be appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must not\n    be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source\n    distribution.\n\n========================================================================*/\n/*\n   Floodfill-based path finding:\n   \n   to create the implementation,\n   #define M_PF_IMPLEMENTATION\n   in *one* C/CPP file that includes this file.\n*/\n\n#ifndef M_PF_H\n#define M_PF_H\n\n#define M_PF_VERSION 1\n\n#ifndef MPFAPI\n#ifdef __cplusplus\n#define MPFAPI extern \"C\"\n#else\n#define MPFAPI extern\n#endif\n#endif\n\nstruct m_pf_point\n{\n   unsigned short x, y;\n};\n\n/* floodfill a score map from destination (x, y)\n   the input map is filled with this two values: 0 = ground, UINT_MAX = wall\n   *stack should be at least of size (w * h) */\nMPFAPI void m_pf_floodfill(unsigned int *map, int w, int h, int x, int y, struct m_pf_point *stack);\n\n/* backtrace a path from start (x, y) */\nMPFAPI int m_pf_backtrace(struct m_pf_point *dest, const unsigned int *map, int w, int h, int x, int y);\n\n#endif /* M_PF_H */\n\n#ifdef M_PF_IMPLEMENTATION\n\n#include <limits.h>\n\n#define M_PF_PUSH_PIXEL(x2, y2)\\\nif(map[w * (y2) + (x2)] == 0) {\\\n   stack[stack_n].x = (x2);\\\n   stack[stack_n].y = (y2);\\\n   stack_n++;\\\n   map[w * (y2) + (x2)] = i;\\\n}\n\nMPFAPI void m_pf_floodfill(unsigned int *map, int w, int h, int x, int y, struct m_pf_point *stack)\n{\n   unsigned int i = 0;\n   int stack_c = 0;\n   int stack_n = 0;\n\n   M_PF_PUSH_PIXEL(x, y)\n\n   while (stack_c < stack_n) {\n\n      x = stack[stack_c].x;\n      y = stack[stack_c].y;\n      i = map[w * y + x] + 1;\n      stack_c++;\n\n      if (y > 0)\n         M_PF_PUSH_PIXEL(x, y - 1)\n      if (x > 0)\n         M_PF_PUSH_PIXEL(x - 1, y)\n      if (x < (w - 1))\n         M_PF_PUSH_PIXEL(x + 1, y)\n      if (y < (h - 1))\n         M_PF_PUSH_PIXEL(x, y + 1)\n   }\n}\n\nMPFAPI int m_pf_backtrace(struct m_pf_point *dest, const unsigned int *map, int w, int h, int x, int y)\n{\n   const unsigned int *p = map + (y * w + x);\n   int i, s = w * h;\n\n   if (*p == 0 || *p == UINT_MAX)\n      return 0;\n\n   for (i = 0; i < s; i++) {\n\n      unsigned int min = UINT_MAX;\n      int minx, miny;\n      int maxx, maxy;\n      int xi, yi;\n\n      minx = (x - 1) < 0 ? 0 : (x - 1);\n      miny = (y - 1) < 0 ? 0 : (y - 1);\n      maxx = (x + 2) > w ? w : (x + 2);\n      maxy = (y + 2) > h ? h : (y + 2);\n\n      for (yi = miny; yi < maxy; yi++) {\n         p = map + (yi * w + minx);\n         for (xi = minx; xi < maxx; xi++) {\n\n            if (*p < min) {\n               min = *p;\n               y = yi;\n               x = xi;\n            }\n            p++;\n         }\n      }\n\n      dest[i].x = x;\n      dest[i].y = y;\n\n      if (min == 1)\n         return i + 1;\n   }\n\n   return 0;\n}\n\n#undef M_PF_PUSH_PIXEL\n\n#endif /* M_PF_IMPLEMENTATION */"
  },
  {
    "path": "include/m_raster.h",
    "content": "/*======================================================================\r\n Maratis Tiny C Library\r\n version 1.0\r\n------------------------------------------------------------------------\r\n Copyright (c) 2015 Anael Seghezzi <www.maratis3d.org>\r\n\r\n This software is provided 'as-is', without any express or implied\r\n warranty. In no event will the authors be held liable for any damages\r\n arising from the use of this software.\r\n\r\n Permission is granted to anyone to use this software for any purpose,\r\n including commercial applications, and to alter it and redistribute it\r\n freely, subject to the following restrictions:\r\n\r\n 1. The origin of this software must not be misrepresented; you must not\r\n    claim that you wrote the original software. If you use this software\r\n    in a product, an acknowledgment in the product documentation would\r\n    be appreciated but is not required.\r\n\r\n 2. Altered source versions must be plainly marked as such, and must not\r\n    be misrepresented as being the original software.\r\n\r\n 3. This notice may not be removed or altered from any source\r\n    distribution.\r\n\r\n========================================================================*/\r\n/*\r\n   Simple rasterization:\r\n   - triangle with perspective correct interpolation\r\n   - basic line, circle and polygon\r\n   \r\n   to create the implementation,\r\n   #define M_RASTER_IMPLEMENTATION\r\n   in *one* C/CPP file that includes this file.\r\n*/\r\n\r\n#ifndef M_RASTER_H\r\n#define M_RASTER_H\r\n\r\n#define M_RASTER_VERSION 1\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n#ifndef MRAPI\r\n#define MRAPI extern\r\n#endif\r\n\r\n/* inverse bilinear interpolation */\r\nMRAPI void m_raster_inv_bilerp(float *dest, float x, float y, const float *v0, const float *v1, const float *v2, const float *v3);\r\n\r\n/* triangle with 4 components attributes (float 4 vertices and attributes) */\r\nMRAPI void m_raster_triangle_bbox_att4(float *dest, int width, int height, int minx, int miny, int maxx, int maxy, float *v0, float *v1, float *v2, float *a0, float *a1, float *a2);\r\nMRAPI void m_raster_triangle_att4(float *dest, int width, int height, float *v0, float *v1, float *v2, float *a0, float *a1, float *a2);\r\n\r\n/* basic 2d rasterization (float 2 points) */\r\nMRAPI void m_raster_line(float *dest, int width, int height, int comp, float *p0, float *p1, float *color);\r\nMRAPI void m_raster_circle(float *dest, int width, int height, int comp, float *p, float r, float *color);\r\nMRAPI void m_raster_polygon(float *dest, int width, int height, int comp, float *points, int count, float *color);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n/*\r\n----------------------------------------------------------------------*/\r\n#endif /* M_RASTER_H */\r\n\r\n#ifdef M_RASTER_IMPLEMENTATION\r\n\r\n#ifndef M_MIN\r\n#define M_MIN(a, b) (((a) < (b)) ? (a) : (b))\r\n#endif\r\n#ifndef M_MAX\r\n#define M_MAX(a, b) (((a) > (b)) ? (a) : (b))\r\n#endif\r\n#ifndef M_ABS\r\n#define M_ABS(a) (((a) < 0) ? -(a) : (a))\r\n#endif\r\n\r\n#ifndef M_FIND_MIN_MAX_3\r\n#define M_FIND_MIN_MAX_3(x0, x1, x2, min, max)\\\r\n   min = max = x0;\\\r\n   if (x1 < min) min=x1;\\\r\n   if (x1 > max) max=x1;\\\r\n   if (x2 < min) min=x2;\\\r\n   if (x2 > max) max=x2;\r\n#endif\r\n\r\nMRAPI void m_raster_inv_bilerp(float *dest, float x, float y, const float *v0, const float *v1, const float *v2, const float *v3)\r\n{\r\n   float vec1[2], vec2[2], vecp1[2], vecp2[2];\r\n   float vA, vC, vB;\r\n   float s, is, t, am2bpc, tdenom_x, tdenom_y;\r\n\r\n   vec1[0] = v0[0] - v2[0];\r\n   vec1[1] = v0[1] - v2[1];\r\n   vec2[0] = v1[0] - v3[0];\r\n   vec2[1] = v1[1] - v3[1];\r\n\r\n   vecp1[0] = v0[0] - x;\r\n   vecp1[1] = v0[1] - y;\r\n   vecp2[0] = v1[0] - x;\r\n   vecp2[1] = v1[1] - y;\r\n\r\n   vA = vecp1[0] * vec1[1] - vecp1[1] * vec1[0];\r\n   vC = vecp2[0] * vec2[1] - vecp2[1] * vec2[0];\r\n   vB = ((vecp1[0] * vec2[1] - vecp1[1] * vec2[0]) +\r\n         (vecp2[0] * vec1[1] - vecp2[1] * vec1[0])) * 0.5f;   \r\n   \r\n   am2bpc = vA - 2.0f * vB + vC;\r\n\r\n   if (am2bpc > -0.0001f && am2bpc < 0.0001f)\r\n      s = vA / (vA - vC);\r\n   else\r\n      s = ((vA - vB) + sqrtf(vB * vB - vA * vC)) / am2bpc;\r\n\r\n   is = 1.0f - s;\r\n   tdenom_x = is * vec1[0] + s * vec2[0];\r\n   tdenom_y = is * vec1[1] + s * vec2[1];\r\n\r\n   if (M_ABS(tdenom_x) > M_ABS(tdenom_y))\r\n      t = (is * vecp1[0] + s * vecp2[0]) / tdenom_x;\r\n   else\r\n      t = (is * vecp1[1] + s * vecp2[1]) / tdenom_y;\r\n\r\n   dest[0] = is;\r\n   dest[1] = t;\r\n}\r\n\r\nMRAPI void m_raster_triangle_bbox_att4(float *dest, int width, int height, int minx, int miny, int maxx, int maxy, float *v0, float *v1, float *v2, float *a0, float *a1, float *a2)\r\n{\r\n   float *data = dest;\r\n   float *yline;\r\n   float up0[4], up1[4], up2[4];\r\n   float denom, idenom;\r\n   float t0_row, t1_row;\r\n   float deltaX0, deltaX2, deltaY1, deltaY2;\r\n   int w = width;\r\n   int w4, mx4, y;\r\n\r\n   /* denominator */\r\n   denom = (v1[0] - v2[0]) * (v2[1] - v0[1]) - (v1[1] - v2[1]) * (v2[0] - v0[0]);\r\n   if (denom >= 0.0f)\r\n      return;\r\n   \r\n   idenom = 1.0f / denom;\r\n\r\n   /* scanline */\r\n   t0_row = ((v2[0] - v1[0]) * (miny-v1[1]) - (v2[1] - v1[1]) * (minx - v1[0])) * idenom;\r\n   t1_row = ((v0[0] - v2[0]) * (miny-v2[1]) - (v0[1] - v2[1]) * (minx - v2[0])) * idenom;\r\n   \r\n   deltaX0 = (v0[0] - v2[0]) * idenom;\r\n   deltaX2 = (v2[0] - v1[0]) * idenom;\r\n   deltaY1 = (v1[1] - v2[1]) * idenom;\r\n   deltaY2 = (v2[1] - v0[1]) * idenom;\r\n\r\n   up0[0] = a0[0] * v0[3]; up0[1] = a0[1] * v0[3]; up0[2] = a0[2] * v0[3]; up0[3] = a0[3] * v0[3];\r\n   up1[0] = a1[0] * v1[3]; up1[1] = a1[1] * v1[3]; up1[2] = a1[2] * v1[3]; up1[3] = a1[3] * v1[3];\r\n   up2[0] = a2[0] * v2[3]; up2[1] = a2[1] * v2[3]; up2[2] = a2[2] * v2[3]; up2[3] = a2[3] * v2[3];\r\n\r\n   w4 = w * 4;\r\n   mx4 = minx * 4;\r\n   \r\n   yline = data + miny * w4;\r\n   for (y = miny; y <= maxy; y++) {\r\n\r\n      float *pixel = yline + mx4;\r\n      float t0 = t0_row;\r\n      float t1 = t1_row;\r\n      int x;\r\n      \r\n      for (x = minx; x <= maxx; x++) {\r\n\r\n         float t2 = t0 + t1;\r\n         if (t0 >= 0.0f && t1 >= 0.0f && t2 <= 1.0f) {\r\n\r\n            float it2 = 1.0f - t2;\r\n            float w = 1.0f / (t0 * v0[3] + t1 * v1[3] + it2 * v2[3]);\r\n\r\n            pixel[0] = (up0[0] * t0 + up1[0] * t1 + up2[0] * it2) * w;\r\n            pixel[1] = (up0[1] * t0 + up1[1] * t1 + up2[1] * it2) * w;\r\n            pixel[2] = (up0[2] * t0 + up1[2] * t1 + up2[2] * it2) * w;\r\n            pixel[3] = (up0[3] * t0 + up1[3] * t1 + up2[3] * it2) * w;\r\n         }\r\n\r\n         t0 += deltaY1;\r\n         t1 += deltaY2;\r\n         pixel += 4;\r\n      }\r\n\r\n      t0_row += deltaX2;\r\n      t1_row += deltaX0;\r\n      yline += w4;\r\n   }\r\n}\r\n\r\nMRAPI void m_raster_triangle_att4(float *dest, int width, int height, float *v0, float *v1, float *v2, float *a0, float *a1, float *a2)\r\n{\r\n   int minx, maxx, miny, maxy;\r\n   int w = width;\r\n   int h = height;\r\n\r\n   if (v0[3] <= 0.0f || v1[3] <= 0.0f || v2[3] <= 0.0f) /* no clip */\r\n      return;\r\n\r\n   /* bounding box */\r\n   M_FIND_MIN_MAX_3((int)v0[0], (int)v1[0], (int)v2[0], minx, maxx);\r\n   M_FIND_MIN_MAX_3((int)v0[1], (int)v1[1], (int)v2[1], miny, maxy);\r\n   minx = M_MAX(minx, 0);\r\n   miny = M_MAX(miny, 0);\r\n   maxx = M_MIN(maxx, w - 1);\r\n   maxy = M_MIN(maxy, h - 1);\r\n\r\n   m_raster_triangle_bbox_att4(dest, width, height, minx, miny, maxx, maxy, v0, v1, v2, a0, a1, a2);\r\n}\r\n\r\nMRAPI void m_raster_line(float *dest, int width, int height, int comp, float *p0, float *p1, float *color)\r\n{\r\n   float *data = dest;\r\n   int x0 = (int)p0[0];\r\n   int y0 = (int)p0[1];\r\n   int x1 = (int)p1[0];\r\n   int y1 = (int)p1[1];\r\n   int w = width;\r\n   int h = height;\r\n   int dx =  M_ABS(x1 - x0), sx = x0 < x1 ? 1 : -1;\r\n   int dy = -M_ABS(y1 - y0), sy = y0 < y1 ? 1 : -1;\r\n   int err = dx + dy, e2;\r\n\r\n   while (1) {\r\n\r\n      if (x0 > -1 && y0 > -1 && x0 < w && y0 < h) { /* safe, but should be taken out of the loop for speed (clipping ?) */\r\n         float *pixel = data + (y0 * w + x0) * comp; int c;\r\n         for (c = 0; c < comp; c++)\r\n            pixel[c] = color[c];\r\n      }\r\n      \r\n      if (x0 == x1 && y0 == y1)\r\n         break;\r\n      \r\n      e2 = 2 * err;\r\n      if (e2 >= dy) { err += dy; x0 += sx; }\r\n      if (e2 <= dx) { err += dx; y0 += sy; }\r\n   }\r\n}\r\n\r\n// Midpoint Circle Algorithm : http://en[3]ikipedia.org/wiki/Midpoint_circle_algorithm\r\nMRAPI void m_raster_circle(float *dest, int width, int height, int comp, float *p, float r, float *color)\r\n{\r\n   #define M_CIRCLE_PIXEL(px, py)\\\r\n   {\\\r\n      int x2 = px;\\\r\n      int y2 = py;\\\r\n      if (x2 > -1 && y2 > -1 && x2 < w && y2 < h) {\\\r\n         float *pixel = data + (y2 * w + x2) * comp; int c;\\\r\n         for (c = 0; c < comp; c++)\\\r\n            pixel[c] = color[c];\\\r\n      }\\\r\n   }\r\n\r\n   float *data = dest;\r\n   int x0 = (int)p[0];\r\n   int y0 = (int)p[1];\r\n   int radius = (int)r;\r\n   int w = width;\r\n   int h = height;\r\n   int x = radius, y = 0;\r\n   int radius_error = 1 - x;\r\n \r\n   while (x >= y) {\r\n\r\n      M_CIRCLE_PIXEL( x + x0,  y + y0)\r\n      M_CIRCLE_PIXEL( y + x0,  x + y0)\r\n      M_CIRCLE_PIXEL(-x + x0,  y + y0)\r\n      M_CIRCLE_PIXEL(-y + x0,  x + y0)\r\n      M_CIRCLE_PIXEL(-x + x0, -y + y0)\r\n      M_CIRCLE_PIXEL(-y + x0, -x + y0)\r\n      M_CIRCLE_PIXEL( x + x0, -y + y0)\r\n      M_CIRCLE_PIXEL( y + x0, -x + y0)\r\n      y++;\r\n        \r\n      if (radius_error < 0)\r\n         radius_error += 2 * y + 1;\r\n      else {\r\n         x--;\r\n         radius_error += 2 * (y - x + 1);\r\n      }\r\n   }\r\n\r\n   #undef M_CIRCLE_PIXEL\r\n}\r\n\r\n/* adapted from : http://alienryderflex.com/polygon_fill/\r\n   public-domain code by Darel Rex Finley, 2007\r\n*/\r\nMRAPI void m_raster_polygon(float *dest, int width, int height, int comp, float *points, int count, float *color)\r\n{\r\n   float *data = dest;\r\n   int *nodeX;\r\n   int w = width;\r\n   int h = height;\r\n   int pixelY;\r\n   int IMAGE_LEFT, IMAGE_RIGHT;\r\n   int IMAGE_TOP, IMAGE_BOT;\r\n\r\n   if (count < 3)\r\n      return;\r\n   \r\n   nodeX = (int *)malloc(count * sizeof(int));\r\n   \r\n   /* bounding box */\r\n   {\r\n      float *point = points;\r\n      float min[2], max[2]; int i;\r\n\r\n      min[0] = point[0];\r\n\t   max[0] = point[0];\r\n\t   min[1] = point[1];\r\n\t   max[1] = point[1];\r\n\t   point += 2;\r\n\r\n      for (i = 1; i < count; i++) {\r\n         min[0] = M_MIN(min[0], point[0]);\r\n         min[1] = M_MIN(min[1], point[1]);\r\n         max[0] = M_MAX(max[0], point[0]);\r\n         max[1] = M_MAX(max[1], point[1]);\r\n         point += 2;\r\n      }\r\n\r\n      IMAGE_LEFT =  M_MAX(0, (int)min[0]);\r\n      IMAGE_TOP =   M_MAX(0, (int)min[1]);\r\n      IMAGE_RIGHT = M_MIN(w - 1, (int)max[0] + 1);\r\n      IMAGE_BOT =   M_MIN(h - 1, (int)max[1] + 1);\r\n   }\r\n\r\n   /* loop through the rows of the image. */\r\n   for (pixelY = IMAGE_TOP; pixelY < IMAGE_BOT; pixelY++) {\r\n\r\n      /* build a list of nodes. */\r\n      float *pointi, *pointj;\r\n      int nodes = 0;\r\n      int i, j;\r\n\r\n      pointi = points;\r\n      pointj = points + ((count - 1) * 2);\r\n\r\n      for (i = 0; i < count; i++) {\r\n         if ((pointi[1] < (float)pixelY && pointj[1] >= (float)pixelY) ||\r\n             (pointj[1] < (float)pixelY && pointi[1] >= (float)pixelY))\r\n            nodeX[nodes++] = (int)(pointi[0] + (pixelY - pointi[1]) / (pointj[1] - pointi[1]) * (pointj[0] - pointi[0]));\r\n         pointj = pointi;\r\n         pointi += 2;\r\n      }\r\n\r\n      /*  sort the nodes, via a simple Bubble sort. */\r\n      i = 0;\r\n      while (i < (nodes - 1)) {\r\n         if (nodeX[i] > nodeX[i + 1]) {\r\n            int swap = nodeX[i]; nodeX[i] = nodeX[i + 1]; nodeX[i + 1] = swap; if (i) i--;\r\n         }\r\n         else i++;\r\n      }\r\n\r\n      /* fill the pixels between node pairs. */\r\n      for (i = 0; i < nodes; i += 2) {\r\n\r\n         if (nodeX[i] >= IMAGE_RIGHT)\r\n            break;\r\n            \r\n         if (nodeX[i + 1] > IMAGE_LEFT) {\r\n\r\n            float *pixel;\r\n            nodeX[i]     = M_MAX(nodeX[i], IMAGE_LEFT);\r\n            nodeX[i + 1] = M_MIN(nodeX[i + 1], IMAGE_RIGHT);\r\n            pixel = data + (pixelY * w + nodeX[i]) * comp;\r\n\r\n            for (j = nodeX[i]; j < nodeX[i + 1]; j++) {\r\n               int c;\r\n               for (c = 0; c < comp; c++)\r\n                  pixel[c] = color[c];\r\n               pixel += comp;\r\n            }\r\n         }\r\n      }\r\n   }\r\n   \r\n   free(nodeX);\r\n}\r\n\r\n#endif /* M_RASTER_IMPLEMENTATION */"
  },
  {
    "path": "tests/3rdparty/CMakeLists.txt",
    "content": "ADD_SUBDIRECTORY(tinycthread)\nADD_SUBDIRECTORY(glfw)"
  },
  {
    "path": "tests/3rdparty/glfw/CMakeLists.txt",
    "content": "## Find source and headers\n\nFILE(GLOB SOURCES\n  src/clipboard.c\n  src/context.c\n  src/gamma.c\n  src/init.c\n  src/input.c\n  src/joystick.c\n  src/monitor.c\n  src/time.c\n  src/window.c\n)\n\nIF(WIN32)\n  FILE(GLOB OS_HEADERS src/win32_*.h src/wgl_*.h)\n  FILE(GLOB OS_SOURCES src/win32_*.c src/wgl_*.c)\n  ADD_DEFINITIONS(-D_GLFW_WIN32)\n  ADD_DEFINITIONS(-D_GLFW_WGL)\nENDIF(WIN32)\n\nIF(APPLE)\n  FILE(GLOB OS_HEADERS src/cocoa_*.h src/nsgl_*.h)\n  FILE(GLOB OS_SOURCES src/cocoa_*.c src/nsgl_*.c src/cocoa_*.m src/nsgl_*.m)\n  ADD_DEFINITIONS(-D_GLFW_COCOA)\n  ADD_DEFINITIONS(-D_GLFW_NSGL)\nENDIF(APPLE)\n\nIF(UNIX AND NOT APPLE)\n  FILE(GLOB OS_HEADERS src/x11_*.h src/glx_*.h)\n  FILE(GLOB OS_SOURCES src/x11_*.c src/glx_*.c)\n  ADD_DEFINITIONS(-D_GLFW_X11)\n  ADD_DEFINITIONS(-D_GLFW_GLX)\n  ADD_DEFINITIONS(-D_GLFW_HAS_GLXGETPROCADDRESS)\nENDIF(UNIX AND NOT APPLE)\n\nIF(CMAKE_HAS_SORT)\n  LIST(SORT SOURCES)\n  LIST(SORT OS_HEADERS)\n  LIST(SORT OS_SOURCES)\nENDIF(CMAKE_HAS_SORT)\n\n## Build\nADD_DEFINITIONS(-D_GLFW_USE_OPENGL)\nADD_DEFINITIONS(-D_GLFW_USE_MENUBAR)\nADD_DEFINITIONS(-D_GLFW_USE_CHDIR)\n\nINCLUDE_DIRECTORIES(\n  include\n)\n\nADD_LIBRARY(glfw ${SOURCES} ${OS_HEADERS} ${OS_SOURCES})\n"
  },
  {
    "path": "tests/3rdparty/glfw/COPYING.txt",
    "content": "Copyright (c) 2002-2006 Marcus Geelnard\nCopyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not\n   claim that you wrote the original software. If you use this software\n   in a product, an acknowledgment in the product documentation would\n   be appreciated but is not required.\n\n2. Altered source versions must be plainly marked as such, and must not\n   be misrepresented as being the original software.\n\n3. This notice may not be removed or altered from any source\n   distribution.\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/deps/EGL/eglext.h",
    "content": "#ifndef __eglext_h_\n#define __eglext_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n** Copyright (c) 2007-2013 The Khronos Group Inc.\n**\n** Permission is hereby granted, free of charge, to any person obtaining a\n** copy of this software and/or associated documentation files (the\n** \"Materials\"), to deal in the Materials without restriction, including\n** without limitation the rights to use, copy, modify, merge, publish,\n** distribute, sublicense, and/or sell copies of the Materials, and to\n** permit persons to whom the Materials are furnished to do so, subject to\n** the following conditions:\n**\n** The above copyright notice and this permission notice shall be included\n** in all copies or substantial portions of the Materials.\n**\n** THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n*/\n\n#include <EGL/eglplatform.h>\n\n/*************************************************************/\n\n/* Header file version number */\n/* Current version at http://www.khronos.org/registry/egl/ */\n/* $Revision: 20690 $ on $Date: 2013-02-22 17:15:05 -0800 (Fri, 22 Feb 2013) $ */\n#define EGL_EGLEXT_VERSION 15\n\n#ifndef EGL_KHR_config_attribs\n#define EGL_KHR_config_attribs 1\n#define EGL_CONFORMANT_KHR\t\t\t0x3042\t/* EGLConfig attribute */\n#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR\t0x0020\t/* EGL_SURFACE_TYPE bitfield */\n#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR\t\t0x0040\t/* EGL_SURFACE_TYPE bitfield */\n#endif\n\n#ifndef EGL_KHR_lock_surface\n#define EGL_KHR_lock_surface 1\n#define EGL_READ_SURFACE_BIT_KHR\t\t0x0001\t/* EGL_LOCK_USAGE_HINT_KHR bitfield */\n#define EGL_WRITE_SURFACE_BIT_KHR\t\t0x0002\t/* EGL_LOCK_USAGE_HINT_KHR bitfield */\n#define EGL_LOCK_SURFACE_BIT_KHR\t\t0x0080\t/* EGL_SURFACE_TYPE bitfield */\n#define EGL_OPTIMAL_FORMAT_BIT_KHR\t\t0x0100\t/* EGL_SURFACE_TYPE bitfield */\n#define EGL_MATCH_FORMAT_KHR\t\t\t0x3043\t/* EGLConfig attribute */\n#define EGL_FORMAT_RGB_565_EXACT_KHR\t\t0x30C0\t/* EGL_MATCH_FORMAT_KHR value */\n#define EGL_FORMAT_RGB_565_KHR\t\t\t0x30C1\t/* EGL_MATCH_FORMAT_KHR value */\n#define EGL_FORMAT_RGBA_8888_EXACT_KHR\t\t0x30C2\t/* EGL_MATCH_FORMAT_KHR value */\n#define EGL_FORMAT_RGBA_8888_KHR\t\t0x30C3\t/* EGL_MATCH_FORMAT_KHR value */\n#define EGL_MAP_PRESERVE_PIXELS_KHR\t\t0x30C4\t/* eglLockSurfaceKHR attribute */\n#define EGL_LOCK_USAGE_HINT_KHR\t\t\t0x30C5\t/* eglLockSurfaceKHR attribute */\n#define EGL_BITMAP_POINTER_KHR\t\t\t0x30C6\t/* eglQuerySurface attribute */\n#define EGL_BITMAP_PITCH_KHR\t\t\t0x30C7\t/* eglQuerySurface attribute */\n#define EGL_BITMAP_ORIGIN_KHR\t\t\t0x30C8\t/* eglQuerySurface attribute */\n#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR\t\t0x30C9\t/* eglQuerySurface attribute */\n#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR\t0x30CA\t/* eglQuerySurface attribute */\n#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR\t0x30CB\t/* eglQuerySurface attribute */\n#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR\t0x30CC\t/* eglQuerySurface attribute */\n#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR\t0x30CD\t/* eglQuerySurface attribute */\n#define EGL_LOWER_LEFT_KHR\t\t\t0x30CE\t/* EGL_BITMAP_ORIGIN_KHR value */\n#define EGL_UPPER_LEFT_KHR\t\t\t0x30CF\t/* EGL_BITMAP_ORIGIN_KHR value */\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);\nEGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);\n#endif\n\n#ifndef EGL_KHR_image\n#define EGL_KHR_image 1\n#define EGL_NATIVE_PIXMAP_KHR\t\t\t0x30B0\t/* eglCreateImageKHR target */\ntypedef void *EGLImageKHR;\n#define EGL_NO_IMAGE_KHR\t\t\t((EGLImageKHR)0)\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);\nEGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);\n#endif\n\n#ifndef EGL_KHR_vg_parent_image\n#define EGL_KHR_vg_parent_image 1\n#define EGL_VG_PARENT_IMAGE_KHR\t\t\t0x30BA\t/* eglCreateImageKHR target */\n#endif\n\n#ifndef EGL_KHR_gl_texture_2D_image\n#define EGL_KHR_gl_texture_2D_image 1\n#define EGL_GL_TEXTURE_2D_KHR\t\t\t0x30B1\t/* eglCreateImageKHR target */\n#define EGL_GL_TEXTURE_LEVEL_KHR\t\t0x30BC\t/* eglCreateImageKHR attribute */\n#endif\n\n#ifndef EGL_KHR_gl_texture_cubemap_image\n#define EGL_KHR_gl_texture_cubemap_image 1\n#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR\t0x30B3\t/* eglCreateImageKHR target */\n#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR\t0x30B4\t/* eglCreateImageKHR target */\n#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR\t0x30B5\t/* eglCreateImageKHR target */\n#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR\t0x30B6\t/* eglCreateImageKHR target */\n#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR\t0x30B7\t/* eglCreateImageKHR target */\n#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR\t0x30B8\t/* eglCreateImageKHR target */\n#endif\n\n#ifndef EGL_KHR_gl_texture_3D_image\n#define EGL_KHR_gl_texture_3D_image 1\n#define EGL_GL_TEXTURE_3D_KHR\t\t\t0x30B2\t/* eglCreateImageKHR target */\n#define EGL_GL_TEXTURE_ZOFFSET_KHR\t\t0x30BD\t/* eglCreateImageKHR attribute */\n#endif\n\n#ifndef EGL_KHR_gl_renderbuffer_image\n#define EGL_KHR_gl_renderbuffer_image 1\n#define EGL_GL_RENDERBUFFER_KHR\t\t\t0x30B9\t/* eglCreateImageKHR target */\n#endif\n\n#if KHRONOS_SUPPORT_INT64   /* EGLTimeKHR requires 64-bit uint support */\n#ifndef EGL_KHR_reusable_sync\n#define EGL_KHR_reusable_sync 1\n\ntypedef void* EGLSyncKHR;\ntypedef khronos_utime_nanoseconds_t EGLTimeKHR;\n\n#define EGL_SYNC_STATUS_KHR\t\t\t0x30F1\n#define EGL_SIGNALED_KHR\t\t\t0x30F2\n#define EGL_UNSIGNALED_KHR\t\t\t0x30F3\n#define EGL_TIMEOUT_EXPIRED_KHR\t\t\t0x30F5\n#define EGL_CONDITION_SATISFIED_KHR\t\t0x30F6\n#define EGL_SYNC_TYPE_KHR\t\t\t0x30F7\n#define EGL_SYNC_REUSABLE_KHR\t\t\t0x30FA\n#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR\t\t0x0001\t/* eglClientWaitSyncKHR <flags> bitfield */\n#define EGL_FOREVER_KHR\t\t\t\t0xFFFFFFFFFFFFFFFFull\n#define EGL_NO_SYNC_KHR\t\t\t\t((EGLSyncKHR)0)\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);\nEGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);\nEGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);\nEGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);\nEGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);\ntypedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);\n#endif\n#endif\n\n#ifndef EGL_KHR_image_base\n#define EGL_KHR_image_base 1\n/* Most interfaces defined by EGL_KHR_image_pixmap above */\n#define EGL_IMAGE_PRESERVED_KHR\t\t\t0x30D2\t/* eglCreateImageKHR attribute */\n#endif\n\n#ifndef EGL_KHR_image_pixmap\n#define EGL_KHR_image_pixmap 1\n/* Interfaces defined by EGL_KHR_image above */\n#endif\n\n#ifndef EGL_IMG_context_priority\n#define EGL_IMG_context_priority 1\n#define EGL_CONTEXT_PRIORITY_LEVEL_IMG\t\t0x3100\n#define EGL_CONTEXT_PRIORITY_HIGH_IMG\t\t0x3101\n#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG\t\t0x3102\n#define EGL_CONTEXT_PRIORITY_LOW_IMG\t\t0x3103\n#endif\n\n#ifndef EGL_KHR_lock_surface2\n#define EGL_KHR_lock_surface2 1\n#define EGL_BITMAP_PIXEL_SIZE_KHR\t\t0x3110\n#endif\n\n#ifndef EGL_NV_coverage_sample\n#define EGL_NV_coverage_sample 1\n#define EGL_COVERAGE_BUFFERS_NV\t\t\t0x30E0\n#define EGL_COVERAGE_SAMPLES_NV\t\t\t0x30E1\n#endif\n\n#ifndef EGL_NV_depth_nonlinear\n#define EGL_NV_depth_nonlinear 1\n#define EGL_DEPTH_ENCODING_NV\t\t\t0x30E2\n#define EGL_DEPTH_ENCODING_NONE_NV 0\n#define EGL_DEPTH_ENCODING_NONLINEAR_NV\t\t0x30E3\n#endif\n\n#if KHRONOS_SUPPORT_INT64   /* EGLTimeNV requires 64-bit uint support */\n#ifndef EGL_NV_sync\n#define EGL_NV_sync 1\n#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV\t0x30E6\n#define EGL_SYNC_STATUS_NV\t\t\t0x30E7\n#define EGL_SIGNALED_NV\t\t\t\t0x30E8\n#define EGL_UNSIGNALED_NV\t\t\t0x30E9\n#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV\t\t0x0001\n#define EGL_FOREVER_NV\t\t\t\t0xFFFFFFFFFFFFFFFFull\n#define EGL_ALREADY_SIGNALED_NV\t\t\t0x30EA\n#define EGL_TIMEOUT_EXPIRED_NV\t\t\t0x30EB\n#define EGL_CONDITION_SATISFIED_NV\t\t0x30EC\n#define EGL_SYNC_TYPE_NV\t\t\t0x30ED\n#define EGL_SYNC_CONDITION_NV\t\t\t0x30EE\n#define EGL_SYNC_FENCE_NV\t\t\t0x30EF\n#define EGL_NO_SYNC_NV\t\t\t\t((EGLSyncNV)0)\ntypedef void* EGLSyncNV;\ntypedef khronos_utime_nanoseconds_t EGLTimeNV;\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);\nEGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);\nEGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);\nEGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);\nEGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);\nEGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);\ntypedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);\n#endif\n#endif\n\n#if KHRONOS_SUPPORT_INT64   /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */\n#ifndef EGL_KHR_fence_sync\n#define EGL_KHR_fence_sync 1\n/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */\n#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR\t0x30F0\n#define EGL_SYNC_CONDITION_KHR\t\t\t0x30F8\n#define EGL_SYNC_FENCE_KHR\t\t\t0x30F9\n#endif\n#endif\n\n#ifndef EGL_HI_clientpixmap\n#define EGL_HI_clientpixmap 1\n\n/* Surface Attribute */\n#define EGL_CLIENT_PIXMAP_POINTER_HI\t\t0x8F74\n/*\n * Structure representing a client pixmap\n * (pixmap's data is in client-space memory).\n */\nstruct EGLClientPixmapHI\n{\n\tvoid*\t\tpData;\n\tEGLint\t\tiWidth;\n\tEGLint\t\tiHeight;\n\tEGLint\t\tiStride;\n};\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);\n#endif\t/* EGL_HI_clientpixmap */\n\n#ifndef EGL_HI_colorformats\n#define EGL_HI_colorformats 1\n/* Config Attribute */\n#define EGL_COLOR_FORMAT_HI\t\t\t0x8F70\n/* Color Formats */\n#define EGL_COLOR_RGB_HI\t\t\t0x8F71\n#define EGL_COLOR_RGBA_HI\t\t\t0x8F72\n#define EGL_COLOR_ARGB_HI\t\t\t0x8F73\n#endif /* EGL_HI_colorformats */\n\n#ifndef EGL_MESA_drm_image\n#define EGL_MESA_drm_image 1\n#define EGL_DRM_BUFFER_FORMAT_MESA\t\t0x31D0\t    /* CreateDRMImageMESA attribute */\n#define EGL_DRM_BUFFER_USE_MESA\t\t\t0x31D1\t    /* CreateDRMImageMESA attribute */\n#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA\t0x31D2\t    /* EGL_IMAGE_FORMAT_MESA attribute value */\n#define EGL_DRM_BUFFER_MESA\t\t\t0x31D3\t    /* eglCreateImageKHR target */\n#define EGL_DRM_BUFFER_STRIDE_MESA\t\t0x31D4\n#define EGL_DRM_BUFFER_USE_SCANOUT_MESA\t\t0x00000001  /* EGL_DRM_BUFFER_USE_MESA bits */\n#define EGL_DRM_BUFFER_USE_SHARE_MESA\t\t0x00000002  /* EGL_DRM_BUFFER_USE_MESA bits */\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);\nEGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);\n#endif\n\n#ifndef EGL_NV_post_sub_buffer\n#define EGL_NV_post_sub_buffer 1\n#define EGL_POST_SUB_BUFFER_SUPPORTED_NV\t0x30BE\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);\n#endif\n\n#ifndef EGL_ANGLE_query_surface_pointer\n#define EGL_ANGLE_query_surface_pointer 1\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);\n#endif\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);\n#endif\n\n#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle\n#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1\n#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE\t0x3200\n#endif\n\n#ifndef EGL_NV_coverage_sample_resolve\n#define EGL_NV_coverage_sample_resolve 1\n#define EGL_COVERAGE_SAMPLE_RESOLVE_NV\t\t0x3131\n#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV\t0x3132\n#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV\t0x3133\n#endif\n\n#if KHRONOS_SUPPORT_INT64   /* EGLuint64NV requires 64-bit uint support */\n#ifndef EGL_NV_system_time\n#define EGL_NV_system_time 1\ntypedef khronos_utime_nanoseconds_t EGLuint64NV;\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);\nEGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);\ntypedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);\n#endif\n#endif\n\n#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */\n#ifndef EGL_KHR_stream\n#define EGL_KHR_stream 1\ntypedef void* EGLStreamKHR;\ntypedef khronos_uint64_t EGLuint64KHR;\n#define EGL_NO_STREAM_KHR\t\t\t((EGLStreamKHR)0)\n#define EGL_CONSUMER_LATENCY_USEC_KHR\t\t0x3210\n#define EGL_PRODUCER_FRAME_KHR\t\t\t0x3212\n#define EGL_CONSUMER_FRAME_KHR\t\t\t0x3213\n#define EGL_STREAM_STATE_KHR\t\t\t0x3214\n#define EGL_STREAM_STATE_CREATED_KHR\t\t0x3215\n#define EGL_STREAM_STATE_CONNECTING_KHR\t\t0x3216\n#define EGL_STREAM_STATE_EMPTY_KHR\t\t0x3217\n#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR    0x3218\n#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR    0x3219\n#define EGL_STREAM_STATE_DISCONNECTED_KHR\t0x321A\n#define EGL_BAD_STREAM_KHR\t\t\t0x321B\n#define EGL_BAD_STATE_KHR\t\t\t0x321C\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);\nEGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);\nEGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);\nEGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);\nEGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);\n#endif\n#endif\n\n#ifdef EGL_KHR_stream /* Requires KHR_stream extension */\n#ifndef EGL_KHR_stream_consumer_gltexture\n#define EGL_KHR_stream_consumer_gltexture 1\n#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR\t0x321E\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);\nEGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);\nEGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);\n#endif\n#endif\n\n#ifdef EGL_KHR_stream /* Requires KHR_stream extension */\n#ifndef EGL_KHR_stream_producer_eglsurface\n#define EGL_KHR_stream_producer_eglsurface 1\n#define EGL_STREAM_BIT_KHR\t\t\t0x0800\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);\n#endif\n#endif\n\n#ifdef EGL_KHR_stream /* Requires KHR_stream extension */\n#ifndef EGL_KHR_stream_producer_aldatalocator\n#define EGL_KHR_stream_producer_aldatalocator 1\n#endif\n#endif\n\n#ifdef EGL_KHR_stream /* Requires KHR_stream extension */\n#ifndef EGL_KHR_stream_fifo\n#define EGL_KHR_stream_fifo 1\n/* reuse EGLTimeKHR */\n#define EGL_STREAM_FIFO_LENGTH_KHR\t\t0x31FC\n#define EGL_STREAM_TIME_NOW_KHR\t\t\t0x31FD\n#define EGL_STREAM_TIME_CONSUMER_KHR\t\t0x31FE\n#define EGL_STREAM_TIME_PRODUCER_KHR\t\t0x31FF\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);\n#endif\n#endif\n\n#ifndef EGL_EXT_create_context_robustness\n#define EGL_EXT_create_context_robustness 1\n#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT\t0x30BF\n#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138\n#define EGL_NO_RESET_NOTIFICATION_EXT\t\t0x31BE\n#define EGL_LOSE_CONTEXT_ON_RESET_EXT\t\t0x31BF\n#endif\n\n#ifndef EGL_ANGLE_d3d_share_handle_client_buffer\n#define EGL_ANGLE_d3d_share_handle_client_buffer 1\n/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */\n#endif\n\n#ifndef EGL_KHR_create_context\n#define EGL_KHR_create_context 1\n#define EGL_CONTEXT_MAJOR_VERSION_KHR\t\t\t    EGL_CONTEXT_CLIENT_VERSION\n#define EGL_CONTEXT_MINOR_VERSION_KHR\t\t\t    0x30FB\n#define EGL_CONTEXT_FLAGS_KHR\t\t\t\t    0x30FC\n#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR\t\t    0x30FD\n#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR  0x31BD\n#define EGL_NO_RESET_NOTIFICATION_KHR\t\t\t    0x31BE\n#define EGL_LOSE_CONTEXT_ON_RESET_KHR\t\t\t    0x31BF\n#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR\t\t    0x00000001\n#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR\t    0x00000002\n#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR\t    0x00000004\n#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR\t\t    0x00000001\n#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR    0x00000002\n#define EGL_OPENGL_ES3_BIT_KHR\t\t\t\t    0x00000040\n#endif\n\n#ifndef EGL_KHR_surfaceless_context\n#define EGL_KHR_surfaceless_context 1\n/* No tokens/entry points, just relaxes an error condition */\n#endif\n\n#ifdef EGL_KHR_stream /* Requires KHR_stream extension */\n#ifndef EGL_KHR_stream_cross_process_fd\n#define EGL_KHR_stream_cross_process_fd 1\ntypedef int EGLNativeFileDescriptorKHR;\n#define EGL_NO_FILE_DESCRIPTOR_KHR\t\t((EGLNativeFileDescriptorKHR)(-1))\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);\nEGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);\ntypedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);\n#endif\n#endif\n\n#ifndef EGL_EXT_multiview_window\n#define EGL_EXT_multiview_window 1\n#define EGL_MULTIVIEW_VIEW_COUNT_EXT\t\t0x3134\n#endif\n\n#ifndef EGL_KHR_wait_sync\n#define EGL_KHR_wait_sync 1\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);\n#endif\n\n#ifndef EGL_NV_post_convert_rounding\n#define EGL_NV_post_convert_rounding 1\n/* No tokens or entry points, just relaxes behavior of SwapBuffers */\n#endif\n\n#ifndef EGL_NV_native_query\n#define EGL_NV_native_query 1\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV( EGLDisplay dpy, EGLNativeDisplayType* display_id);\nEGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV( EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType* window);\nEGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV( EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType* pixmap);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC)(EGLDisplay dpy, EGLNativeDisplayType *display_id);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);\ntypedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);\n#endif\n\n#ifndef EGL_NV_3dvision_surface\n#define EGL_NV_3dvision_surface 1\n#define EGL_AUTO_STEREO_NV\t\t\t0x3136\n#endif\n\n#ifndef EGL_ANDROID_framebuffer_target\n#define EGL_ANDROID_framebuffer_target 1\n#define EGL_FRAMEBUFFER_TARGET_ANDROID\t\t0x3147\n#endif\n\n#ifndef EGL_ANDROID_blob_cache\n#define EGL_ANDROID_blob_cache 1\ntypedef khronos_ssize_t EGLsizeiANDROID;\ntypedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);\ntypedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC)(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);\n#endif\n\n#ifndef EGL_ANDROID_image_native_buffer\n#define EGL_ANDROID_image_native_buffer 1\n#define EGL_NATIVE_BUFFER_ANDROID\t\t0x3140\n#endif\n\n#ifndef EGL_ANDROID_native_fence_sync\n#define EGL_ANDROID_native_fence_sync 1\n#define EGL_SYNC_NATIVE_FENCE_ANDROID\t\t0x3144\n#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID\t0x3145\n#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID\t0x3146\n#define EGL_NO_NATIVE_FENCE_FD_ANDROID\t\t-1\n#ifdef EGL_EGLEXT_PROTOTYPES\nEGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID( EGLDisplay dpy, EGLSyncKHR);\n#endif /* EGL_EGLEXT_PROTOTYPES */\ntypedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC)(EGLDisplay dpy, EGLSyncKHR);\n#endif\n\n#ifndef EGL_ANDROID_recordable\n#define EGL_ANDROID_recordable 1\n#define EGL_RECORDABLE_ANDROID\t\t\t0x3142\n#endif\n\n#ifndef EGL_EXT_buffer_age\n#define EGL_EXT_buffer_age 1\n#define EGL_BUFFER_AGE_EXT\t\t\t0x313D\n#endif\n\n#ifndef EGL_EXT_image_dma_buf_import\n#define EGL_EXT_image_dma_buf_import 1\n#define EGL_LINUX_DMA_BUF_EXT\t\t\t0x3270\n#define EGL_LINUX_DRM_FOURCC_EXT\t\t0x3271\n#define EGL_DMA_BUF_PLANE0_FD_EXT\t\t0x3272\n#define EGL_DMA_BUF_PLANE0_OFFSET_EXT\t\t0x3273\n#define EGL_DMA_BUF_PLANE0_PITCH_EXT\t\t0x3274\n#define EGL_DMA_BUF_PLANE1_FD_EXT\t\t0x3275\n#define EGL_DMA_BUF_PLANE1_OFFSET_EXT\t\t0x3276\n#define EGL_DMA_BUF_PLANE1_PITCH_EXT\t\t0x3277\n#define EGL_DMA_BUF_PLANE2_FD_EXT\t\t0x3278\n#define EGL_DMA_BUF_PLANE2_OFFSET_EXT\t\t0x3279\n#define EGL_DMA_BUF_PLANE2_PITCH_EXT\t\t0x327A\n#define EGL_YUV_COLOR_SPACE_HINT_EXT\t\t0x327B\n#define EGL_SAMPLE_RANGE_HINT_EXT\t\t0x327C\n#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D\n#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E\n#define EGL_ITU_REC601_EXT\t\t\t0x327F\n#define EGL_ITU_REC709_EXT\t\t\t0x3280\n#define EGL_ITU_REC2020_EXT\t\t\t0x3281\n#define EGL_YUV_FULL_RANGE_EXT\t\t\t0x3282\n#define EGL_YUV_NARROW_RANGE_EXT\t\t0x3283\n#define EGL_YUV_CHROMA_SITING_0_EXT\t\t0x3284\n#define EGL_YUV_CHROMA_SITING_0_5_EXT\t\t0x3285\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __eglext_h_ */\n"
  },
  {
    "path": "tests/3rdparty/glfw/deps/GL/glext.h",
    "content": "#ifndef __glext_h_\n#define __glext_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n** Copyright (c) 2007-2012 The Khronos Group Inc.\n** \n** Permission is hereby granted, free of charge, to any person obtaining a\n** copy of this software and/or associated documentation files (the\n** \"Materials\"), to deal in the Materials without restriction, including\n** without limitation the rights to use, copy, modify, merge, publish,\n** distribute, sublicense, and/or sell copies of the Materials, and to\n** permit persons to whom the Materials are furnished to do so, subject to\n** the following conditions:\n** \n** The above copyright notice and this permission notice shall be included\n** in all copies or substantial portions of the Materials.\n** \n** THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n*/\n\n/* Header file version number, required by OpenGL ABI for Linux */\n/* glext.h last updated $Date: 2012-09-19 19:02:24 -0700 (Wed, 19 Sep 2012) $ */\n/* Current version at http://www.opengl.org/registry/ */\n#define GL_GLEXT_VERSION 85\n/* Function declaration macros - to move into glplatform.h */\n\n#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)\n#define WIN32_LEAN_AND_MEAN 1\n#include <windows.h>\n#endif\n\n#ifndef APIENTRY\n#define APIENTRY\n#endif\n#ifndef APIENTRYP\n#define APIENTRYP APIENTRY *\n#endif\n#ifndef GLAPI\n#define GLAPI extern\n#endif\n\n/*************************************************************/\n\n#ifndef GL_VERSION_1_2\n#define GL_UNSIGNED_BYTE_3_3_2            0x8032\n#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033\n#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034\n#define GL_UNSIGNED_INT_8_8_8_8           0x8035\n#define GL_UNSIGNED_INT_10_10_10_2        0x8036\n#define GL_TEXTURE_BINDING_3D             0x806A\n#define GL_PACK_SKIP_IMAGES               0x806B\n#define GL_PACK_IMAGE_HEIGHT              0x806C\n#define GL_UNPACK_SKIP_IMAGES             0x806D\n#define GL_UNPACK_IMAGE_HEIGHT            0x806E\n#define GL_TEXTURE_3D                     0x806F\n#define GL_PROXY_TEXTURE_3D               0x8070\n#define GL_TEXTURE_DEPTH                  0x8071\n#define GL_TEXTURE_WRAP_R                 0x8072\n#define GL_MAX_3D_TEXTURE_SIZE            0x8073\n#define GL_UNSIGNED_BYTE_2_3_3_REV        0x8362\n#define GL_UNSIGNED_SHORT_5_6_5           0x8363\n#define GL_UNSIGNED_SHORT_5_6_5_REV       0x8364\n#define GL_UNSIGNED_SHORT_4_4_4_4_REV     0x8365\n#define GL_UNSIGNED_SHORT_1_5_5_5_REV     0x8366\n#define GL_UNSIGNED_INT_8_8_8_8_REV       0x8367\n#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368\n#define GL_BGR                            0x80E0\n#define GL_BGRA                           0x80E1\n#define GL_MAX_ELEMENTS_VERTICES          0x80E8\n#define GL_MAX_ELEMENTS_INDICES           0x80E9\n#define GL_CLAMP_TO_EDGE                  0x812F\n#define GL_TEXTURE_MIN_LOD                0x813A\n#define GL_TEXTURE_MAX_LOD                0x813B\n#define GL_TEXTURE_BASE_LEVEL             0x813C\n#define GL_TEXTURE_MAX_LEVEL              0x813D\n#define GL_SMOOTH_POINT_SIZE_RANGE        0x0B12\n#define GL_SMOOTH_POINT_SIZE_GRANULARITY  0x0B13\n#define GL_SMOOTH_LINE_WIDTH_RANGE        0x0B22\n#define GL_SMOOTH_LINE_WIDTH_GRANULARITY  0x0B23\n#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E\n#define GL_RESCALE_NORMAL                 0x803A\n#define GL_LIGHT_MODEL_COLOR_CONTROL      0x81F8\n#define GL_SINGLE_COLOR                   0x81F9\n#define GL_SEPARATE_SPECULAR_COLOR        0x81FA\n#define GL_ALIASED_POINT_SIZE_RANGE       0x846D\n#endif\n\n#ifndef GL_ARB_imaging\n#define GL_CONSTANT_COLOR                 0x8001\n#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002\n#define GL_CONSTANT_ALPHA                 0x8003\n#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004\n#define GL_BLEND_COLOR                    0x8005\n#define GL_FUNC_ADD                       0x8006\n#define GL_MIN                            0x8007\n#define GL_MAX                            0x8008\n#define GL_BLEND_EQUATION                 0x8009\n#define GL_FUNC_SUBTRACT                  0x800A\n#define GL_FUNC_REVERSE_SUBTRACT          0x800B\n#define GL_CONVOLUTION_1D                 0x8010\n#define GL_CONVOLUTION_2D                 0x8011\n#define GL_SEPARABLE_2D                   0x8012\n#define GL_CONVOLUTION_BORDER_MODE        0x8013\n#define GL_CONVOLUTION_FILTER_SCALE       0x8014\n#define GL_CONVOLUTION_FILTER_BIAS        0x8015\n#define GL_REDUCE                         0x8016\n#define GL_CONVOLUTION_FORMAT             0x8017\n#define GL_CONVOLUTION_WIDTH              0x8018\n#define GL_CONVOLUTION_HEIGHT             0x8019\n#define GL_MAX_CONVOLUTION_WIDTH          0x801A\n#define GL_MAX_CONVOLUTION_HEIGHT         0x801B\n#define GL_POST_CONVOLUTION_RED_SCALE     0x801C\n#define GL_POST_CONVOLUTION_GREEN_SCALE   0x801D\n#define GL_POST_CONVOLUTION_BLUE_SCALE    0x801E\n#define GL_POST_CONVOLUTION_ALPHA_SCALE   0x801F\n#define GL_POST_CONVOLUTION_RED_BIAS      0x8020\n#define GL_POST_CONVOLUTION_GREEN_BIAS    0x8021\n#define GL_POST_CONVOLUTION_BLUE_BIAS     0x8022\n#define GL_POST_CONVOLUTION_ALPHA_BIAS    0x8023\n#define GL_HISTOGRAM                      0x8024\n#define GL_PROXY_HISTOGRAM                0x8025\n#define GL_HISTOGRAM_WIDTH                0x8026\n#define GL_HISTOGRAM_FORMAT               0x8027\n#define GL_HISTOGRAM_RED_SIZE             0x8028\n#define GL_HISTOGRAM_GREEN_SIZE           0x8029\n#define GL_HISTOGRAM_BLUE_SIZE            0x802A\n#define GL_HISTOGRAM_ALPHA_SIZE           0x802B\n#define GL_HISTOGRAM_LUMINANCE_SIZE       0x802C\n#define GL_HISTOGRAM_SINK                 0x802D\n#define GL_MINMAX                         0x802E\n#define GL_MINMAX_FORMAT                  0x802F\n#define GL_MINMAX_SINK                    0x8030\n#define GL_TABLE_TOO_LARGE                0x8031\n#define GL_COLOR_MATRIX                   0x80B1\n#define GL_COLOR_MATRIX_STACK_DEPTH       0x80B2\n#define GL_MAX_COLOR_MATRIX_STACK_DEPTH   0x80B3\n#define GL_POST_COLOR_MATRIX_RED_SCALE    0x80B4\n#define GL_POST_COLOR_MATRIX_GREEN_SCALE  0x80B5\n#define GL_POST_COLOR_MATRIX_BLUE_SCALE   0x80B6\n#define GL_POST_COLOR_MATRIX_ALPHA_SCALE  0x80B7\n#define GL_POST_COLOR_MATRIX_RED_BIAS     0x80B8\n#define GL_POST_COLOR_MATRIX_GREEN_BIAS   0x80B9\n#define GL_POST_COLOR_MATRIX_BLUE_BIAS    0x80BA\n#define GL_POST_COLOR_MATRIX_ALPHA_BIAS   0x80BB\n#define GL_COLOR_TABLE                    0x80D0\n#define GL_POST_CONVOLUTION_COLOR_TABLE   0x80D1\n#define GL_POST_COLOR_MATRIX_COLOR_TABLE  0x80D2\n#define GL_PROXY_COLOR_TABLE              0x80D3\n#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4\n#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5\n#define GL_COLOR_TABLE_SCALE              0x80D6\n#define GL_COLOR_TABLE_BIAS               0x80D7\n#define GL_COLOR_TABLE_FORMAT             0x80D8\n#define GL_COLOR_TABLE_WIDTH              0x80D9\n#define GL_COLOR_TABLE_RED_SIZE           0x80DA\n#define GL_COLOR_TABLE_GREEN_SIZE         0x80DB\n#define GL_COLOR_TABLE_BLUE_SIZE          0x80DC\n#define GL_COLOR_TABLE_ALPHA_SIZE         0x80DD\n#define GL_COLOR_TABLE_LUMINANCE_SIZE     0x80DE\n#define GL_COLOR_TABLE_INTENSITY_SIZE     0x80DF\n#define GL_CONSTANT_BORDER                0x8151\n#define GL_REPLICATE_BORDER               0x8153\n#define GL_CONVOLUTION_BORDER_COLOR       0x8154\n#endif\n\n#ifndef GL_VERSION_1_3\n#define GL_TEXTURE0                       0x84C0\n#define GL_TEXTURE1                       0x84C1\n#define GL_TEXTURE2                       0x84C2\n#define GL_TEXTURE3                       0x84C3\n#define GL_TEXTURE4                       0x84C4\n#define GL_TEXTURE5                       0x84C5\n#define GL_TEXTURE6                       0x84C6\n#define GL_TEXTURE7                       0x84C7\n#define GL_TEXTURE8                       0x84C8\n#define GL_TEXTURE9                       0x84C9\n#define GL_TEXTURE10                      0x84CA\n#define GL_TEXTURE11                      0x84CB\n#define GL_TEXTURE12                      0x84CC\n#define GL_TEXTURE13                      0x84CD\n#define GL_TEXTURE14                      0x84CE\n#define GL_TEXTURE15                      0x84CF\n#define GL_TEXTURE16                      0x84D0\n#define GL_TEXTURE17                      0x84D1\n#define GL_TEXTURE18                      0x84D2\n#define GL_TEXTURE19                      0x84D3\n#define GL_TEXTURE20                      0x84D4\n#define GL_TEXTURE21                      0x84D5\n#define GL_TEXTURE22                      0x84D6\n#define GL_TEXTURE23                      0x84D7\n#define GL_TEXTURE24                      0x84D8\n#define GL_TEXTURE25                      0x84D9\n#define GL_TEXTURE26                      0x84DA\n#define GL_TEXTURE27                      0x84DB\n#define GL_TEXTURE28                      0x84DC\n#define GL_TEXTURE29                      0x84DD\n#define GL_TEXTURE30                      0x84DE\n#define GL_TEXTURE31                      0x84DF\n#define GL_ACTIVE_TEXTURE                 0x84E0\n#define GL_MULTISAMPLE                    0x809D\n#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E\n#define GL_SAMPLE_ALPHA_TO_ONE            0x809F\n#define GL_SAMPLE_COVERAGE                0x80A0\n#define GL_SAMPLE_BUFFERS                 0x80A8\n#define GL_SAMPLES                        0x80A9\n#define GL_SAMPLE_COVERAGE_VALUE          0x80AA\n#define GL_SAMPLE_COVERAGE_INVERT         0x80AB\n#define GL_TEXTURE_CUBE_MAP               0x8513\n#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A\n#define GL_PROXY_TEXTURE_CUBE_MAP         0x851B\n#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C\n#define GL_COMPRESSED_RGB                 0x84ED\n#define GL_COMPRESSED_RGBA                0x84EE\n#define GL_TEXTURE_COMPRESSION_HINT       0x84EF\n#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE  0x86A0\n#define GL_TEXTURE_COMPRESSED             0x86A1\n#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2\n#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3\n#define GL_CLAMP_TO_BORDER                0x812D\n#define GL_CLIENT_ACTIVE_TEXTURE          0x84E1\n#define GL_MAX_TEXTURE_UNITS              0x84E2\n#define GL_TRANSPOSE_MODELVIEW_MATRIX     0x84E3\n#define GL_TRANSPOSE_PROJECTION_MATRIX    0x84E4\n#define GL_TRANSPOSE_TEXTURE_MATRIX       0x84E5\n#define GL_TRANSPOSE_COLOR_MATRIX         0x84E6\n#define GL_MULTISAMPLE_BIT                0x20000000\n#define GL_NORMAL_MAP                     0x8511\n#define GL_REFLECTION_MAP                 0x8512\n#define GL_COMPRESSED_ALPHA               0x84E9\n#define GL_COMPRESSED_LUMINANCE           0x84EA\n#define GL_COMPRESSED_LUMINANCE_ALPHA     0x84EB\n#define GL_COMPRESSED_INTENSITY           0x84EC\n#define GL_COMBINE                        0x8570\n#define GL_COMBINE_RGB                    0x8571\n#define GL_COMBINE_ALPHA                  0x8572\n#define GL_SOURCE0_RGB                    0x8580\n#define GL_SOURCE1_RGB                    0x8581\n#define GL_SOURCE2_RGB                    0x8582\n#define GL_SOURCE0_ALPHA                  0x8588\n#define GL_SOURCE1_ALPHA                  0x8589\n#define GL_SOURCE2_ALPHA                  0x858A\n#define GL_OPERAND0_RGB                   0x8590\n#define GL_OPERAND1_RGB                   0x8591\n#define GL_OPERAND2_RGB                   0x8592\n#define GL_OPERAND0_ALPHA                 0x8598\n#define GL_OPERAND1_ALPHA                 0x8599\n#define GL_OPERAND2_ALPHA                 0x859A\n#define GL_RGB_SCALE                      0x8573\n#define GL_ADD_SIGNED                     0x8574\n#define GL_INTERPOLATE                    0x8575\n#define GL_SUBTRACT                       0x84E7\n#define GL_CONSTANT                       0x8576\n#define GL_PRIMARY_COLOR                  0x8577\n#define GL_PREVIOUS                       0x8578\n#define GL_DOT3_RGB                       0x86AE\n#define GL_DOT3_RGBA                      0x86AF\n#endif\n\n#ifndef GL_VERSION_1_4\n#define GL_BLEND_DST_RGB                  0x80C8\n#define GL_BLEND_SRC_RGB                  0x80C9\n#define GL_BLEND_DST_ALPHA                0x80CA\n#define GL_BLEND_SRC_ALPHA                0x80CB\n#define GL_POINT_FADE_THRESHOLD_SIZE      0x8128\n#define GL_DEPTH_COMPONENT16              0x81A5\n#define GL_DEPTH_COMPONENT24              0x81A6\n#define GL_DEPTH_COMPONENT32              0x81A7\n#define GL_MIRRORED_REPEAT                0x8370\n#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD\n#define GL_TEXTURE_LOD_BIAS               0x8501\n#define GL_INCR_WRAP                      0x8507\n#define GL_DECR_WRAP                      0x8508\n#define GL_TEXTURE_DEPTH_SIZE             0x884A\n#define GL_TEXTURE_COMPARE_MODE           0x884C\n#define GL_TEXTURE_COMPARE_FUNC           0x884D\n#define GL_POINT_SIZE_MIN                 0x8126\n#define GL_POINT_SIZE_MAX                 0x8127\n#define GL_POINT_DISTANCE_ATTENUATION     0x8129\n#define GL_GENERATE_MIPMAP                0x8191\n#define GL_GENERATE_MIPMAP_HINT           0x8192\n#define GL_FOG_COORDINATE_SOURCE          0x8450\n#define GL_FOG_COORDINATE                 0x8451\n#define GL_FRAGMENT_DEPTH                 0x8452\n#define GL_CURRENT_FOG_COORDINATE         0x8453\n#define GL_FOG_COORDINATE_ARRAY_TYPE      0x8454\n#define GL_FOG_COORDINATE_ARRAY_STRIDE    0x8455\n#define GL_FOG_COORDINATE_ARRAY_POINTER   0x8456\n#define GL_FOG_COORDINATE_ARRAY           0x8457\n#define GL_COLOR_SUM                      0x8458\n#define GL_CURRENT_SECONDARY_COLOR        0x8459\n#define GL_SECONDARY_COLOR_ARRAY_SIZE     0x845A\n#define GL_SECONDARY_COLOR_ARRAY_TYPE     0x845B\n#define GL_SECONDARY_COLOR_ARRAY_STRIDE   0x845C\n#define GL_SECONDARY_COLOR_ARRAY_POINTER  0x845D\n#define GL_SECONDARY_COLOR_ARRAY          0x845E\n#define GL_TEXTURE_FILTER_CONTROL         0x8500\n#define GL_DEPTH_TEXTURE_MODE             0x884B\n#define GL_COMPARE_R_TO_TEXTURE           0x884E\n#endif\n\n#ifndef GL_VERSION_1_5\n#define GL_BUFFER_SIZE                    0x8764\n#define GL_BUFFER_USAGE                   0x8765\n#define GL_QUERY_COUNTER_BITS             0x8864\n#define GL_CURRENT_QUERY                  0x8865\n#define GL_QUERY_RESULT                   0x8866\n#define GL_QUERY_RESULT_AVAILABLE         0x8867\n#define GL_ARRAY_BUFFER                   0x8892\n#define GL_ELEMENT_ARRAY_BUFFER           0x8893\n#define GL_ARRAY_BUFFER_BINDING           0x8894\n#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895\n#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F\n#define GL_READ_ONLY                      0x88B8\n#define GL_WRITE_ONLY                     0x88B9\n#define GL_READ_WRITE                     0x88BA\n#define GL_BUFFER_ACCESS                  0x88BB\n#define GL_BUFFER_MAPPED                  0x88BC\n#define GL_BUFFER_MAP_POINTER             0x88BD\n#define GL_STREAM_DRAW                    0x88E0\n#define GL_STREAM_READ                    0x88E1\n#define GL_STREAM_COPY                    0x88E2\n#define GL_STATIC_DRAW                    0x88E4\n#define GL_STATIC_READ                    0x88E5\n#define GL_STATIC_COPY                    0x88E6\n#define GL_DYNAMIC_DRAW                   0x88E8\n#define GL_DYNAMIC_READ                   0x88E9\n#define GL_DYNAMIC_COPY                   0x88EA\n#define GL_SAMPLES_PASSED                 0x8914\n#define GL_SRC1_ALPHA                     0x8589\n#define GL_VERTEX_ARRAY_BUFFER_BINDING    0x8896\n#define GL_NORMAL_ARRAY_BUFFER_BINDING    0x8897\n#define GL_COLOR_ARRAY_BUFFER_BINDING     0x8898\n#define GL_INDEX_ARRAY_BUFFER_BINDING     0x8899\n#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A\n#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B\n#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C\n#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D\n#define GL_WEIGHT_ARRAY_BUFFER_BINDING    0x889E\n#define GL_FOG_COORD_SRC                  0x8450\n#define GL_FOG_COORD                      0x8451\n#define GL_CURRENT_FOG_COORD              0x8453\n#define GL_FOG_COORD_ARRAY_TYPE           0x8454\n#define GL_FOG_COORD_ARRAY_STRIDE         0x8455\n#define GL_FOG_COORD_ARRAY_POINTER        0x8456\n#define GL_FOG_COORD_ARRAY                0x8457\n#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D\n#define GL_SRC0_RGB                       0x8580\n#define GL_SRC1_RGB                       0x8581\n#define GL_SRC2_RGB                       0x8582\n#define GL_SRC0_ALPHA                     0x8588\n#define GL_SRC2_ALPHA                     0x858A\n#endif\n\n#ifndef GL_VERSION_2_0\n#define GL_BLEND_EQUATION_RGB             0x8009\n#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622\n#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623\n#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624\n#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625\n#define GL_CURRENT_VERTEX_ATTRIB          0x8626\n#define GL_VERTEX_PROGRAM_POINT_SIZE      0x8642\n#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645\n#define GL_STENCIL_BACK_FUNC              0x8800\n#define GL_STENCIL_BACK_FAIL              0x8801\n#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802\n#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803\n#define GL_MAX_DRAW_BUFFERS               0x8824\n#define GL_DRAW_BUFFER0                   0x8825\n#define GL_DRAW_BUFFER1                   0x8826\n#define GL_DRAW_BUFFER2                   0x8827\n#define GL_DRAW_BUFFER3                   0x8828\n#define GL_DRAW_BUFFER4                   0x8829\n#define GL_DRAW_BUFFER5                   0x882A\n#define GL_DRAW_BUFFER6                   0x882B\n#define GL_DRAW_BUFFER7                   0x882C\n#define GL_DRAW_BUFFER8                   0x882D\n#define GL_DRAW_BUFFER9                   0x882E\n#define GL_DRAW_BUFFER10                  0x882F\n#define GL_DRAW_BUFFER11                  0x8830\n#define GL_DRAW_BUFFER12                  0x8831\n#define GL_DRAW_BUFFER13                  0x8832\n#define GL_DRAW_BUFFER14                  0x8833\n#define GL_DRAW_BUFFER15                  0x8834\n#define GL_BLEND_EQUATION_ALPHA           0x883D\n#define GL_MAX_VERTEX_ATTRIBS             0x8869\n#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A\n#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872\n#define GL_FRAGMENT_SHADER                0x8B30\n#define GL_VERTEX_SHADER                  0x8B31\n#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49\n#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A\n#define GL_MAX_VARYING_FLOATS             0x8B4B\n#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C\n#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D\n#define GL_SHADER_TYPE                    0x8B4F\n#define GL_FLOAT_VEC2                     0x8B50\n#define GL_FLOAT_VEC3                     0x8B51\n#define GL_FLOAT_VEC4                     0x8B52\n#define GL_INT_VEC2                       0x8B53\n#define GL_INT_VEC3                       0x8B54\n#define GL_INT_VEC4                       0x8B55\n#define GL_BOOL                           0x8B56\n#define GL_BOOL_VEC2                      0x8B57\n#define GL_BOOL_VEC3                      0x8B58\n#define GL_BOOL_VEC4                      0x8B59\n#define GL_FLOAT_MAT2                     0x8B5A\n#define GL_FLOAT_MAT3                     0x8B5B\n#define GL_FLOAT_MAT4                     0x8B5C\n#define GL_SAMPLER_1D                     0x8B5D\n#define GL_SAMPLER_2D                     0x8B5E\n#define GL_SAMPLER_3D                     0x8B5F\n#define GL_SAMPLER_CUBE                   0x8B60\n#define GL_SAMPLER_1D_SHADOW              0x8B61\n#define GL_SAMPLER_2D_SHADOW              0x8B62\n#define GL_DELETE_STATUS                  0x8B80\n#define GL_COMPILE_STATUS                 0x8B81\n#define GL_LINK_STATUS                    0x8B82\n#define GL_VALIDATE_STATUS                0x8B83\n#define GL_INFO_LOG_LENGTH                0x8B84\n#define GL_ATTACHED_SHADERS               0x8B85\n#define GL_ACTIVE_UNIFORMS                0x8B86\n#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87\n#define GL_SHADER_SOURCE_LENGTH           0x8B88\n#define GL_ACTIVE_ATTRIBUTES              0x8B89\n#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A\n#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B\n#define GL_SHADING_LANGUAGE_VERSION       0x8B8C\n#define GL_CURRENT_PROGRAM                0x8B8D\n#define GL_POINT_SPRITE_COORD_ORIGIN      0x8CA0\n#define GL_LOWER_LEFT                     0x8CA1\n#define GL_UPPER_LEFT                     0x8CA2\n#define GL_STENCIL_BACK_REF               0x8CA3\n#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4\n#define GL_STENCIL_BACK_WRITEMASK         0x8CA5\n#define GL_VERTEX_PROGRAM_TWO_SIDE        0x8643\n#define GL_POINT_SPRITE                   0x8861\n#define GL_COORD_REPLACE                  0x8862\n#define GL_MAX_TEXTURE_COORDS             0x8871\n#endif\n\n#ifndef GL_VERSION_2_1\n#define GL_PIXEL_PACK_BUFFER              0x88EB\n#define GL_PIXEL_UNPACK_BUFFER            0x88EC\n#define GL_PIXEL_PACK_BUFFER_BINDING      0x88ED\n#define GL_PIXEL_UNPACK_BUFFER_BINDING    0x88EF\n#define GL_FLOAT_MAT2x3                   0x8B65\n#define GL_FLOAT_MAT2x4                   0x8B66\n#define GL_FLOAT_MAT3x2                   0x8B67\n#define GL_FLOAT_MAT3x4                   0x8B68\n#define GL_FLOAT_MAT4x2                   0x8B69\n#define GL_FLOAT_MAT4x3                   0x8B6A\n#define GL_SRGB                           0x8C40\n#define GL_SRGB8                          0x8C41\n#define GL_SRGB_ALPHA                     0x8C42\n#define GL_SRGB8_ALPHA8                   0x8C43\n#define GL_COMPRESSED_SRGB                0x8C48\n#define GL_COMPRESSED_SRGB_ALPHA          0x8C49\n#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F\n#define GL_SLUMINANCE_ALPHA               0x8C44\n#define GL_SLUMINANCE8_ALPHA8             0x8C45\n#define GL_SLUMINANCE                     0x8C46\n#define GL_SLUMINANCE8                    0x8C47\n#define GL_COMPRESSED_SLUMINANCE          0x8C4A\n#define GL_COMPRESSED_SLUMINANCE_ALPHA    0x8C4B\n#endif\n\n#ifndef GL_VERSION_3_0\n#define GL_COMPARE_REF_TO_TEXTURE         0x884E\n#define GL_CLIP_DISTANCE0                 0x3000\n#define GL_CLIP_DISTANCE1                 0x3001\n#define GL_CLIP_DISTANCE2                 0x3002\n#define GL_CLIP_DISTANCE3                 0x3003\n#define GL_CLIP_DISTANCE4                 0x3004\n#define GL_CLIP_DISTANCE5                 0x3005\n#define GL_CLIP_DISTANCE6                 0x3006\n#define GL_CLIP_DISTANCE7                 0x3007\n#define GL_MAX_CLIP_DISTANCES             0x0D32\n#define GL_MAJOR_VERSION                  0x821B\n#define GL_MINOR_VERSION                  0x821C\n#define GL_NUM_EXTENSIONS                 0x821D\n#define GL_CONTEXT_FLAGS                  0x821E\n#define GL_COMPRESSED_RED                 0x8225\n#define GL_COMPRESSED_RG                  0x8226\n#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001\n#define GL_RGBA32F                        0x8814\n#define GL_RGB32F                         0x8815\n#define GL_RGBA16F                        0x881A\n#define GL_RGB16F                         0x881B\n#define GL_VERTEX_ATTRIB_ARRAY_INTEGER    0x88FD\n#define GL_MAX_ARRAY_TEXTURE_LAYERS       0x88FF\n#define GL_MIN_PROGRAM_TEXEL_OFFSET       0x8904\n#define GL_MAX_PROGRAM_TEXEL_OFFSET       0x8905\n#define GL_CLAMP_READ_COLOR               0x891C\n#define GL_FIXED_ONLY                     0x891D\n#define GL_MAX_VARYING_COMPONENTS         0x8B4B\n#define GL_TEXTURE_1D_ARRAY               0x8C18\n#define GL_PROXY_TEXTURE_1D_ARRAY         0x8C19\n#define GL_TEXTURE_2D_ARRAY               0x8C1A\n#define GL_PROXY_TEXTURE_2D_ARRAY         0x8C1B\n#define GL_TEXTURE_BINDING_1D_ARRAY       0x8C1C\n#define GL_TEXTURE_BINDING_2D_ARRAY       0x8C1D\n#define GL_R11F_G11F_B10F                 0x8C3A\n#define GL_UNSIGNED_INT_10F_11F_11F_REV   0x8C3B\n#define GL_RGB9_E5                        0x8C3D\n#define GL_UNSIGNED_INT_5_9_9_9_REV       0x8C3E\n#define GL_TEXTURE_SHARED_SIZE            0x8C3F\n#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76\n#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80\n#define GL_TRANSFORM_FEEDBACK_VARYINGS    0x8C83\n#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84\n#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85\n#define GL_PRIMITIVES_GENERATED           0x8C87\n#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88\n#define GL_RASTERIZER_DISCARD             0x8C89\n#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B\n#define GL_INTERLEAVED_ATTRIBS            0x8C8C\n#define GL_SEPARATE_ATTRIBS               0x8C8D\n#define GL_TRANSFORM_FEEDBACK_BUFFER      0x8C8E\n#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F\n#define GL_RGBA32UI                       0x8D70\n#define GL_RGB32UI                        0x8D71\n#define GL_RGBA16UI                       0x8D76\n#define GL_RGB16UI                        0x8D77\n#define GL_RGBA8UI                        0x8D7C\n#define GL_RGB8UI                         0x8D7D\n#define GL_RGBA32I                        0x8D82\n#define GL_RGB32I                         0x8D83\n#define GL_RGBA16I                        0x8D88\n#define GL_RGB16I                         0x8D89\n#define GL_RGBA8I                         0x8D8E\n#define GL_RGB8I                          0x8D8F\n#define GL_RED_INTEGER                    0x8D94\n#define GL_GREEN_INTEGER                  0x8D95\n#define GL_BLUE_INTEGER                   0x8D96\n#define GL_RGB_INTEGER                    0x8D98\n#define GL_RGBA_INTEGER                   0x8D99\n#define GL_BGR_INTEGER                    0x8D9A\n#define GL_BGRA_INTEGER                   0x8D9B\n#define GL_SAMPLER_1D_ARRAY               0x8DC0\n#define GL_SAMPLER_2D_ARRAY               0x8DC1\n#define GL_SAMPLER_1D_ARRAY_SHADOW        0x8DC3\n#define GL_SAMPLER_2D_ARRAY_SHADOW        0x8DC4\n#define GL_SAMPLER_CUBE_SHADOW            0x8DC5\n#define GL_UNSIGNED_INT_VEC2              0x8DC6\n#define GL_UNSIGNED_INT_VEC3              0x8DC7\n#define GL_UNSIGNED_INT_VEC4              0x8DC8\n#define GL_INT_SAMPLER_1D                 0x8DC9\n#define GL_INT_SAMPLER_2D                 0x8DCA\n#define GL_INT_SAMPLER_3D                 0x8DCB\n#define GL_INT_SAMPLER_CUBE               0x8DCC\n#define GL_INT_SAMPLER_1D_ARRAY           0x8DCE\n#define GL_INT_SAMPLER_2D_ARRAY           0x8DCF\n#define GL_UNSIGNED_INT_SAMPLER_1D        0x8DD1\n#define GL_UNSIGNED_INT_SAMPLER_2D        0x8DD2\n#define GL_UNSIGNED_INT_SAMPLER_3D        0x8DD3\n#define GL_UNSIGNED_INT_SAMPLER_CUBE      0x8DD4\n#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY  0x8DD6\n#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY  0x8DD7\n#define GL_QUERY_WAIT                     0x8E13\n#define GL_QUERY_NO_WAIT                  0x8E14\n#define GL_QUERY_BY_REGION_WAIT           0x8E15\n#define GL_QUERY_BY_REGION_NO_WAIT        0x8E16\n#define GL_BUFFER_ACCESS_FLAGS            0x911F\n#define GL_BUFFER_MAP_LENGTH              0x9120\n#define GL_BUFFER_MAP_OFFSET              0x9121\n/* Reuse tokens from ARB_depth_buffer_float */\n/* reuse GL_DEPTH_COMPONENT32F */\n/* reuse GL_DEPTH32F_STENCIL8 */\n/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */\n/* Reuse tokens from ARB_framebuffer_object */\n/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */\n/* reuse GL_FRAMEBUFFER_DEFAULT */\n/* reuse GL_FRAMEBUFFER_UNDEFINED */\n/* reuse GL_DEPTH_STENCIL_ATTACHMENT */\n/* reuse GL_INDEX */\n/* reuse GL_MAX_RENDERBUFFER_SIZE */\n/* reuse GL_DEPTH_STENCIL */\n/* reuse GL_UNSIGNED_INT_24_8 */\n/* reuse GL_DEPTH24_STENCIL8 */\n/* reuse GL_TEXTURE_STENCIL_SIZE */\n/* reuse GL_TEXTURE_RED_TYPE */\n/* reuse GL_TEXTURE_GREEN_TYPE */\n/* reuse GL_TEXTURE_BLUE_TYPE */\n/* reuse GL_TEXTURE_ALPHA_TYPE */\n/* reuse GL_TEXTURE_DEPTH_TYPE */\n/* reuse GL_UNSIGNED_NORMALIZED */\n/* reuse GL_FRAMEBUFFER_BINDING */\n/* reuse GL_DRAW_FRAMEBUFFER_BINDING */\n/* reuse GL_RENDERBUFFER_BINDING */\n/* reuse GL_READ_FRAMEBUFFER */\n/* reuse GL_DRAW_FRAMEBUFFER */\n/* reuse GL_READ_FRAMEBUFFER_BINDING */\n/* reuse GL_RENDERBUFFER_SAMPLES */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */\n/* reuse GL_FRAMEBUFFER_COMPLETE */\n/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */\n/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */\n/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */\n/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */\n/* reuse GL_FRAMEBUFFER_UNSUPPORTED */\n/* reuse GL_MAX_COLOR_ATTACHMENTS */\n/* reuse GL_COLOR_ATTACHMENT0 */\n/* reuse GL_COLOR_ATTACHMENT1 */\n/* reuse GL_COLOR_ATTACHMENT2 */\n/* reuse GL_COLOR_ATTACHMENT3 */\n/* reuse GL_COLOR_ATTACHMENT4 */\n/* reuse GL_COLOR_ATTACHMENT5 */\n/* reuse GL_COLOR_ATTACHMENT6 */\n/* reuse GL_COLOR_ATTACHMENT7 */\n/* reuse GL_COLOR_ATTACHMENT8 */\n/* reuse GL_COLOR_ATTACHMENT9 */\n/* reuse GL_COLOR_ATTACHMENT10 */\n/* reuse GL_COLOR_ATTACHMENT11 */\n/* reuse GL_COLOR_ATTACHMENT12 */\n/* reuse GL_COLOR_ATTACHMENT13 */\n/* reuse GL_COLOR_ATTACHMENT14 */\n/* reuse GL_COLOR_ATTACHMENT15 */\n/* reuse GL_DEPTH_ATTACHMENT */\n/* reuse GL_STENCIL_ATTACHMENT */\n/* reuse GL_FRAMEBUFFER */\n/* reuse GL_RENDERBUFFER */\n/* reuse GL_RENDERBUFFER_WIDTH */\n/* reuse GL_RENDERBUFFER_HEIGHT */\n/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */\n/* reuse GL_STENCIL_INDEX1 */\n/* reuse GL_STENCIL_INDEX4 */\n/* reuse GL_STENCIL_INDEX8 */\n/* reuse GL_STENCIL_INDEX16 */\n/* reuse GL_RENDERBUFFER_RED_SIZE */\n/* reuse GL_RENDERBUFFER_GREEN_SIZE */\n/* reuse GL_RENDERBUFFER_BLUE_SIZE */\n/* reuse GL_RENDERBUFFER_ALPHA_SIZE */\n/* reuse GL_RENDERBUFFER_DEPTH_SIZE */\n/* reuse GL_RENDERBUFFER_STENCIL_SIZE */\n/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */\n/* reuse GL_MAX_SAMPLES */\n/* Reuse tokens from ARB_framebuffer_sRGB */\n/* reuse GL_FRAMEBUFFER_SRGB */\n/* Reuse tokens from ARB_half_float_vertex */\n/* reuse GL_HALF_FLOAT */\n/* Reuse tokens from ARB_map_buffer_range */\n/* reuse GL_MAP_READ_BIT */\n/* reuse GL_MAP_WRITE_BIT */\n/* reuse GL_MAP_INVALIDATE_RANGE_BIT */\n/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */\n/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */\n/* reuse GL_MAP_UNSYNCHRONIZED_BIT */\n/* Reuse tokens from ARB_texture_compression_rgtc */\n/* reuse GL_COMPRESSED_RED_RGTC1 */\n/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */\n/* reuse GL_COMPRESSED_RG_RGTC2 */\n/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */\n/* Reuse tokens from ARB_texture_rg */\n/* reuse GL_RG */\n/* reuse GL_RG_INTEGER */\n/* reuse GL_R8 */\n/* reuse GL_R16 */\n/* reuse GL_RG8 */\n/* reuse GL_RG16 */\n/* reuse GL_R16F */\n/* reuse GL_R32F */\n/* reuse GL_RG16F */\n/* reuse GL_RG32F */\n/* reuse GL_R8I */\n/* reuse GL_R8UI */\n/* reuse GL_R16I */\n/* reuse GL_R16UI */\n/* reuse GL_R32I */\n/* reuse GL_R32UI */\n/* reuse GL_RG8I */\n/* reuse GL_RG8UI */\n/* reuse GL_RG16I */\n/* reuse GL_RG16UI */\n/* reuse GL_RG32I */\n/* reuse GL_RG32UI */\n/* Reuse tokens from ARB_vertex_array_object */\n/* reuse GL_VERTEX_ARRAY_BINDING */\n#define GL_CLAMP_VERTEX_COLOR             0x891A\n#define GL_CLAMP_FRAGMENT_COLOR           0x891B\n#define GL_ALPHA_INTEGER                  0x8D97\n/* Reuse tokens from ARB_framebuffer_object */\n/* reuse GL_TEXTURE_LUMINANCE_TYPE */\n/* reuse GL_TEXTURE_INTENSITY_TYPE */\n#endif\n\n#ifndef GL_VERSION_3_1\n#define GL_SAMPLER_2D_RECT                0x8B63\n#define GL_SAMPLER_2D_RECT_SHADOW         0x8B64\n#define GL_SAMPLER_BUFFER                 0x8DC2\n#define GL_INT_SAMPLER_2D_RECT            0x8DCD\n#define GL_INT_SAMPLER_BUFFER             0x8DD0\n#define GL_UNSIGNED_INT_SAMPLER_2D_RECT   0x8DD5\n#define GL_UNSIGNED_INT_SAMPLER_BUFFER    0x8DD8\n#define GL_TEXTURE_BUFFER                 0x8C2A\n#define GL_MAX_TEXTURE_BUFFER_SIZE        0x8C2B\n#define GL_TEXTURE_BINDING_BUFFER         0x8C2C\n#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D\n#define GL_TEXTURE_RECTANGLE              0x84F5\n#define GL_TEXTURE_BINDING_RECTANGLE      0x84F6\n#define GL_PROXY_TEXTURE_RECTANGLE        0x84F7\n#define GL_MAX_RECTANGLE_TEXTURE_SIZE     0x84F8\n#define GL_RED_SNORM                      0x8F90\n#define GL_RG_SNORM                       0x8F91\n#define GL_RGB_SNORM                      0x8F92\n#define GL_RGBA_SNORM                     0x8F93\n#define GL_R8_SNORM                       0x8F94\n#define GL_RG8_SNORM                      0x8F95\n#define GL_RGB8_SNORM                     0x8F96\n#define GL_RGBA8_SNORM                    0x8F97\n#define GL_R16_SNORM                      0x8F98\n#define GL_RG16_SNORM                     0x8F99\n#define GL_RGB16_SNORM                    0x8F9A\n#define GL_RGBA16_SNORM                   0x8F9B\n#define GL_SIGNED_NORMALIZED              0x8F9C\n#define GL_PRIMITIVE_RESTART              0x8F9D\n#define GL_PRIMITIVE_RESTART_INDEX        0x8F9E\n/* Reuse tokens from ARB_copy_buffer */\n/* reuse GL_COPY_READ_BUFFER */\n/* reuse GL_COPY_WRITE_BUFFER */\n/* Reuse tokens from ARB_draw_instanced (none) */\n/* Reuse tokens from ARB_uniform_buffer_object */\n/* reuse GL_UNIFORM_BUFFER */\n/* reuse GL_UNIFORM_BUFFER_BINDING */\n/* reuse GL_UNIFORM_BUFFER_START */\n/* reuse GL_UNIFORM_BUFFER_SIZE */\n/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */\n/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */\n/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */\n/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */\n/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */\n/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */\n/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */\n/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */\n/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */\n/* reuse GL_ACTIVE_UNIFORM_BLOCKS */\n/* reuse GL_UNIFORM_TYPE */\n/* reuse GL_UNIFORM_SIZE */\n/* reuse GL_UNIFORM_NAME_LENGTH */\n/* reuse GL_UNIFORM_BLOCK_INDEX */\n/* reuse GL_UNIFORM_OFFSET */\n/* reuse GL_UNIFORM_ARRAY_STRIDE */\n/* reuse GL_UNIFORM_MATRIX_STRIDE */\n/* reuse GL_UNIFORM_IS_ROW_MAJOR */\n/* reuse GL_UNIFORM_BLOCK_BINDING */\n/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */\n/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */\n/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */\n/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */\n/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */\n/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */\n/* reuse GL_INVALID_INDEX */\n#endif\n\n#ifndef GL_VERSION_3_2\n#define GL_CONTEXT_CORE_PROFILE_BIT       0x00000001\n#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002\n#define GL_LINES_ADJACENCY                0x000A\n#define GL_LINE_STRIP_ADJACENCY           0x000B\n#define GL_TRIANGLES_ADJACENCY            0x000C\n#define GL_TRIANGLE_STRIP_ADJACENCY       0x000D\n#define GL_PROGRAM_POINT_SIZE             0x8642\n#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29\n#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8\n#define GL_GEOMETRY_SHADER                0x8DD9\n#define GL_GEOMETRY_VERTICES_OUT          0x8916\n#define GL_GEOMETRY_INPUT_TYPE            0x8917\n#define GL_GEOMETRY_OUTPUT_TYPE           0x8918\n#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF\n#define GL_MAX_GEOMETRY_OUTPUT_VERTICES   0x8DE0\n#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1\n#define GL_MAX_VERTEX_OUTPUT_COMPONENTS   0x9122\n#define GL_MAX_GEOMETRY_INPUT_COMPONENTS  0x9123\n#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124\n#define GL_MAX_FRAGMENT_INPUT_COMPONENTS  0x9125\n#define GL_CONTEXT_PROFILE_MASK           0x9126\n/* reuse GL_MAX_VARYING_COMPONENTS */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */\n/* Reuse tokens from ARB_depth_clamp */\n/* reuse GL_DEPTH_CLAMP */\n/* Reuse tokens from ARB_draw_elements_base_vertex (none) */\n/* Reuse tokens from ARB_fragment_coord_conventions (none) */\n/* Reuse tokens from ARB_provoking_vertex */\n/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */\n/* reuse GL_FIRST_VERTEX_CONVENTION */\n/* reuse GL_LAST_VERTEX_CONVENTION */\n/* reuse GL_PROVOKING_VERTEX */\n/* Reuse tokens from ARB_seamless_cube_map */\n/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */\n/* Reuse tokens from ARB_sync */\n/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */\n/* reuse GL_OBJECT_TYPE */\n/* reuse GL_SYNC_CONDITION */\n/* reuse GL_SYNC_STATUS */\n/* reuse GL_SYNC_FLAGS */\n/* reuse GL_SYNC_FENCE */\n/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */\n/* reuse GL_UNSIGNALED */\n/* reuse GL_SIGNALED */\n/* reuse GL_ALREADY_SIGNALED */\n/* reuse GL_TIMEOUT_EXPIRED */\n/* reuse GL_CONDITION_SATISFIED */\n/* reuse GL_WAIT_FAILED */\n/* reuse GL_TIMEOUT_IGNORED */\n/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */\n/* reuse GL_TIMEOUT_IGNORED */\n/* Reuse tokens from ARB_texture_multisample */\n/* reuse GL_SAMPLE_POSITION */\n/* reuse GL_SAMPLE_MASK */\n/* reuse GL_SAMPLE_MASK_VALUE */\n/* reuse GL_MAX_SAMPLE_MASK_WORDS */\n/* reuse GL_TEXTURE_2D_MULTISAMPLE */\n/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */\n/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */\n/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_TEXTURE_SAMPLES */\n/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */\n/* reuse GL_SAMPLER_2D_MULTISAMPLE */\n/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */\n/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */\n/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */\n/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */\n/* reuse GL_MAX_INTEGER_SAMPLES */\n/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */\n#endif\n\n#ifndef GL_VERSION_3_3\n#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR    0x88FE\n/* Reuse tokens from ARB_blend_func_extended */\n/* reuse GL_SRC1_COLOR */\n/* reuse GL_ONE_MINUS_SRC1_COLOR */\n/* reuse GL_ONE_MINUS_SRC1_ALPHA */\n/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */\n/* Reuse tokens from ARB_explicit_attrib_location (none) */\n/* Reuse tokens from ARB_occlusion_query2 */\n/* reuse GL_ANY_SAMPLES_PASSED */\n/* Reuse tokens from ARB_sampler_objects */\n/* reuse GL_SAMPLER_BINDING */\n/* Reuse tokens from ARB_shader_bit_encoding (none) */\n/* Reuse tokens from ARB_texture_rgb10_a2ui */\n/* reuse GL_RGB10_A2UI */\n/* Reuse tokens from ARB_texture_swizzle */\n/* reuse GL_TEXTURE_SWIZZLE_R */\n/* reuse GL_TEXTURE_SWIZZLE_G */\n/* reuse GL_TEXTURE_SWIZZLE_B */\n/* reuse GL_TEXTURE_SWIZZLE_A */\n/* reuse GL_TEXTURE_SWIZZLE_RGBA */\n/* Reuse tokens from ARB_timer_query */\n/* reuse GL_TIME_ELAPSED */\n/* reuse GL_TIMESTAMP */\n/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */\n/* reuse GL_INT_2_10_10_10_REV */\n#endif\n\n#ifndef GL_VERSION_4_0\n#define GL_SAMPLE_SHADING                 0x8C36\n#define GL_MIN_SAMPLE_SHADING_VALUE       0x8C37\n#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F\n#define GL_TEXTURE_CUBE_MAP_ARRAY         0x9009\n#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A\n#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY   0x900B\n#define GL_SAMPLER_CUBE_MAP_ARRAY         0x900C\n#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW  0x900D\n#define GL_INT_SAMPLER_CUBE_MAP_ARRAY     0x900E\n#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F\n/* Reuse tokens from ARB_texture_query_lod (none) */\n/* Reuse tokens from ARB_draw_buffers_blend (none) */\n/* Reuse tokens from ARB_draw_indirect */\n/* reuse GL_DRAW_INDIRECT_BUFFER */\n/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */\n/* Reuse tokens from ARB_gpu_shader5 */\n/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */\n/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */\n/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */\n/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */\n/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */\n/* reuse GL_MAX_VERTEX_STREAMS */\n/* Reuse tokens from ARB_gpu_shader_fp64 */\n/* reuse GL_DOUBLE_VEC2 */\n/* reuse GL_DOUBLE_VEC3 */\n/* reuse GL_DOUBLE_VEC4 */\n/* reuse GL_DOUBLE_MAT2 */\n/* reuse GL_DOUBLE_MAT3 */\n/* reuse GL_DOUBLE_MAT4 */\n/* reuse GL_DOUBLE_MAT2x3 */\n/* reuse GL_DOUBLE_MAT2x4 */\n/* reuse GL_DOUBLE_MAT3x2 */\n/* reuse GL_DOUBLE_MAT3x4 */\n/* reuse GL_DOUBLE_MAT4x2 */\n/* reuse GL_DOUBLE_MAT4x3 */\n/* Reuse tokens from ARB_shader_subroutine */\n/* reuse GL_ACTIVE_SUBROUTINES */\n/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */\n/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */\n/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */\n/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */\n/* reuse GL_MAX_SUBROUTINES */\n/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */\n/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */\n/* reuse GL_COMPATIBLE_SUBROUTINES */\n/* Reuse tokens from ARB_tessellation_shader */\n/* reuse GL_PATCHES */\n/* reuse GL_PATCH_VERTICES */\n/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */\n/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */\n/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */\n/* reuse GL_TESS_GEN_MODE */\n/* reuse GL_TESS_GEN_SPACING */\n/* reuse GL_TESS_GEN_VERTEX_ORDER */\n/* reuse GL_TESS_GEN_POINT_MODE */\n/* reuse GL_ISOLINES */\n/* reuse GL_FRACTIONAL_ODD */\n/* reuse GL_FRACTIONAL_EVEN */\n/* reuse GL_MAX_PATCH_VERTICES */\n/* reuse GL_MAX_TESS_GEN_LEVEL */\n/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */\n/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */\n/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */\n/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */\n/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */\n/* reuse GL_MAX_TESS_PATCH_COMPONENTS */\n/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */\n/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */\n/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */\n/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */\n/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */\n/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */\n/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */\n/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */\n/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */\n/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */\n/* reuse GL_TESS_EVALUATION_SHADER */\n/* reuse GL_TESS_CONTROL_SHADER */\n/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */\n/* Reuse tokens from ARB_transform_feedback2 */\n/* reuse GL_TRANSFORM_FEEDBACK */\n/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */\n/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */\n/* reuse GL_TRANSFORM_FEEDBACK_BINDING */\n/* Reuse tokens from ARB_transform_feedback3 */\n/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */\n/* reuse GL_MAX_VERTEX_STREAMS */\n#endif\n\n#ifndef GL_VERSION_4_1\n/* Reuse tokens from ARB_ES2_compatibility */\n/* reuse GL_FIXED */\n/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */\n/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */\n/* reuse GL_LOW_FLOAT */\n/* reuse GL_MEDIUM_FLOAT */\n/* reuse GL_HIGH_FLOAT */\n/* reuse GL_LOW_INT */\n/* reuse GL_MEDIUM_INT */\n/* reuse GL_HIGH_INT */\n/* reuse GL_SHADER_COMPILER */\n/* reuse GL_SHADER_BINARY_FORMATS */\n/* reuse GL_NUM_SHADER_BINARY_FORMATS */\n/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */\n/* reuse GL_MAX_VARYING_VECTORS */\n/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */\n/* reuse GL_RGB565 */\n/* Reuse tokens from ARB_get_program_binary */\n/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */\n/* reuse GL_PROGRAM_BINARY_LENGTH */\n/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */\n/* reuse GL_PROGRAM_BINARY_FORMATS */\n/* Reuse tokens from ARB_separate_shader_objects */\n/* reuse GL_VERTEX_SHADER_BIT */\n/* reuse GL_FRAGMENT_SHADER_BIT */\n/* reuse GL_GEOMETRY_SHADER_BIT */\n/* reuse GL_TESS_CONTROL_SHADER_BIT */\n/* reuse GL_TESS_EVALUATION_SHADER_BIT */\n/* reuse GL_ALL_SHADER_BITS */\n/* reuse GL_PROGRAM_SEPARABLE */\n/* reuse GL_ACTIVE_PROGRAM */\n/* reuse GL_PROGRAM_PIPELINE_BINDING */\n/* Reuse tokens from ARB_shader_precision (none) */\n/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */\n/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */\n/* reuse GL_MAX_VIEWPORTS */\n/* reuse GL_VIEWPORT_SUBPIXEL_BITS */\n/* reuse GL_VIEWPORT_BOUNDS_RANGE */\n/* reuse GL_LAYER_PROVOKING_VERTEX */\n/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */\n/* reuse GL_UNDEFINED_VERTEX */\n#endif\n\n#ifndef GL_VERSION_4_2\n/* Reuse tokens from ARB_base_instance (none) */\n/* Reuse tokens from ARB_shading_language_420pack (none) */\n/* Reuse tokens from ARB_transform_feedback_instanced (none) */\n/* Reuse tokens from ARB_compressed_texture_pixel_storage */\n/* reuse GL_UNPACK_COMPRESSED_BLOCK_WIDTH */\n/* reuse GL_UNPACK_COMPRESSED_BLOCK_HEIGHT */\n/* reuse GL_UNPACK_COMPRESSED_BLOCK_DEPTH */\n/* reuse GL_UNPACK_COMPRESSED_BLOCK_SIZE */\n/* reuse GL_PACK_COMPRESSED_BLOCK_WIDTH */\n/* reuse GL_PACK_COMPRESSED_BLOCK_HEIGHT */\n/* reuse GL_PACK_COMPRESSED_BLOCK_DEPTH */\n/* reuse GL_PACK_COMPRESSED_BLOCK_SIZE */\n/* Reuse tokens from ARB_conservative_depth (none) */\n/* Reuse tokens from ARB_internalformat_query */\n/* reuse GL_NUM_SAMPLE_COUNTS */\n/* Reuse tokens from ARB_map_buffer_alignment */\n/* reuse GL_MIN_MAP_BUFFER_ALIGNMENT */\n/* Reuse tokens from ARB_shader_atomic_counters */\n/* reuse GL_ATOMIC_COUNTER_BUFFER */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_BINDING */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_START */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_SIZE */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER */\n/* reuse GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS */\n/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS */\n/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS */\n/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS */\n/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS */\n/* reuse GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS */\n/* reuse GL_MAX_VERTEX_ATOMIC_COUNTERS */\n/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS */\n/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS */\n/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTERS */\n/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTERS */\n/* reuse GL_MAX_COMBINED_ATOMIC_COUNTERS */\n/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE */\n/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS */\n/* reuse GL_ACTIVE_ATOMIC_COUNTER_BUFFERS */\n/* reuse GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX */\n/* reuse GL_UNSIGNED_INT_ATOMIC_COUNTER */\n/* Reuse tokens from ARB_shader_image_load_store */\n/* reuse GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT */\n/* reuse GL_ELEMENT_ARRAY_BARRIER_BIT */\n/* reuse GL_UNIFORM_BARRIER_BIT */\n/* reuse GL_TEXTURE_FETCH_BARRIER_BIT */\n/* reuse GL_SHADER_IMAGE_ACCESS_BARRIER_BIT */\n/* reuse GL_COMMAND_BARRIER_BIT */\n/* reuse GL_PIXEL_BUFFER_BARRIER_BIT */\n/* reuse GL_TEXTURE_UPDATE_BARRIER_BIT */\n/* reuse GL_BUFFER_UPDATE_BARRIER_BIT */\n/* reuse GL_FRAMEBUFFER_BARRIER_BIT */\n/* reuse GL_TRANSFORM_FEEDBACK_BARRIER_BIT */\n/* reuse GL_ATOMIC_COUNTER_BARRIER_BIT */\n/* reuse GL_ALL_BARRIER_BITS */\n/* reuse GL_MAX_IMAGE_UNITS */\n/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */\n/* reuse GL_IMAGE_BINDING_NAME */\n/* reuse GL_IMAGE_BINDING_LEVEL */\n/* reuse GL_IMAGE_BINDING_LAYERED */\n/* reuse GL_IMAGE_BINDING_LAYER */\n/* reuse GL_IMAGE_BINDING_ACCESS */\n/* reuse GL_IMAGE_1D */\n/* reuse GL_IMAGE_2D */\n/* reuse GL_IMAGE_3D */\n/* reuse GL_IMAGE_2D_RECT */\n/* reuse GL_IMAGE_CUBE */\n/* reuse GL_IMAGE_BUFFER */\n/* reuse GL_IMAGE_1D_ARRAY */\n/* reuse GL_IMAGE_2D_ARRAY */\n/* reuse GL_IMAGE_CUBE_MAP_ARRAY */\n/* reuse GL_IMAGE_2D_MULTISAMPLE */\n/* reuse GL_IMAGE_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_INT_IMAGE_1D */\n/* reuse GL_INT_IMAGE_2D */\n/* reuse GL_INT_IMAGE_3D */\n/* reuse GL_INT_IMAGE_2D_RECT */\n/* reuse GL_INT_IMAGE_CUBE */\n/* reuse GL_INT_IMAGE_BUFFER */\n/* reuse GL_INT_IMAGE_1D_ARRAY */\n/* reuse GL_INT_IMAGE_2D_ARRAY */\n/* reuse GL_INT_IMAGE_CUBE_MAP_ARRAY */\n/* reuse GL_INT_IMAGE_2D_MULTISAMPLE */\n/* reuse GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_UNSIGNED_INT_IMAGE_1D */\n/* reuse GL_UNSIGNED_INT_IMAGE_2D */\n/* reuse GL_UNSIGNED_INT_IMAGE_3D */\n/* reuse GL_UNSIGNED_INT_IMAGE_2D_RECT */\n/* reuse GL_UNSIGNED_INT_IMAGE_CUBE */\n/* reuse GL_UNSIGNED_INT_IMAGE_BUFFER */\n/* reuse GL_UNSIGNED_INT_IMAGE_1D_ARRAY */\n/* reuse GL_UNSIGNED_INT_IMAGE_2D_ARRAY */\n/* reuse GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY */\n/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE */\n/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_MAX_IMAGE_SAMPLES */\n/* reuse GL_IMAGE_BINDING_FORMAT */\n/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */\n/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE */\n/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS */\n/* reuse GL_MAX_VERTEX_IMAGE_UNIFORMS */\n/* reuse GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS */\n/* reuse GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS */\n/* reuse GL_MAX_GEOMETRY_IMAGE_UNIFORMS */\n/* reuse GL_MAX_FRAGMENT_IMAGE_UNIFORMS */\n/* reuse GL_MAX_COMBINED_IMAGE_UNIFORMS */\n/* Reuse tokens from ARB_shading_language_packing (none) */\n/* Reuse tokens from ARB_texture_storage */\n/* reuse GL_TEXTURE_IMMUTABLE_FORMAT */\n#endif\n\n#ifndef GL_VERSION_4_3\n#define GL_NUM_SHADING_LANGUAGE_VERSIONS  0x82E9\n#define GL_VERTEX_ATTRIB_ARRAY_LONG       0x874E\n/* Reuse tokens from ARB_arrays_of_arrays (none, GLSL only) */\n/* Reuse tokens from ARB_fragment_layer_viewport (none, GLSL only) */\n/* Reuse tokens from ARB_shader_image_size (none, GLSL only) */\n/* Reuse tokens from ARB_ES3_compatibility */\n/* reuse GL_COMPRESSED_RGB8_ETC2 */\n/* reuse GL_COMPRESSED_SRGB8_ETC2 */\n/* reuse GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 */\n/* reuse GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 */\n/* reuse GL_COMPRESSED_RGBA8_ETC2_EAC */\n/* reuse GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC */\n/* reuse GL_COMPRESSED_R11_EAC */\n/* reuse GL_COMPRESSED_SIGNED_R11_EAC */\n/* reuse GL_COMPRESSED_RG11_EAC */\n/* reuse GL_COMPRESSED_SIGNED_RG11_EAC */\n/* reuse GL_PRIMITIVE_RESTART_FIXED_INDEX */\n/* reuse GL_ANY_SAMPLES_PASSED_CONSERVATIVE */\n/* reuse GL_MAX_ELEMENT_INDEX */\n/* Reuse tokens from ARB_clear_buffer_object (none) */\n/* Reuse tokens from ARB_compute_shader */\n/* reuse GL_COMPUTE_SHADER */\n/* reuse GL_MAX_COMPUTE_UNIFORM_BLOCKS */\n/* reuse GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS */\n/* reuse GL_MAX_COMPUTE_IMAGE_UNIFORMS */\n/* reuse GL_MAX_COMPUTE_SHARED_MEMORY_SIZE */\n/* reuse GL_MAX_COMPUTE_UNIFORM_COMPONENTS */\n/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS */\n/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTERS */\n/* reuse GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS */\n/* reuse GL_MAX_COMPUTE_LOCAL_INVOCATIONS */\n/* reuse GL_MAX_COMPUTE_WORK_GROUP_COUNT */\n/* reuse GL_MAX_COMPUTE_WORK_GROUP_SIZE */\n/* reuse GL_COMPUTE_LOCAL_WORK_SIZE */\n/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER */\n/* reuse GL_DISPATCH_INDIRECT_BUFFER */\n/* reuse GL_DISPATCH_INDIRECT_BUFFER_BINDING */\n/* Reuse tokens from ARB_copy_image (none) */\n/* Reuse tokens from KHR_debug */\n/* reuse GL_DEBUG_OUTPUT_SYNCHRONOUS */\n/* reuse GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH */\n/* reuse GL_DEBUG_CALLBACK_FUNCTION */\n/* reuse GL_DEBUG_CALLBACK_USER_PARAM */\n/* reuse GL_DEBUG_SOURCE_API */\n/* reuse GL_DEBUG_SOURCE_WINDOW_SYSTEM */\n/* reuse GL_DEBUG_SOURCE_SHADER_COMPILER */\n/* reuse GL_DEBUG_SOURCE_THIRD_PARTY */\n/* reuse GL_DEBUG_SOURCE_APPLICATION */\n/* reuse GL_DEBUG_SOURCE_OTHER */\n/* reuse GL_DEBUG_TYPE_ERROR */\n/* reuse GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR */\n/* reuse GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR */\n/* reuse GL_DEBUG_TYPE_PORTABILITY */\n/* reuse GL_DEBUG_TYPE_PERFORMANCE */\n/* reuse GL_DEBUG_TYPE_OTHER */\n/* reuse GL_MAX_DEBUG_MESSAGE_LENGTH */\n/* reuse GL_MAX_DEBUG_LOGGED_MESSAGES */\n/* reuse GL_DEBUG_LOGGED_MESSAGES */\n/* reuse GL_DEBUG_SEVERITY_HIGH */\n/* reuse GL_DEBUG_SEVERITY_MEDIUM */\n/* reuse GL_DEBUG_SEVERITY_LOW */\n/* reuse GL_DEBUG_TYPE_MARKER */\n/* reuse GL_DEBUG_TYPE_PUSH_GROUP */\n/* reuse GL_DEBUG_TYPE_POP_GROUP */\n/* reuse GL_DEBUG_SEVERITY_NOTIFICATION */\n/* reuse GL_MAX_DEBUG_GROUP_STACK_DEPTH */\n/* reuse GL_DEBUG_GROUP_STACK_DEPTH */\n/* reuse GL_BUFFER */\n/* reuse GL_SHADER */\n/* reuse GL_PROGRAM */\n/* reuse GL_QUERY */\n/* reuse GL_PROGRAM_PIPELINE */\n/* reuse GL_SAMPLER */\n/* reuse GL_DISPLAY_LIST */\n/* reuse GL_MAX_LABEL_LENGTH */\n/* reuse GL_DEBUG_OUTPUT */\n/* reuse GL_CONTEXT_FLAG_DEBUG_BIT */\n/* reuse GL_STACK_UNDERFLOW */\n/* reuse GL_STACK_OVERFLOW */\n/* Reuse tokens from ARB_explicit_uniform_location */\n/* reuse GL_MAX_UNIFORM_LOCATIONS */\n/* Reuse tokens from ARB_framebuffer_no_attachments */\n/* reuse GL_FRAMEBUFFER_DEFAULT_WIDTH */\n/* reuse GL_FRAMEBUFFER_DEFAULT_HEIGHT */\n/* reuse GL_FRAMEBUFFER_DEFAULT_LAYERS */\n/* reuse GL_FRAMEBUFFER_DEFAULT_SAMPLES */\n/* reuse GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS */\n/* reuse GL_MAX_FRAMEBUFFER_WIDTH */\n/* reuse GL_MAX_FRAMEBUFFER_HEIGHT */\n/* reuse GL_MAX_FRAMEBUFFER_LAYERS */\n/* reuse GL_MAX_FRAMEBUFFER_SAMPLES */\n/* Reuse tokens from ARB_internalformat_query2 */\n/* reuse GL_INTERNALFORMAT_SUPPORTED */\n/* reuse GL_INTERNALFORMAT_PREFERRED */\n/* reuse GL_INTERNALFORMAT_RED_SIZE */\n/* reuse GL_INTERNALFORMAT_GREEN_SIZE */\n/* reuse GL_INTERNALFORMAT_BLUE_SIZE */\n/* reuse GL_INTERNALFORMAT_ALPHA_SIZE */\n/* reuse GL_INTERNALFORMAT_DEPTH_SIZE */\n/* reuse GL_INTERNALFORMAT_STENCIL_SIZE */\n/* reuse GL_INTERNALFORMAT_SHARED_SIZE */\n/* reuse GL_INTERNALFORMAT_RED_TYPE */\n/* reuse GL_INTERNALFORMAT_GREEN_TYPE */\n/* reuse GL_INTERNALFORMAT_BLUE_TYPE */\n/* reuse GL_INTERNALFORMAT_ALPHA_TYPE */\n/* reuse GL_INTERNALFORMAT_DEPTH_TYPE */\n/* reuse GL_INTERNALFORMAT_STENCIL_TYPE */\n/* reuse GL_MAX_WIDTH */\n/* reuse GL_MAX_HEIGHT */\n/* reuse GL_MAX_DEPTH */\n/* reuse GL_MAX_LAYERS */\n/* reuse GL_MAX_COMBINED_DIMENSIONS */\n/* reuse GL_COLOR_COMPONENTS */\n/* reuse GL_DEPTH_COMPONENTS */\n/* reuse GL_STENCIL_COMPONENTS */\n/* reuse GL_COLOR_RENDERABLE */\n/* reuse GL_DEPTH_RENDERABLE */\n/* reuse GL_STENCIL_RENDERABLE */\n/* reuse GL_FRAMEBUFFER_RENDERABLE */\n/* reuse GL_FRAMEBUFFER_RENDERABLE_LAYERED */\n/* reuse GL_FRAMEBUFFER_BLEND */\n/* reuse GL_READ_PIXELS */\n/* reuse GL_READ_PIXELS_FORMAT */\n/* reuse GL_READ_PIXELS_TYPE */\n/* reuse GL_TEXTURE_IMAGE_FORMAT */\n/* reuse GL_TEXTURE_IMAGE_TYPE */\n/* reuse GL_GET_TEXTURE_IMAGE_FORMAT */\n/* reuse GL_GET_TEXTURE_IMAGE_TYPE */\n/* reuse GL_MIPMAP */\n/* reuse GL_MANUAL_GENERATE_MIPMAP */\n/* reuse GL_AUTO_GENERATE_MIPMAP */\n/* reuse GL_COLOR_ENCODING */\n/* reuse GL_SRGB_READ */\n/* reuse GL_SRGB_WRITE */\n/* reuse GL_FILTER */\n/* reuse GL_VERTEX_TEXTURE */\n/* reuse GL_TESS_CONTROL_TEXTURE */\n/* reuse GL_TESS_EVALUATION_TEXTURE */\n/* reuse GL_GEOMETRY_TEXTURE */\n/* reuse GL_FRAGMENT_TEXTURE */\n/* reuse GL_COMPUTE_TEXTURE */\n/* reuse GL_TEXTURE_SHADOW */\n/* reuse GL_TEXTURE_GATHER */\n/* reuse GL_TEXTURE_GATHER_SHADOW */\n/* reuse GL_SHADER_IMAGE_LOAD */\n/* reuse GL_SHADER_IMAGE_STORE */\n/* reuse GL_SHADER_IMAGE_ATOMIC */\n/* reuse GL_IMAGE_TEXEL_SIZE */\n/* reuse GL_IMAGE_COMPATIBILITY_CLASS */\n/* reuse GL_IMAGE_PIXEL_FORMAT */\n/* reuse GL_IMAGE_PIXEL_TYPE */\n/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST */\n/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST */\n/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE */\n/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE */\n/* reuse GL_TEXTURE_COMPRESSED_BLOCK_WIDTH */\n/* reuse GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT */\n/* reuse GL_TEXTURE_COMPRESSED_BLOCK_SIZE */\n/* reuse GL_CLEAR_BUFFER */\n/* reuse GL_TEXTURE_VIEW */\n/* reuse GL_VIEW_COMPATIBILITY_CLASS */\n/* reuse GL_FULL_SUPPORT */\n/* reuse GL_CAVEAT_SUPPORT */\n/* reuse GL_IMAGE_CLASS_4_X_32 */\n/* reuse GL_IMAGE_CLASS_2_X_32 */\n/* reuse GL_IMAGE_CLASS_1_X_32 */\n/* reuse GL_IMAGE_CLASS_4_X_16 */\n/* reuse GL_IMAGE_CLASS_2_X_16 */\n/* reuse GL_IMAGE_CLASS_1_X_16 */\n/* reuse GL_IMAGE_CLASS_4_X_8 */\n/* reuse GL_IMAGE_CLASS_2_X_8 */\n/* reuse GL_IMAGE_CLASS_1_X_8 */\n/* reuse GL_IMAGE_CLASS_11_11_10 */\n/* reuse GL_IMAGE_CLASS_10_10_10_2 */\n/* reuse GL_VIEW_CLASS_128_BITS */\n/* reuse GL_VIEW_CLASS_96_BITS */\n/* reuse GL_VIEW_CLASS_64_BITS */\n/* reuse GL_VIEW_CLASS_48_BITS */\n/* reuse GL_VIEW_CLASS_32_BITS */\n/* reuse GL_VIEW_CLASS_24_BITS */\n/* reuse GL_VIEW_CLASS_16_BITS */\n/* reuse GL_VIEW_CLASS_8_BITS */\n/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGB */\n/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGBA */\n/* reuse GL_VIEW_CLASS_S3TC_DXT3_RGBA */\n/* reuse GL_VIEW_CLASS_S3TC_DXT5_RGBA */\n/* reuse GL_VIEW_CLASS_RGTC1_RED */\n/* reuse GL_VIEW_CLASS_RGTC2_RG */\n/* reuse GL_VIEW_CLASS_BPTC_UNORM */\n/* reuse GL_VIEW_CLASS_BPTC_FLOAT */\n/* Reuse tokens from ARB_invalidate_subdata (none) */\n/* Reuse tokens from ARB_multi_draw_indirect (none) */\n/* Reuse tokens from ARB_program_interface_query */\n/* reuse GL_UNIFORM */\n/* reuse GL_UNIFORM_BLOCK */\n/* reuse GL_PROGRAM_INPUT */\n/* reuse GL_PROGRAM_OUTPUT */\n/* reuse GL_BUFFER_VARIABLE */\n/* reuse GL_SHADER_STORAGE_BLOCK */\n/* reuse GL_VERTEX_SUBROUTINE */\n/* reuse GL_TESS_CONTROL_SUBROUTINE */\n/* reuse GL_TESS_EVALUATION_SUBROUTINE */\n/* reuse GL_GEOMETRY_SUBROUTINE */\n/* reuse GL_FRAGMENT_SUBROUTINE */\n/* reuse GL_COMPUTE_SUBROUTINE */\n/* reuse GL_VERTEX_SUBROUTINE_UNIFORM */\n/* reuse GL_TESS_CONTROL_SUBROUTINE_UNIFORM */\n/* reuse GL_TESS_EVALUATION_SUBROUTINE_UNIFORM */\n/* reuse GL_GEOMETRY_SUBROUTINE_UNIFORM */\n/* reuse GL_FRAGMENT_SUBROUTINE_UNIFORM */\n/* reuse GL_COMPUTE_SUBROUTINE_UNIFORM */\n/* reuse GL_TRANSFORM_FEEDBACK_VARYING */\n/* reuse GL_ACTIVE_RESOURCES */\n/* reuse GL_MAX_NAME_LENGTH */\n/* reuse GL_MAX_NUM_ACTIVE_VARIABLES */\n/* reuse GL_MAX_NUM_COMPATIBLE_SUBROUTINES */\n/* reuse GL_NAME_LENGTH */\n/* reuse GL_TYPE */\n/* reuse GL_ARRAY_SIZE */\n/* reuse GL_OFFSET */\n/* reuse GL_BLOCK_INDEX */\n/* reuse GL_ARRAY_STRIDE */\n/* reuse GL_MATRIX_STRIDE */\n/* reuse GL_IS_ROW_MAJOR */\n/* reuse GL_ATOMIC_COUNTER_BUFFER_INDEX */\n/* reuse GL_BUFFER_BINDING */\n/* reuse GL_BUFFER_DATA_SIZE */\n/* reuse GL_NUM_ACTIVE_VARIABLES */\n/* reuse GL_ACTIVE_VARIABLES */\n/* reuse GL_REFERENCED_BY_VERTEX_SHADER */\n/* reuse GL_REFERENCED_BY_TESS_CONTROL_SHADER */\n/* reuse GL_REFERENCED_BY_TESS_EVALUATION_SHADER */\n/* reuse GL_REFERENCED_BY_GEOMETRY_SHADER */\n/* reuse GL_REFERENCED_BY_FRAGMENT_SHADER */\n/* reuse GL_REFERENCED_BY_COMPUTE_SHADER */\n/* reuse GL_TOP_LEVEL_ARRAY_SIZE */\n/* reuse GL_TOP_LEVEL_ARRAY_STRIDE */\n/* reuse GL_LOCATION */\n/* reuse GL_LOCATION_INDEX */\n/* reuse GL_IS_PER_PATCH */\n/* Reuse tokens from ARB_robust_buffer_access_behavior (none) */\n/* Reuse tokens from ARB_shader_storage_buffer_object */\n/* reuse GL_SHADER_STORAGE_BUFFER */\n/* reuse GL_SHADER_STORAGE_BUFFER_BINDING */\n/* reuse GL_SHADER_STORAGE_BUFFER_START */\n/* reuse GL_SHADER_STORAGE_BUFFER_SIZE */\n/* reuse GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS */\n/* reuse GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS */\n/* reuse GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS */\n/* reuse GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS */\n/* reuse GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS */\n/* reuse GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS */\n/* reuse GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS */\n/* reuse GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS */\n/* reuse GL_MAX_SHADER_STORAGE_BLOCK_SIZE */\n/* reuse GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT */\n/* reuse GL_SHADER_STORAGE_BARRIER_BIT */\n/* reuse GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES */\n/* Reuse tokens from ARB_stencil_texturing */\n/* reuse GL_DEPTH_STENCIL_TEXTURE_MODE */\n/* Reuse tokens from ARB_texture_buffer_range */\n/* reuse GL_TEXTURE_BUFFER_OFFSET */\n/* reuse GL_TEXTURE_BUFFER_SIZE */\n/* reuse GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT */\n/* Reuse tokens from ARB_texture_query_levels (none) */\n/* Reuse tokens from ARB_texture_storage_multisample (none) */\n/* Reuse tokens from ARB_texture_view */\n/* reuse GL_TEXTURE_VIEW_MIN_LEVEL */\n/* reuse GL_TEXTURE_VIEW_NUM_LEVELS */\n/* reuse GL_TEXTURE_VIEW_MIN_LAYER */\n/* reuse GL_TEXTURE_VIEW_NUM_LAYERS */\n/* reuse GL_TEXTURE_IMMUTABLE_LEVELS */\n/* Reuse tokens from ARB_vertex_attrib_binding */\n/* reuse GL_VERTEX_ATTRIB_BINDING */\n/* reuse GL_VERTEX_ATTRIB_RELATIVE_OFFSET */\n/* reuse GL_VERTEX_BINDING_DIVISOR */\n/* reuse GL_VERTEX_BINDING_OFFSET */\n/* reuse GL_VERTEX_BINDING_STRIDE */\n/* reuse GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET */\n/* reuse GL_MAX_VERTEX_ATTRIB_BINDINGS */\n#endif\n\n#ifndef GL_ARB_multitexture\n#define GL_TEXTURE0_ARB                   0x84C0\n#define GL_TEXTURE1_ARB                   0x84C1\n#define GL_TEXTURE2_ARB                   0x84C2\n#define GL_TEXTURE3_ARB                   0x84C3\n#define GL_TEXTURE4_ARB                   0x84C4\n#define GL_TEXTURE5_ARB                   0x84C5\n#define GL_TEXTURE6_ARB                   0x84C6\n#define GL_TEXTURE7_ARB                   0x84C7\n#define GL_TEXTURE8_ARB                   0x84C8\n#define GL_TEXTURE9_ARB                   0x84C9\n#define GL_TEXTURE10_ARB                  0x84CA\n#define GL_TEXTURE11_ARB                  0x84CB\n#define GL_TEXTURE12_ARB                  0x84CC\n#define GL_TEXTURE13_ARB                  0x84CD\n#define GL_TEXTURE14_ARB                  0x84CE\n#define GL_TEXTURE15_ARB                  0x84CF\n#define GL_TEXTURE16_ARB                  0x84D0\n#define GL_TEXTURE17_ARB                  0x84D1\n#define GL_TEXTURE18_ARB                  0x84D2\n#define GL_TEXTURE19_ARB                  0x84D3\n#define GL_TEXTURE20_ARB                  0x84D4\n#define GL_TEXTURE21_ARB                  0x84D5\n#define GL_TEXTURE22_ARB                  0x84D6\n#define GL_TEXTURE23_ARB                  0x84D7\n#define GL_TEXTURE24_ARB                  0x84D8\n#define GL_TEXTURE25_ARB                  0x84D9\n#define GL_TEXTURE26_ARB                  0x84DA\n#define GL_TEXTURE27_ARB                  0x84DB\n#define GL_TEXTURE28_ARB                  0x84DC\n#define GL_TEXTURE29_ARB                  0x84DD\n#define GL_TEXTURE30_ARB                  0x84DE\n#define GL_TEXTURE31_ARB                  0x84DF\n#define GL_ACTIVE_TEXTURE_ARB             0x84E0\n#define GL_CLIENT_ACTIVE_TEXTURE_ARB      0x84E1\n#define GL_MAX_TEXTURE_UNITS_ARB          0x84E2\n#endif\n\n#ifndef GL_ARB_transpose_matrix\n#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3\n#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4\n#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB   0x84E5\n#define GL_TRANSPOSE_COLOR_MATRIX_ARB     0x84E6\n#endif\n\n#ifndef GL_ARB_multisample\n#define GL_MULTISAMPLE_ARB                0x809D\n#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB   0x809E\n#define GL_SAMPLE_ALPHA_TO_ONE_ARB        0x809F\n#define GL_SAMPLE_COVERAGE_ARB            0x80A0\n#define GL_SAMPLE_BUFFERS_ARB             0x80A8\n#define GL_SAMPLES_ARB                    0x80A9\n#define GL_SAMPLE_COVERAGE_VALUE_ARB      0x80AA\n#define GL_SAMPLE_COVERAGE_INVERT_ARB     0x80AB\n#define GL_MULTISAMPLE_BIT_ARB            0x20000000\n#endif\n\n#ifndef GL_ARB_texture_env_add\n#endif\n\n#ifndef GL_ARB_texture_cube_map\n#define GL_NORMAL_MAP_ARB                 0x8511\n#define GL_REFLECTION_MAP_ARB             0x8512\n#define GL_TEXTURE_CUBE_MAP_ARB           0x8513\n#define GL_TEXTURE_BINDING_CUBE_MAP_ARB   0x8514\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A\n#define GL_PROXY_TEXTURE_CUBE_MAP_ARB     0x851B\n#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB  0x851C\n#endif\n\n#ifndef GL_ARB_texture_compression\n#define GL_COMPRESSED_ALPHA_ARB           0x84E9\n#define GL_COMPRESSED_LUMINANCE_ARB       0x84EA\n#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB\n#define GL_COMPRESSED_INTENSITY_ARB       0x84EC\n#define GL_COMPRESSED_RGB_ARB             0x84ED\n#define GL_COMPRESSED_RGBA_ARB            0x84EE\n#define GL_TEXTURE_COMPRESSION_HINT_ARB   0x84EF\n#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0\n#define GL_TEXTURE_COMPRESSED_ARB         0x86A1\n#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2\n#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3\n#endif\n\n#ifndef GL_ARB_texture_border_clamp\n#define GL_CLAMP_TO_BORDER_ARB            0x812D\n#endif\n\n#ifndef GL_ARB_point_parameters\n#define GL_POINT_SIZE_MIN_ARB             0x8126\n#define GL_POINT_SIZE_MAX_ARB             0x8127\n#define GL_POINT_FADE_THRESHOLD_SIZE_ARB  0x8128\n#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129\n#endif\n\n#ifndef GL_ARB_vertex_blend\n#define GL_MAX_VERTEX_UNITS_ARB           0x86A4\n#define GL_ACTIVE_VERTEX_UNITS_ARB        0x86A5\n#define GL_WEIGHT_SUM_UNITY_ARB           0x86A6\n#define GL_VERTEX_BLEND_ARB               0x86A7\n#define GL_CURRENT_WEIGHT_ARB             0x86A8\n#define GL_WEIGHT_ARRAY_TYPE_ARB          0x86A9\n#define GL_WEIGHT_ARRAY_STRIDE_ARB        0x86AA\n#define GL_WEIGHT_ARRAY_SIZE_ARB          0x86AB\n#define GL_WEIGHT_ARRAY_POINTER_ARB       0x86AC\n#define GL_WEIGHT_ARRAY_ARB               0x86AD\n#define GL_MODELVIEW0_ARB                 0x1700\n#define GL_MODELVIEW1_ARB                 0x850A\n#define GL_MODELVIEW2_ARB                 0x8722\n#define GL_MODELVIEW3_ARB                 0x8723\n#define GL_MODELVIEW4_ARB                 0x8724\n#define GL_MODELVIEW5_ARB                 0x8725\n#define GL_MODELVIEW6_ARB                 0x8726\n#define GL_MODELVIEW7_ARB                 0x8727\n#define GL_MODELVIEW8_ARB                 0x8728\n#define GL_MODELVIEW9_ARB                 0x8729\n#define GL_MODELVIEW10_ARB                0x872A\n#define GL_MODELVIEW11_ARB                0x872B\n#define GL_MODELVIEW12_ARB                0x872C\n#define GL_MODELVIEW13_ARB                0x872D\n#define GL_MODELVIEW14_ARB                0x872E\n#define GL_MODELVIEW15_ARB                0x872F\n#define GL_MODELVIEW16_ARB                0x8730\n#define GL_MODELVIEW17_ARB                0x8731\n#define GL_MODELVIEW18_ARB                0x8732\n#define GL_MODELVIEW19_ARB                0x8733\n#define GL_MODELVIEW20_ARB                0x8734\n#define GL_MODELVIEW21_ARB                0x8735\n#define GL_MODELVIEW22_ARB                0x8736\n#define GL_MODELVIEW23_ARB                0x8737\n#define GL_MODELVIEW24_ARB                0x8738\n#define GL_MODELVIEW25_ARB                0x8739\n#define GL_MODELVIEW26_ARB                0x873A\n#define GL_MODELVIEW27_ARB                0x873B\n#define GL_MODELVIEW28_ARB                0x873C\n#define GL_MODELVIEW29_ARB                0x873D\n#define GL_MODELVIEW30_ARB                0x873E\n#define GL_MODELVIEW31_ARB                0x873F\n#endif\n\n#ifndef GL_ARB_matrix_palette\n#define GL_MATRIX_PALETTE_ARB             0x8840\n#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841\n#define GL_MAX_PALETTE_MATRICES_ARB       0x8842\n#define GL_CURRENT_PALETTE_MATRIX_ARB     0x8843\n#define GL_MATRIX_INDEX_ARRAY_ARB         0x8844\n#define GL_CURRENT_MATRIX_INDEX_ARB       0x8845\n#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB    0x8846\n#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB    0x8847\n#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB  0x8848\n#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849\n#endif\n\n#ifndef GL_ARB_texture_env_combine\n#define GL_COMBINE_ARB                    0x8570\n#define GL_COMBINE_RGB_ARB                0x8571\n#define GL_COMBINE_ALPHA_ARB              0x8572\n#define GL_SOURCE0_RGB_ARB                0x8580\n#define GL_SOURCE1_RGB_ARB                0x8581\n#define GL_SOURCE2_RGB_ARB                0x8582\n#define GL_SOURCE0_ALPHA_ARB              0x8588\n#define GL_SOURCE1_ALPHA_ARB              0x8589\n#define GL_SOURCE2_ALPHA_ARB              0x858A\n#define GL_OPERAND0_RGB_ARB               0x8590\n#define GL_OPERAND1_RGB_ARB               0x8591\n#define GL_OPERAND2_RGB_ARB               0x8592\n#define GL_OPERAND0_ALPHA_ARB             0x8598\n#define GL_OPERAND1_ALPHA_ARB             0x8599\n#define GL_OPERAND2_ALPHA_ARB             0x859A\n#define GL_RGB_SCALE_ARB                  0x8573\n#define GL_ADD_SIGNED_ARB                 0x8574\n#define GL_INTERPOLATE_ARB                0x8575\n#define GL_SUBTRACT_ARB                   0x84E7\n#define GL_CONSTANT_ARB                   0x8576\n#define GL_PRIMARY_COLOR_ARB              0x8577\n#define GL_PREVIOUS_ARB                   0x8578\n#endif\n\n#ifndef GL_ARB_texture_env_crossbar\n#endif\n\n#ifndef GL_ARB_texture_env_dot3\n#define GL_DOT3_RGB_ARB                   0x86AE\n#define GL_DOT3_RGBA_ARB                  0x86AF\n#endif\n\n#ifndef GL_ARB_texture_mirrored_repeat\n#define GL_MIRRORED_REPEAT_ARB            0x8370\n#endif\n\n#ifndef GL_ARB_depth_texture\n#define GL_DEPTH_COMPONENT16_ARB          0x81A5\n#define GL_DEPTH_COMPONENT24_ARB          0x81A6\n#define GL_DEPTH_COMPONENT32_ARB          0x81A7\n#define GL_TEXTURE_DEPTH_SIZE_ARB         0x884A\n#define GL_DEPTH_TEXTURE_MODE_ARB         0x884B\n#endif\n\n#ifndef GL_ARB_shadow\n#define GL_TEXTURE_COMPARE_MODE_ARB       0x884C\n#define GL_TEXTURE_COMPARE_FUNC_ARB       0x884D\n#define GL_COMPARE_R_TO_TEXTURE_ARB       0x884E\n#endif\n\n#ifndef GL_ARB_shadow_ambient\n#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF\n#endif\n\n#ifndef GL_ARB_window_pos\n#endif\n\n#ifndef GL_ARB_vertex_program\n#define GL_COLOR_SUM_ARB                  0x8458\n#define GL_VERTEX_PROGRAM_ARB             0x8620\n#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622\n#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB   0x8623\n#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624\n#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB   0x8625\n#define GL_CURRENT_VERTEX_ATTRIB_ARB      0x8626\n#define GL_PROGRAM_LENGTH_ARB             0x8627\n#define GL_PROGRAM_STRING_ARB             0x8628\n#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E\n#define GL_MAX_PROGRAM_MATRICES_ARB       0x862F\n#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640\n#define GL_CURRENT_MATRIX_ARB             0x8641\n#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB  0x8642\n#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB    0x8643\n#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645\n#define GL_PROGRAM_ERROR_POSITION_ARB     0x864B\n#define GL_PROGRAM_BINDING_ARB            0x8677\n#define GL_MAX_VERTEX_ATTRIBS_ARB         0x8869\n#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A\n#define GL_PROGRAM_ERROR_STRING_ARB       0x8874\n#define GL_PROGRAM_FORMAT_ASCII_ARB       0x8875\n#define GL_PROGRAM_FORMAT_ARB             0x8876\n#define GL_PROGRAM_INSTRUCTIONS_ARB       0x88A0\n#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB   0x88A1\n#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2\n#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3\n#define GL_PROGRAM_TEMPORARIES_ARB        0x88A4\n#define GL_MAX_PROGRAM_TEMPORARIES_ARB    0x88A5\n#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6\n#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7\n#define GL_PROGRAM_PARAMETERS_ARB         0x88A8\n#define GL_MAX_PROGRAM_PARAMETERS_ARB     0x88A9\n#define GL_PROGRAM_NATIVE_PARAMETERS_ARB  0x88AA\n#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB\n#define GL_PROGRAM_ATTRIBS_ARB            0x88AC\n#define GL_MAX_PROGRAM_ATTRIBS_ARB        0x88AD\n#define GL_PROGRAM_NATIVE_ATTRIBS_ARB     0x88AE\n#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF\n#define GL_PROGRAM_ADDRESS_REGISTERS_ARB  0x88B0\n#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1\n#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2\n#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3\n#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4\n#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5\n#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6\n#define GL_TRANSPOSE_CURRENT_MATRIX_ARB   0x88B7\n#define GL_MATRIX0_ARB                    0x88C0\n#define GL_MATRIX1_ARB                    0x88C1\n#define GL_MATRIX2_ARB                    0x88C2\n#define GL_MATRIX3_ARB                    0x88C3\n#define GL_MATRIX4_ARB                    0x88C4\n#define GL_MATRIX5_ARB                    0x88C5\n#define GL_MATRIX6_ARB                    0x88C6\n#define GL_MATRIX7_ARB                    0x88C7\n#define GL_MATRIX8_ARB                    0x88C8\n#define GL_MATRIX9_ARB                    0x88C9\n#define GL_MATRIX10_ARB                   0x88CA\n#define GL_MATRIX11_ARB                   0x88CB\n#define GL_MATRIX12_ARB                   0x88CC\n#define GL_MATRIX13_ARB                   0x88CD\n#define GL_MATRIX14_ARB                   0x88CE\n#define GL_MATRIX15_ARB                   0x88CF\n#define GL_MATRIX16_ARB                   0x88D0\n#define GL_MATRIX17_ARB                   0x88D1\n#define GL_MATRIX18_ARB                   0x88D2\n#define GL_MATRIX19_ARB                   0x88D3\n#define GL_MATRIX20_ARB                   0x88D4\n#define GL_MATRIX21_ARB                   0x88D5\n#define GL_MATRIX22_ARB                   0x88D6\n#define GL_MATRIX23_ARB                   0x88D7\n#define GL_MATRIX24_ARB                   0x88D8\n#define GL_MATRIX25_ARB                   0x88D9\n#define GL_MATRIX26_ARB                   0x88DA\n#define GL_MATRIX27_ARB                   0x88DB\n#define GL_MATRIX28_ARB                   0x88DC\n#define GL_MATRIX29_ARB                   0x88DD\n#define GL_MATRIX30_ARB                   0x88DE\n#define GL_MATRIX31_ARB                   0x88DF\n#endif\n\n#ifndef GL_ARB_fragment_program\n#define GL_FRAGMENT_PROGRAM_ARB           0x8804\n#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB   0x8805\n#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB   0x8806\n#define GL_PROGRAM_TEX_INDIRECTIONS_ARB   0x8807\n#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808\n#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809\n#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A\n#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B\n#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C\n#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D\n#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E\n#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F\n#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810\n#define GL_MAX_TEXTURE_COORDS_ARB         0x8871\n#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB    0x8872\n#endif\n\n#ifndef GL_ARB_vertex_buffer_object\n#define GL_BUFFER_SIZE_ARB                0x8764\n#define GL_BUFFER_USAGE_ARB               0x8765\n#define GL_ARRAY_BUFFER_ARB               0x8892\n#define GL_ELEMENT_ARRAY_BUFFER_ARB       0x8893\n#define GL_ARRAY_BUFFER_BINDING_ARB       0x8894\n#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895\n#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896\n#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897\n#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898\n#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899\n#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A\n#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B\n#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C\n#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D\n#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E\n#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F\n#define GL_READ_ONLY_ARB                  0x88B8\n#define GL_WRITE_ONLY_ARB                 0x88B9\n#define GL_READ_WRITE_ARB                 0x88BA\n#define GL_BUFFER_ACCESS_ARB              0x88BB\n#define GL_BUFFER_MAPPED_ARB              0x88BC\n#define GL_BUFFER_MAP_POINTER_ARB         0x88BD\n#define GL_STREAM_DRAW_ARB                0x88E0\n#define GL_STREAM_READ_ARB                0x88E1\n#define GL_STREAM_COPY_ARB                0x88E2\n#define GL_STATIC_DRAW_ARB                0x88E4\n#define GL_STATIC_READ_ARB                0x88E5\n#define GL_STATIC_COPY_ARB                0x88E6\n#define GL_DYNAMIC_DRAW_ARB               0x88E8\n#define GL_DYNAMIC_READ_ARB               0x88E9\n#define GL_DYNAMIC_COPY_ARB               0x88EA\n#endif\n\n#ifndef GL_ARB_occlusion_query\n#define GL_QUERY_COUNTER_BITS_ARB         0x8864\n#define GL_CURRENT_QUERY_ARB              0x8865\n#define GL_QUERY_RESULT_ARB               0x8866\n#define GL_QUERY_RESULT_AVAILABLE_ARB     0x8867\n#define GL_SAMPLES_PASSED_ARB             0x8914\n#endif\n\n#ifndef GL_ARB_shader_objects\n#define GL_PROGRAM_OBJECT_ARB             0x8B40\n#define GL_SHADER_OBJECT_ARB              0x8B48\n#define GL_OBJECT_TYPE_ARB                0x8B4E\n#define GL_OBJECT_SUBTYPE_ARB             0x8B4F\n#define GL_FLOAT_VEC2_ARB                 0x8B50\n#define GL_FLOAT_VEC3_ARB                 0x8B51\n#define GL_FLOAT_VEC4_ARB                 0x8B52\n#define GL_INT_VEC2_ARB                   0x8B53\n#define GL_INT_VEC3_ARB                   0x8B54\n#define GL_INT_VEC4_ARB                   0x8B55\n#define GL_BOOL_ARB                       0x8B56\n#define GL_BOOL_VEC2_ARB                  0x8B57\n#define GL_BOOL_VEC3_ARB                  0x8B58\n#define GL_BOOL_VEC4_ARB                  0x8B59\n#define GL_FLOAT_MAT2_ARB                 0x8B5A\n#define GL_FLOAT_MAT3_ARB                 0x8B5B\n#define GL_FLOAT_MAT4_ARB                 0x8B5C\n#define GL_SAMPLER_1D_ARB                 0x8B5D\n#define GL_SAMPLER_2D_ARB                 0x8B5E\n#define GL_SAMPLER_3D_ARB                 0x8B5F\n#define GL_SAMPLER_CUBE_ARB               0x8B60\n#define GL_SAMPLER_1D_SHADOW_ARB          0x8B61\n#define GL_SAMPLER_2D_SHADOW_ARB          0x8B62\n#define GL_SAMPLER_2D_RECT_ARB            0x8B63\n#define GL_SAMPLER_2D_RECT_SHADOW_ARB     0x8B64\n#define GL_OBJECT_DELETE_STATUS_ARB       0x8B80\n#define GL_OBJECT_COMPILE_STATUS_ARB      0x8B81\n#define GL_OBJECT_LINK_STATUS_ARB         0x8B82\n#define GL_OBJECT_VALIDATE_STATUS_ARB     0x8B83\n#define GL_OBJECT_INFO_LOG_LENGTH_ARB     0x8B84\n#define GL_OBJECT_ATTACHED_OBJECTS_ARB    0x8B85\n#define GL_OBJECT_ACTIVE_UNIFORMS_ARB     0x8B86\n#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87\n#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88\n#endif\n\n#ifndef GL_ARB_vertex_shader\n#define GL_VERTEX_SHADER_ARB              0x8B31\n#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A\n#define GL_MAX_VARYING_FLOATS_ARB         0x8B4B\n#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C\n#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D\n#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB   0x8B89\n#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A\n#endif\n\n#ifndef GL_ARB_fragment_shader\n#define GL_FRAGMENT_SHADER_ARB            0x8B30\n#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49\n#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B\n#endif\n\n#ifndef GL_ARB_shading_language_100\n#define GL_SHADING_LANGUAGE_VERSION_ARB   0x8B8C\n#endif\n\n#ifndef GL_ARB_texture_non_power_of_two\n#endif\n\n#ifndef GL_ARB_point_sprite\n#define GL_POINT_SPRITE_ARB               0x8861\n#define GL_COORD_REPLACE_ARB              0x8862\n#endif\n\n#ifndef GL_ARB_fragment_program_shadow\n#endif\n\n#ifndef GL_ARB_draw_buffers\n#define GL_MAX_DRAW_BUFFERS_ARB           0x8824\n#define GL_DRAW_BUFFER0_ARB               0x8825\n#define GL_DRAW_BUFFER1_ARB               0x8826\n#define GL_DRAW_BUFFER2_ARB               0x8827\n#define GL_DRAW_BUFFER3_ARB               0x8828\n#define GL_DRAW_BUFFER4_ARB               0x8829\n#define GL_DRAW_BUFFER5_ARB               0x882A\n#define GL_DRAW_BUFFER6_ARB               0x882B\n#define GL_DRAW_BUFFER7_ARB               0x882C\n#define GL_DRAW_BUFFER8_ARB               0x882D\n#define GL_DRAW_BUFFER9_ARB               0x882E\n#define GL_DRAW_BUFFER10_ARB              0x882F\n#define GL_DRAW_BUFFER11_ARB              0x8830\n#define GL_DRAW_BUFFER12_ARB              0x8831\n#define GL_DRAW_BUFFER13_ARB              0x8832\n#define GL_DRAW_BUFFER14_ARB              0x8833\n#define GL_DRAW_BUFFER15_ARB              0x8834\n#endif\n\n#ifndef GL_ARB_texture_rectangle\n#define GL_TEXTURE_RECTANGLE_ARB          0x84F5\n#define GL_TEXTURE_BINDING_RECTANGLE_ARB  0x84F6\n#define GL_PROXY_TEXTURE_RECTANGLE_ARB    0x84F7\n#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8\n#endif\n\n#ifndef GL_ARB_color_buffer_float\n#define GL_RGBA_FLOAT_MODE_ARB            0x8820\n#define GL_CLAMP_VERTEX_COLOR_ARB         0x891A\n#define GL_CLAMP_FRAGMENT_COLOR_ARB       0x891B\n#define GL_CLAMP_READ_COLOR_ARB           0x891C\n#define GL_FIXED_ONLY_ARB                 0x891D\n#endif\n\n#ifndef GL_ARB_half_float_pixel\n#define GL_HALF_FLOAT_ARB                 0x140B\n#endif\n\n#ifndef GL_ARB_texture_float\n#define GL_TEXTURE_RED_TYPE_ARB           0x8C10\n#define GL_TEXTURE_GREEN_TYPE_ARB         0x8C11\n#define GL_TEXTURE_BLUE_TYPE_ARB          0x8C12\n#define GL_TEXTURE_ALPHA_TYPE_ARB         0x8C13\n#define GL_TEXTURE_LUMINANCE_TYPE_ARB     0x8C14\n#define GL_TEXTURE_INTENSITY_TYPE_ARB     0x8C15\n#define GL_TEXTURE_DEPTH_TYPE_ARB         0x8C16\n#define GL_UNSIGNED_NORMALIZED_ARB        0x8C17\n#define GL_RGBA32F_ARB                    0x8814\n#define GL_RGB32F_ARB                     0x8815\n#define GL_ALPHA32F_ARB                   0x8816\n#define GL_INTENSITY32F_ARB               0x8817\n#define GL_LUMINANCE32F_ARB               0x8818\n#define GL_LUMINANCE_ALPHA32F_ARB         0x8819\n#define GL_RGBA16F_ARB                    0x881A\n#define GL_RGB16F_ARB                     0x881B\n#define GL_ALPHA16F_ARB                   0x881C\n#define GL_INTENSITY16F_ARB               0x881D\n#define GL_LUMINANCE16F_ARB               0x881E\n#define GL_LUMINANCE_ALPHA16F_ARB         0x881F\n#endif\n\n#ifndef GL_ARB_pixel_buffer_object\n#define GL_PIXEL_PACK_BUFFER_ARB          0x88EB\n#define GL_PIXEL_UNPACK_BUFFER_ARB        0x88EC\n#define GL_PIXEL_PACK_BUFFER_BINDING_ARB  0x88ED\n#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF\n#endif\n\n#ifndef GL_ARB_depth_buffer_float\n#define GL_DEPTH_COMPONENT32F             0x8CAC\n#define GL_DEPTH32F_STENCIL8              0x8CAD\n#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD\n#endif\n\n#ifndef GL_ARB_draw_instanced\n#endif\n\n#ifndef GL_ARB_framebuffer_object\n#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506\n#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210\n#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211\n#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212\n#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213\n#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214\n#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215\n#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216\n#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217\n#define GL_FRAMEBUFFER_DEFAULT            0x8218\n#define GL_FRAMEBUFFER_UNDEFINED          0x8219\n#define GL_DEPTH_STENCIL_ATTACHMENT       0x821A\n#define GL_MAX_RENDERBUFFER_SIZE          0x84E8\n#define GL_DEPTH_STENCIL                  0x84F9\n#define GL_UNSIGNED_INT_24_8              0x84FA\n#define GL_DEPTH24_STENCIL8               0x88F0\n#define GL_TEXTURE_STENCIL_SIZE           0x88F1\n#define GL_TEXTURE_RED_TYPE               0x8C10\n#define GL_TEXTURE_GREEN_TYPE             0x8C11\n#define GL_TEXTURE_BLUE_TYPE              0x8C12\n#define GL_TEXTURE_ALPHA_TYPE             0x8C13\n#define GL_TEXTURE_DEPTH_TYPE             0x8C16\n#define GL_UNSIGNED_NORMALIZED            0x8C17\n#define GL_FRAMEBUFFER_BINDING            0x8CA6\n#define GL_DRAW_FRAMEBUFFER_BINDING       GL_FRAMEBUFFER_BINDING\n#define GL_RENDERBUFFER_BINDING           0x8CA7\n#define GL_READ_FRAMEBUFFER               0x8CA8\n#define GL_DRAW_FRAMEBUFFER               0x8CA9\n#define GL_READ_FRAMEBUFFER_BINDING       0x8CAA\n#define GL_RENDERBUFFER_SAMPLES           0x8CAB\n#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0\n#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4\n#define GL_FRAMEBUFFER_COMPLETE           0x8CD5\n#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6\n#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7\n#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB\n#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC\n#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD\n#define GL_MAX_COLOR_ATTACHMENTS          0x8CDF\n#define GL_COLOR_ATTACHMENT0              0x8CE0\n#define GL_COLOR_ATTACHMENT1              0x8CE1\n#define GL_COLOR_ATTACHMENT2              0x8CE2\n#define GL_COLOR_ATTACHMENT3              0x8CE3\n#define GL_COLOR_ATTACHMENT4              0x8CE4\n#define GL_COLOR_ATTACHMENT5              0x8CE5\n#define GL_COLOR_ATTACHMENT6              0x8CE6\n#define GL_COLOR_ATTACHMENT7              0x8CE7\n#define GL_COLOR_ATTACHMENT8              0x8CE8\n#define GL_COLOR_ATTACHMENT9              0x8CE9\n#define GL_COLOR_ATTACHMENT10             0x8CEA\n#define GL_COLOR_ATTACHMENT11             0x8CEB\n#define GL_COLOR_ATTACHMENT12             0x8CEC\n#define GL_COLOR_ATTACHMENT13             0x8CED\n#define GL_COLOR_ATTACHMENT14             0x8CEE\n#define GL_COLOR_ATTACHMENT15             0x8CEF\n#define GL_DEPTH_ATTACHMENT               0x8D00\n#define GL_STENCIL_ATTACHMENT             0x8D20\n#define GL_FRAMEBUFFER                    0x8D40\n#define GL_RENDERBUFFER                   0x8D41\n#define GL_RENDERBUFFER_WIDTH             0x8D42\n#define GL_RENDERBUFFER_HEIGHT            0x8D43\n#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44\n#define GL_STENCIL_INDEX1                 0x8D46\n#define GL_STENCIL_INDEX4                 0x8D47\n#define GL_STENCIL_INDEX8                 0x8D48\n#define GL_STENCIL_INDEX16                0x8D49\n#define GL_RENDERBUFFER_RED_SIZE          0x8D50\n#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51\n#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52\n#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53\n#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54\n#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55\n#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56\n#define GL_MAX_SAMPLES                    0x8D57\n#define GL_INDEX                          0x8222\n#define GL_TEXTURE_LUMINANCE_TYPE         0x8C14\n#define GL_TEXTURE_INTENSITY_TYPE         0x8C15\n#endif\n\n#ifndef GL_ARB_framebuffer_sRGB\n#define GL_FRAMEBUFFER_SRGB               0x8DB9\n#endif\n\n#ifndef GL_ARB_geometry_shader4\n#define GL_LINES_ADJACENCY_ARB            0x000A\n#define GL_LINE_STRIP_ADJACENCY_ARB       0x000B\n#define GL_TRIANGLES_ADJACENCY_ARB        0x000C\n#define GL_TRIANGLE_STRIP_ADJACENCY_ARB   0x000D\n#define GL_PROGRAM_POINT_SIZE_ARB         0x8642\n#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29\n#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9\n#define GL_GEOMETRY_SHADER_ARB            0x8DD9\n#define GL_GEOMETRY_VERTICES_OUT_ARB      0x8DDA\n#define GL_GEOMETRY_INPUT_TYPE_ARB        0x8DDB\n#define GL_GEOMETRY_OUTPUT_TYPE_ARB       0x8DDC\n#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD\n#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE\n#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF\n#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0\n#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1\n/* reuse GL_MAX_VARYING_COMPONENTS */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */\n#endif\n\n#ifndef GL_ARB_half_float_vertex\n#define GL_HALF_FLOAT                     0x140B\n#endif\n\n#ifndef GL_ARB_instanced_arrays\n#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE\n#endif\n\n#ifndef GL_ARB_map_buffer_range\n#define GL_MAP_READ_BIT                   0x0001\n#define GL_MAP_WRITE_BIT                  0x0002\n#define GL_MAP_INVALIDATE_RANGE_BIT       0x0004\n#define GL_MAP_INVALIDATE_BUFFER_BIT      0x0008\n#define GL_MAP_FLUSH_EXPLICIT_BIT         0x0010\n#define GL_MAP_UNSYNCHRONIZED_BIT         0x0020\n#endif\n\n#ifndef GL_ARB_texture_buffer_object\n#define GL_TEXTURE_BUFFER_ARB             0x8C2A\n#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB    0x8C2B\n#define GL_TEXTURE_BINDING_BUFFER_ARB     0x8C2C\n#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D\n#define GL_TEXTURE_BUFFER_FORMAT_ARB      0x8C2E\n#endif\n\n#ifndef GL_ARB_texture_compression_rgtc\n#define GL_COMPRESSED_RED_RGTC1           0x8DBB\n#define GL_COMPRESSED_SIGNED_RED_RGTC1    0x8DBC\n#define GL_COMPRESSED_RG_RGTC2            0x8DBD\n#define GL_COMPRESSED_SIGNED_RG_RGTC2     0x8DBE\n#endif\n\n#ifndef GL_ARB_texture_rg\n#define GL_RG                             0x8227\n#define GL_RG_INTEGER                     0x8228\n#define GL_R8                             0x8229\n#define GL_R16                            0x822A\n#define GL_RG8                            0x822B\n#define GL_RG16                           0x822C\n#define GL_R16F                           0x822D\n#define GL_R32F                           0x822E\n#define GL_RG16F                          0x822F\n#define GL_RG32F                          0x8230\n#define GL_R8I                            0x8231\n#define GL_R8UI                           0x8232\n#define GL_R16I                           0x8233\n#define GL_R16UI                          0x8234\n#define GL_R32I                           0x8235\n#define GL_R32UI                          0x8236\n#define GL_RG8I                           0x8237\n#define GL_RG8UI                          0x8238\n#define GL_RG16I                          0x8239\n#define GL_RG16UI                         0x823A\n#define GL_RG32I                          0x823B\n#define GL_RG32UI                         0x823C\n#endif\n\n#ifndef GL_ARB_vertex_array_object\n#define GL_VERTEX_ARRAY_BINDING           0x85B5\n#endif\n\n#ifndef GL_ARB_uniform_buffer_object\n#define GL_UNIFORM_BUFFER                 0x8A11\n#define GL_UNIFORM_BUFFER_BINDING         0x8A28\n#define GL_UNIFORM_BUFFER_START           0x8A29\n#define GL_UNIFORM_BUFFER_SIZE            0x8A2A\n#define GL_MAX_VERTEX_UNIFORM_BLOCKS      0x8A2B\n#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS    0x8A2C\n#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS    0x8A2D\n#define GL_MAX_COMBINED_UNIFORM_BLOCKS    0x8A2E\n#define GL_MAX_UNIFORM_BUFFER_BINDINGS    0x8A2F\n#define GL_MAX_UNIFORM_BLOCK_SIZE         0x8A30\n#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31\n#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32\n#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33\n#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34\n#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35\n#define GL_ACTIVE_UNIFORM_BLOCKS          0x8A36\n#define GL_UNIFORM_TYPE                   0x8A37\n#define GL_UNIFORM_SIZE                   0x8A38\n#define GL_UNIFORM_NAME_LENGTH            0x8A39\n#define GL_UNIFORM_BLOCK_INDEX            0x8A3A\n#define GL_UNIFORM_OFFSET                 0x8A3B\n#define GL_UNIFORM_ARRAY_STRIDE           0x8A3C\n#define GL_UNIFORM_MATRIX_STRIDE          0x8A3D\n#define GL_UNIFORM_IS_ROW_MAJOR           0x8A3E\n#define GL_UNIFORM_BLOCK_BINDING          0x8A3F\n#define GL_UNIFORM_BLOCK_DATA_SIZE        0x8A40\n#define GL_UNIFORM_BLOCK_NAME_LENGTH      0x8A41\n#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS  0x8A42\n#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46\n#define GL_INVALID_INDEX                  0xFFFFFFFFu\n#endif\n\n#ifndef GL_ARB_compatibility\n/* ARB_compatibility just defines tokens from core 3.0 */\n#endif\n\n#ifndef GL_ARB_copy_buffer\n#define GL_COPY_READ_BUFFER_BINDING       0x8F36\n#define GL_COPY_READ_BUFFER               GL_COPY_READ_BUFFER_BINDING\n#define GL_COPY_WRITE_BUFFER_BINDING      0x8F37\n#define GL_COPY_WRITE_BUFFER              GL_COPY_WRITE_BUFFER_BINDING\n#endif\n\n#ifndef GL_ARB_shader_texture_lod\n#endif\n\n#ifndef GL_ARB_depth_clamp\n#define GL_DEPTH_CLAMP                    0x864F\n#endif\n\n#ifndef GL_ARB_draw_elements_base_vertex\n#endif\n\n#ifndef GL_ARB_fragment_coord_conventions\n#endif\n\n#ifndef GL_ARB_provoking_vertex\n#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C\n#define GL_FIRST_VERTEX_CONVENTION        0x8E4D\n#define GL_LAST_VERTEX_CONVENTION         0x8E4E\n#define GL_PROVOKING_VERTEX               0x8E4F\n#endif\n\n#ifndef GL_ARB_seamless_cube_map\n#define GL_TEXTURE_CUBE_MAP_SEAMLESS      0x884F\n#endif\n\n#ifndef GL_ARB_sync\n#define GL_MAX_SERVER_WAIT_TIMEOUT        0x9111\n#define GL_OBJECT_TYPE                    0x9112\n#define GL_SYNC_CONDITION                 0x9113\n#define GL_SYNC_STATUS                    0x9114\n#define GL_SYNC_FLAGS                     0x9115\n#define GL_SYNC_FENCE                     0x9116\n#define GL_SYNC_GPU_COMMANDS_COMPLETE     0x9117\n#define GL_UNSIGNALED                     0x9118\n#define GL_SIGNALED                       0x9119\n#define GL_ALREADY_SIGNALED               0x911A\n#define GL_TIMEOUT_EXPIRED                0x911B\n#define GL_CONDITION_SATISFIED            0x911C\n#define GL_WAIT_FAILED                    0x911D\n#define GL_SYNC_FLUSH_COMMANDS_BIT        0x00000001\n#define GL_TIMEOUT_IGNORED                0xFFFFFFFFFFFFFFFFull\n#endif\n\n#ifndef GL_ARB_texture_multisample\n#define GL_SAMPLE_POSITION                0x8E50\n#define GL_SAMPLE_MASK                    0x8E51\n#define GL_SAMPLE_MASK_VALUE              0x8E52\n#define GL_MAX_SAMPLE_MASK_WORDS          0x8E59\n#define GL_TEXTURE_2D_MULTISAMPLE         0x9100\n#define GL_PROXY_TEXTURE_2D_MULTISAMPLE   0x9101\n#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY   0x9102\n#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103\n#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104\n#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105\n#define GL_TEXTURE_SAMPLES                0x9106\n#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107\n#define GL_SAMPLER_2D_MULTISAMPLE         0x9108\n#define GL_INT_SAMPLER_2D_MULTISAMPLE     0x9109\n#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A\n#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY   0x910B\n#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C\n#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D\n#define GL_MAX_COLOR_TEXTURE_SAMPLES      0x910E\n#define GL_MAX_DEPTH_TEXTURE_SAMPLES      0x910F\n#define GL_MAX_INTEGER_SAMPLES            0x9110\n#endif\n\n#ifndef GL_ARB_vertex_array_bgra\n/* reuse GL_BGRA */\n#endif\n\n#ifndef GL_ARB_draw_buffers_blend\n#endif\n\n#ifndef GL_ARB_sample_shading\n#define GL_SAMPLE_SHADING_ARB             0x8C36\n#define GL_MIN_SAMPLE_SHADING_VALUE_ARB   0x8C37\n#endif\n\n#ifndef GL_ARB_texture_cube_map_array\n#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB     0x9009\n#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A\n#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B\n#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB     0x900C\n#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D\n#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E\n#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F\n#endif\n\n#ifndef GL_ARB_texture_gather\n#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F\n#endif\n\n#ifndef GL_ARB_texture_query_lod\n#endif\n\n#ifndef GL_ARB_shading_language_include\n#define GL_SHADER_INCLUDE_ARB             0x8DAE\n#define GL_NAMED_STRING_LENGTH_ARB        0x8DE9\n#define GL_NAMED_STRING_TYPE_ARB          0x8DEA\n#endif\n\n#ifndef GL_ARB_texture_compression_bptc\n#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C\n#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D\n#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E\n#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F\n#endif\n\n#ifndef GL_ARB_blend_func_extended\n#define GL_SRC1_COLOR                     0x88F9\n/* reuse GL_SRC1_ALPHA */\n#define GL_ONE_MINUS_SRC1_COLOR           0x88FA\n#define GL_ONE_MINUS_SRC1_ALPHA           0x88FB\n#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS   0x88FC\n#endif\n\n#ifndef GL_ARB_explicit_attrib_location\n#endif\n\n#ifndef GL_ARB_occlusion_query2\n#define GL_ANY_SAMPLES_PASSED             0x8C2F\n#endif\n\n#ifndef GL_ARB_sampler_objects\n#define GL_SAMPLER_BINDING                0x8919\n#endif\n\n#ifndef GL_ARB_shader_bit_encoding\n#endif\n\n#ifndef GL_ARB_texture_rgb10_a2ui\n#define GL_RGB10_A2UI                     0x906F\n#endif\n\n#ifndef GL_ARB_texture_swizzle\n#define GL_TEXTURE_SWIZZLE_R              0x8E42\n#define GL_TEXTURE_SWIZZLE_G              0x8E43\n#define GL_TEXTURE_SWIZZLE_B              0x8E44\n#define GL_TEXTURE_SWIZZLE_A              0x8E45\n#define GL_TEXTURE_SWIZZLE_RGBA           0x8E46\n#endif\n\n#ifndef GL_ARB_timer_query\n#define GL_TIME_ELAPSED                   0x88BF\n#define GL_TIMESTAMP                      0x8E28\n#endif\n\n#ifndef GL_ARB_vertex_type_2_10_10_10_rev\n/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */\n#define GL_INT_2_10_10_10_REV             0x8D9F\n#endif\n\n#ifndef GL_ARB_draw_indirect\n#define GL_DRAW_INDIRECT_BUFFER           0x8F3F\n#define GL_DRAW_INDIRECT_BUFFER_BINDING   0x8F43\n#endif\n\n#ifndef GL_ARB_gpu_shader5\n#define GL_GEOMETRY_SHADER_INVOCATIONS    0x887F\n#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A\n#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B\n#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C\n#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D\n/* reuse GL_MAX_VERTEX_STREAMS */\n#endif\n\n#ifndef GL_ARB_gpu_shader_fp64\n/* reuse GL_DOUBLE */\n#define GL_DOUBLE_VEC2                    0x8FFC\n#define GL_DOUBLE_VEC3                    0x8FFD\n#define GL_DOUBLE_VEC4                    0x8FFE\n#define GL_DOUBLE_MAT2                    0x8F46\n#define GL_DOUBLE_MAT3                    0x8F47\n#define GL_DOUBLE_MAT4                    0x8F48\n#define GL_DOUBLE_MAT2x3                  0x8F49\n#define GL_DOUBLE_MAT2x4                  0x8F4A\n#define GL_DOUBLE_MAT3x2                  0x8F4B\n#define GL_DOUBLE_MAT3x4                  0x8F4C\n#define GL_DOUBLE_MAT4x2                  0x8F4D\n#define GL_DOUBLE_MAT4x3                  0x8F4E\n#endif\n\n#ifndef GL_ARB_shader_subroutine\n#define GL_ACTIVE_SUBROUTINES             0x8DE5\n#define GL_ACTIVE_SUBROUTINE_UNIFORMS     0x8DE6\n#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47\n#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH   0x8E48\n#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49\n#define GL_MAX_SUBROUTINES                0x8DE7\n#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8\n#define GL_NUM_COMPATIBLE_SUBROUTINES     0x8E4A\n#define GL_COMPATIBLE_SUBROUTINES         0x8E4B\n/* reuse GL_UNIFORM_SIZE */\n/* reuse GL_UNIFORM_NAME_LENGTH */\n#endif\n\n#ifndef GL_ARB_tessellation_shader\n#define GL_PATCHES                        0x000E\n#define GL_PATCH_VERTICES                 0x8E72\n#define GL_PATCH_DEFAULT_INNER_LEVEL      0x8E73\n#define GL_PATCH_DEFAULT_OUTER_LEVEL      0x8E74\n#define GL_TESS_CONTROL_OUTPUT_VERTICES   0x8E75\n#define GL_TESS_GEN_MODE                  0x8E76\n#define GL_TESS_GEN_SPACING               0x8E77\n#define GL_TESS_GEN_VERTEX_ORDER          0x8E78\n#define GL_TESS_GEN_POINT_MODE            0x8E79\n/* reuse GL_TRIANGLES */\n/* reuse GL_QUADS */\n#define GL_ISOLINES                       0x8E7A\n/* reuse GL_EQUAL */\n#define GL_FRACTIONAL_ODD                 0x8E7B\n#define GL_FRACTIONAL_EVEN                0x8E7C\n/* reuse GL_CCW */\n/* reuse GL_CW */\n#define GL_MAX_PATCH_VERTICES             0x8E7D\n#define GL_MAX_TESS_GEN_LEVEL             0x8E7E\n#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F\n#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80\n#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81\n#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82\n#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83\n#define GL_MAX_TESS_PATCH_COMPONENTS      0x8E84\n#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85\n#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86\n#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89\n#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A\n#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C\n#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D\n#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E\n#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1\n#define GL_TESS_EVALUATION_SHADER         0x8E87\n#define GL_TESS_CONTROL_SHADER            0x8E88\n#endif\n\n#ifndef GL_ARB_texture_buffer_object_rgb32\n/* reuse GL_RGB32F */\n/* reuse GL_RGB32UI */\n/* reuse GL_RGB32I */\n#endif\n\n#ifndef GL_ARB_transform_feedback2\n#define GL_TRANSFORM_FEEDBACK             0x8E22\n#define GL_TRANSFORM_FEEDBACK_PAUSED      0x8E23\n#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED GL_TRANSFORM_FEEDBACK_PAUSED\n#define GL_TRANSFORM_FEEDBACK_ACTIVE      0x8E24\n#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE GL_TRANSFORM_FEEDBACK_ACTIVE\n#define GL_TRANSFORM_FEEDBACK_BINDING     0x8E25\n#endif\n\n#ifndef GL_ARB_transform_feedback3\n#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70\n#define GL_MAX_VERTEX_STREAMS             0x8E71\n#endif\n\n#ifndef GL_ARB_ES2_compatibility\n#define GL_FIXED                          0x140C\n#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A\n#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B\n#define GL_LOW_FLOAT                      0x8DF0\n#define GL_MEDIUM_FLOAT                   0x8DF1\n#define GL_HIGH_FLOAT                     0x8DF2\n#define GL_LOW_INT                        0x8DF3\n#define GL_MEDIUM_INT                     0x8DF4\n#define GL_HIGH_INT                       0x8DF5\n#define GL_SHADER_COMPILER                0x8DFA\n#define GL_SHADER_BINARY_FORMATS          0x8DF8\n#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9\n#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB\n#define GL_MAX_VARYING_VECTORS            0x8DFC\n#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD\n#define GL_RGB565                         0x8D62\n#endif\n\n#ifndef GL_ARB_get_program_binary\n#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257\n#define GL_PROGRAM_BINARY_LENGTH          0x8741\n#define GL_NUM_PROGRAM_BINARY_FORMATS     0x87FE\n#define GL_PROGRAM_BINARY_FORMATS         0x87FF\n#endif\n\n#ifndef GL_ARB_separate_shader_objects\n#define GL_VERTEX_SHADER_BIT              0x00000001\n#define GL_FRAGMENT_SHADER_BIT            0x00000002\n#define GL_GEOMETRY_SHADER_BIT            0x00000004\n#define GL_TESS_CONTROL_SHADER_BIT        0x00000008\n#define GL_TESS_EVALUATION_SHADER_BIT     0x00000010\n#define GL_ALL_SHADER_BITS                0xFFFFFFFF\n#define GL_PROGRAM_SEPARABLE              0x8258\n#define GL_ACTIVE_PROGRAM                 0x8259\n#define GL_PROGRAM_PIPELINE_BINDING       0x825A\n#endif\n\n#ifndef GL_ARB_shader_precision\n#endif\n\n#ifndef GL_ARB_vertex_attrib_64bit\n/* reuse GL_RGB32I */\n/* reuse GL_DOUBLE_VEC2 */\n/* reuse GL_DOUBLE_VEC3 */\n/* reuse GL_DOUBLE_VEC4 */\n/* reuse GL_DOUBLE_MAT2 */\n/* reuse GL_DOUBLE_MAT3 */\n/* reuse GL_DOUBLE_MAT4 */\n/* reuse GL_DOUBLE_MAT2x3 */\n/* reuse GL_DOUBLE_MAT2x4 */\n/* reuse GL_DOUBLE_MAT3x2 */\n/* reuse GL_DOUBLE_MAT3x4 */\n/* reuse GL_DOUBLE_MAT4x2 */\n/* reuse GL_DOUBLE_MAT4x3 */\n#endif\n\n#ifndef GL_ARB_viewport_array\n/* reuse GL_SCISSOR_BOX */\n/* reuse GL_VIEWPORT */\n/* reuse GL_DEPTH_RANGE */\n/* reuse GL_SCISSOR_TEST */\n#define GL_MAX_VIEWPORTS                  0x825B\n#define GL_VIEWPORT_SUBPIXEL_BITS         0x825C\n#define GL_VIEWPORT_BOUNDS_RANGE          0x825D\n#define GL_LAYER_PROVOKING_VERTEX         0x825E\n#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F\n#define GL_UNDEFINED_VERTEX               0x8260\n/* reuse GL_FIRST_VERTEX_CONVENTION */\n/* reuse GL_LAST_VERTEX_CONVENTION */\n/* reuse GL_PROVOKING_VERTEX */\n#endif\n\n#ifndef GL_ARB_cl_event\n#define GL_SYNC_CL_EVENT_ARB              0x8240\n#define GL_SYNC_CL_EVENT_COMPLETE_ARB     0x8241\n#endif\n\n#ifndef GL_ARB_debug_output\n#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB   0x8242\n#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243\n#define GL_DEBUG_CALLBACK_FUNCTION_ARB    0x8244\n#define GL_DEBUG_CALLBACK_USER_PARAM_ARB  0x8245\n#define GL_DEBUG_SOURCE_API_ARB           0x8246\n#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247\n#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248\n#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB   0x8249\n#define GL_DEBUG_SOURCE_APPLICATION_ARB   0x824A\n#define GL_DEBUG_SOURCE_OTHER_ARB         0x824B\n#define GL_DEBUG_TYPE_ERROR_ARB           0x824C\n#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D\n#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E\n#define GL_DEBUG_TYPE_PORTABILITY_ARB     0x824F\n#define GL_DEBUG_TYPE_PERFORMANCE_ARB     0x8250\n#define GL_DEBUG_TYPE_OTHER_ARB           0x8251\n#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB   0x9143\n#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB  0x9144\n#define GL_DEBUG_LOGGED_MESSAGES_ARB      0x9145\n#define GL_DEBUG_SEVERITY_HIGH_ARB        0x9146\n#define GL_DEBUG_SEVERITY_MEDIUM_ARB      0x9147\n#define GL_DEBUG_SEVERITY_LOW_ARB         0x9148\n#endif\n\n#ifndef GL_ARB_robustness\n/* reuse GL_NO_ERROR */\n#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004\n#define GL_LOSE_CONTEXT_ON_RESET_ARB      0x8252\n#define GL_GUILTY_CONTEXT_RESET_ARB       0x8253\n#define GL_INNOCENT_CONTEXT_RESET_ARB     0x8254\n#define GL_UNKNOWN_CONTEXT_RESET_ARB      0x8255\n#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256\n#define GL_NO_RESET_NOTIFICATION_ARB      0x8261\n#endif\n\n#ifndef GL_ARB_shader_stencil_export\n#endif\n\n#ifndef GL_ARB_base_instance\n#endif\n\n#ifndef GL_ARB_shading_language_420pack\n#endif\n\n#ifndef GL_ARB_transform_feedback_instanced\n#endif\n\n#ifndef GL_ARB_compressed_texture_pixel_storage\n#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH  0x9127\n#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128\n#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH  0x9129\n#define GL_UNPACK_COMPRESSED_BLOCK_SIZE   0x912A\n#define GL_PACK_COMPRESSED_BLOCK_WIDTH    0x912B\n#define GL_PACK_COMPRESSED_BLOCK_HEIGHT   0x912C\n#define GL_PACK_COMPRESSED_BLOCK_DEPTH    0x912D\n#define GL_PACK_COMPRESSED_BLOCK_SIZE     0x912E\n#endif\n\n#ifndef GL_ARB_conservative_depth\n#endif\n\n#ifndef GL_ARB_internalformat_query\n#define GL_NUM_SAMPLE_COUNTS              0x9380\n#endif\n\n#ifndef GL_ARB_map_buffer_alignment\n#define GL_MIN_MAP_BUFFER_ALIGNMENT       0x90BC\n#endif\n\n#ifndef GL_ARB_shader_atomic_counters\n#define GL_ATOMIC_COUNTER_BUFFER          0x92C0\n#define GL_ATOMIC_COUNTER_BUFFER_BINDING  0x92C1\n#define GL_ATOMIC_COUNTER_BUFFER_START    0x92C2\n#define GL_ATOMIC_COUNTER_BUFFER_SIZE     0x92C3\n#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4\n#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5\n#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB\n#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC\n#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD\n#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE\n#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF\n#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0\n#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1\n#define GL_MAX_VERTEX_ATOMIC_COUNTERS     0x92D2\n#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3\n#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4\n#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS   0x92D5\n#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS   0x92D6\n#define GL_MAX_COMBINED_ATOMIC_COUNTERS   0x92D7\n#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8\n#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC\n#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS  0x92D9\n#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA\n#define GL_UNSIGNED_INT_ATOMIC_COUNTER    0x92DB\n#endif\n\n#ifndef GL_ARB_shader_image_load_store\n#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001\n#define GL_ELEMENT_ARRAY_BARRIER_BIT      0x00000002\n#define GL_UNIFORM_BARRIER_BIT            0x00000004\n#define GL_TEXTURE_FETCH_BARRIER_BIT      0x00000008\n#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020\n#define GL_COMMAND_BARRIER_BIT            0x00000040\n#define GL_PIXEL_BUFFER_BARRIER_BIT       0x00000080\n#define GL_TEXTURE_UPDATE_BARRIER_BIT     0x00000100\n#define GL_BUFFER_UPDATE_BARRIER_BIT      0x00000200\n#define GL_FRAMEBUFFER_BARRIER_BIT        0x00000400\n#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800\n#define GL_ATOMIC_COUNTER_BARRIER_BIT     0x00001000\n#define GL_ALL_BARRIER_BITS               0xFFFFFFFF\n#define GL_MAX_IMAGE_UNITS                0x8F38\n#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39\n#define GL_IMAGE_BINDING_NAME             0x8F3A\n#define GL_IMAGE_BINDING_LEVEL            0x8F3B\n#define GL_IMAGE_BINDING_LAYERED          0x8F3C\n#define GL_IMAGE_BINDING_LAYER            0x8F3D\n#define GL_IMAGE_BINDING_ACCESS           0x8F3E\n#define GL_IMAGE_1D                       0x904C\n#define GL_IMAGE_2D                       0x904D\n#define GL_IMAGE_3D                       0x904E\n#define GL_IMAGE_2D_RECT                  0x904F\n#define GL_IMAGE_CUBE                     0x9050\n#define GL_IMAGE_BUFFER                   0x9051\n#define GL_IMAGE_1D_ARRAY                 0x9052\n#define GL_IMAGE_2D_ARRAY                 0x9053\n#define GL_IMAGE_CUBE_MAP_ARRAY           0x9054\n#define GL_IMAGE_2D_MULTISAMPLE           0x9055\n#define GL_IMAGE_2D_MULTISAMPLE_ARRAY     0x9056\n#define GL_INT_IMAGE_1D                   0x9057\n#define GL_INT_IMAGE_2D                   0x9058\n#define GL_INT_IMAGE_3D                   0x9059\n#define GL_INT_IMAGE_2D_RECT              0x905A\n#define GL_INT_IMAGE_CUBE                 0x905B\n#define GL_INT_IMAGE_BUFFER               0x905C\n#define GL_INT_IMAGE_1D_ARRAY             0x905D\n#define GL_INT_IMAGE_2D_ARRAY             0x905E\n#define GL_INT_IMAGE_CUBE_MAP_ARRAY       0x905F\n#define GL_INT_IMAGE_2D_MULTISAMPLE       0x9060\n#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061\n#define GL_UNSIGNED_INT_IMAGE_1D          0x9062\n#define GL_UNSIGNED_INT_IMAGE_2D          0x9063\n#define GL_UNSIGNED_INT_IMAGE_3D          0x9064\n#define GL_UNSIGNED_INT_IMAGE_2D_RECT     0x9065\n#define GL_UNSIGNED_INT_IMAGE_CUBE        0x9066\n#define GL_UNSIGNED_INT_IMAGE_BUFFER      0x9067\n#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY    0x9068\n#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY    0x9069\n#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A\n#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B\n#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C\n#define GL_MAX_IMAGE_SAMPLES              0x906D\n#define GL_IMAGE_BINDING_FORMAT           0x906E\n#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7\n#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8\n#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9\n#define GL_MAX_VERTEX_IMAGE_UNIFORMS      0x90CA\n#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB\n#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC\n#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS    0x90CD\n#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS    0x90CE\n#define GL_MAX_COMBINED_IMAGE_UNIFORMS    0x90CF\n#endif\n\n#ifndef GL_ARB_shading_language_packing\n#endif\n\n#ifndef GL_ARB_texture_storage\n#define GL_TEXTURE_IMMUTABLE_FORMAT       0x912F\n#endif\n\n#ifndef GL_KHR_texture_compression_astc_ldr\n#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR   0x93B0\n#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR   0x93B1\n#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR   0x93B2\n#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR   0x93B3\n#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR   0x93B4\n#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR   0x93B5\n#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR   0x93B6\n#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR   0x93B7\n#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR  0x93B8\n#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR  0x93B9\n#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR  0x93BA\n#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB\n#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC\n#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC\n#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD\n#endif\n\n#ifndef GL_KHR_debug\n#define GL_DEBUG_OUTPUT_SYNCHRONOUS       0x8242\n#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243\n#define GL_DEBUG_CALLBACK_FUNCTION        0x8244\n#define GL_DEBUG_CALLBACK_USER_PARAM      0x8245\n#define GL_DEBUG_SOURCE_API               0x8246\n#define GL_DEBUG_SOURCE_WINDOW_SYSTEM     0x8247\n#define GL_DEBUG_SOURCE_SHADER_COMPILER   0x8248\n#define GL_DEBUG_SOURCE_THIRD_PARTY       0x8249\n#define GL_DEBUG_SOURCE_APPLICATION       0x824A\n#define GL_DEBUG_SOURCE_OTHER             0x824B\n#define GL_DEBUG_TYPE_ERROR               0x824C\n#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D\n#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR  0x824E\n#define GL_DEBUG_TYPE_PORTABILITY         0x824F\n#define GL_DEBUG_TYPE_PERFORMANCE         0x8250\n#define GL_DEBUG_TYPE_OTHER               0x8251\n#define GL_DEBUG_TYPE_MARKER              0x8268\n#define GL_DEBUG_TYPE_PUSH_GROUP          0x8269\n#define GL_DEBUG_TYPE_POP_GROUP           0x826A\n#define GL_DEBUG_SEVERITY_NOTIFICATION    0x826B\n#define GL_MAX_DEBUG_GROUP_STACK_DEPTH    0x826C\n#define GL_DEBUG_GROUP_STACK_DEPTH        0x826D\n#define GL_BUFFER                         0x82E0\n#define GL_SHADER                         0x82E1\n#define GL_PROGRAM                        0x82E2\n#define GL_QUERY                          0x82E3\n#define GL_PROGRAM_PIPELINE               0x82E4\n#define GL_SAMPLER                        0x82E6\n#define GL_DISPLAY_LIST                   0x82E7\n/* DISPLAY_LIST used in compatibility profile only */\n#define GL_MAX_LABEL_LENGTH               0x82E8\n#define GL_MAX_DEBUG_MESSAGE_LENGTH       0x9143\n#define GL_MAX_DEBUG_LOGGED_MESSAGES      0x9144\n#define GL_DEBUG_LOGGED_MESSAGES          0x9145\n#define GL_DEBUG_SEVERITY_HIGH            0x9146\n#define GL_DEBUG_SEVERITY_MEDIUM          0x9147\n#define GL_DEBUG_SEVERITY_LOW             0x9148\n#define GL_DEBUG_OUTPUT                   0x92E0\n#define GL_CONTEXT_FLAG_DEBUG_BIT         0x00000002\n/* reuse GL_STACK_UNDERFLOW */\n/* reuse GL_STACK_OVERFLOW */\n#endif\n\n#ifndef GL_ARB_arrays_of_arrays\n#endif\n\n#ifndef GL_ARB_clear_buffer_object\n#endif\n\n#ifndef GL_ARB_compute_shader\n#define GL_COMPUTE_SHADER                 0x91B9\n#define GL_MAX_COMPUTE_UNIFORM_BLOCKS     0x91BB\n#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC\n#define GL_MAX_COMPUTE_IMAGE_UNIFORMS     0x91BD\n#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262\n#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263\n#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264\n#define GL_MAX_COMPUTE_ATOMIC_COUNTERS    0x8265\n#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266\n#define GL_MAX_COMPUTE_LOCAL_INVOCATIONS  0x90EB\n#define GL_MAX_COMPUTE_WORK_GROUP_COUNT   0x91BE\n#define GL_MAX_COMPUTE_WORK_GROUP_SIZE    0x91BF\n#define GL_COMPUTE_LOCAL_WORK_SIZE        0x8267\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED\n#define GL_DISPATCH_INDIRECT_BUFFER       0x90EE\n#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF\n#define GL_COMPUTE_SHADER_BIT             0x00000020\n#endif\n\n#ifndef GL_ARB_copy_image\n#endif\n\n#ifndef GL_ARB_texture_view\n#define GL_TEXTURE_VIEW_MIN_LEVEL         0x82DB\n#define GL_TEXTURE_VIEW_NUM_LEVELS        0x82DC\n#define GL_TEXTURE_VIEW_MIN_LAYER         0x82DD\n#define GL_TEXTURE_VIEW_NUM_LAYERS        0x82DE\n#define GL_TEXTURE_IMMUTABLE_LEVELS       0x82DF\n#endif\n\n#ifndef GL_ARB_vertex_attrib_binding\n#define GL_VERTEX_ATTRIB_BINDING          0x82D4\n#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET  0x82D5\n#define GL_VERTEX_BINDING_DIVISOR         0x82D6\n#define GL_VERTEX_BINDING_OFFSET          0x82D7\n#define GL_VERTEX_BINDING_STRIDE          0x82D8\n#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9\n#define GL_MAX_VERTEX_ATTRIB_BINDINGS     0x82DA\n#endif\n\n#ifndef GL_ARB_robustness_isolation\n#endif\n\n#ifndef GL_ARB_ES3_compatibility\n#define GL_COMPRESSED_RGB8_ETC2           0x9274\n#define GL_COMPRESSED_SRGB8_ETC2          0x9275\n#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276\n#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277\n#define GL_COMPRESSED_RGBA8_ETC2_EAC      0x9278\n#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279\n#define GL_COMPRESSED_R11_EAC             0x9270\n#define GL_COMPRESSED_SIGNED_R11_EAC      0x9271\n#define GL_COMPRESSED_RG11_EAC            0x9272\n#define GL_COMPRESSED_SIGNED_RG11_EAC     0x9273\n#define GL_PRIMITIVE_RESTART_FIXED_INDEX  0x8D69\n#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A\n#define GL_MAX_ELEMENT_INDEX              0x8D6B\n#endif\n\n#ifndef GL_ARB_explicit_uniform_location\n#define GL_MAX_UNIFORM_LOCATIONS          0x826E\n#endif\n\n#ifndef GL_ARB_fragment_layer_viewport\n#endif\n\n#ifndef GL_ARB_framebuffer_no_attachments\n#define GL_FRAMEBUFFER_DEFAULT_WIDTH      0x9310\n#define GL_FRAMEBUFFER_DEFAULT_HEIGHT     0x9311\n#define GL_FRAMEBUFFER_DEFAULT_LAYERS     0x9312\n#define GL_FRAMEBUFFER_DEFAULT_SAMPLES    0x9313\n#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314\n#define GL_MAX_FRAMEBUFFER_WIDTH          0x9315\n#define GL_MAX_FRAMEBUFFER_HEIGHT         0x9316\n#define GL_MAX_FRAMEBUFFER_LAYERS         0x9317\n#define GL_MAX_FRAMEBUFFER_SAMPLES        0x9318\n#endif\n\n#ifndef GL_ARB_internalformat_query2\n/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */\n/* reuse GL_NUM_SAMPLE_COUNTS */\n/* reuse GL_RENDERBUFFER */\n/* reuse GL_SAMPLES */\n/* reuse GL_TEXTURE_1D */\n/* reuse GL_TEXTURE_1D_ARRAY */\n/* reuse GL_TEXTURE_2D */\n/* reuse GL_TEXTURE_2D_ARRAY */\n/* reuse GL_TEXTURE_3D */\n/* reuse GL_TEXTURE_CUBE_MAP */\n/* reuse GL_TEXTURE_CUBE_MAP_ARRAY */\n/* reuse GL_TEXTURE_RECTANGLE */\n/* reuse GL_TEXTURE_BUFFER */\n/* reuse GL_TEXTURE_2D_MULTISAMPLE */\n/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */\n/* reuse GL_TEXTURE_COMPRESSED */\n#define GL_INTERNALFORMAT_SUPPORTED       0x826F\n#define GL_INTERNALFORMAT_PREFERRED       0x8270\n#define GL_INTERNALFORMAT_RED_SIZE        0x8271\n#define GL_INTERNALFORMAT_GREEN_SIZE      0x8272\n#define GL_INTERNALFORMAT_BLUE_SIZE       0x8273\n#define GL_INTERNALFORMAT_ALPHA_SIZE      0x8274\n#define GL_INTERNALFORMAT_DEPTH_SIZE      0x8275\n#define GL_INTERNALFORMAT_STENCIL_SIZE    0x8276\n#define GL_INTERNALFORMAT_SHARED_SIZE     0x8277\n#define GL_INTERNALFORMAT_RED_TYPE        0x8278\n#define GL_INTERNALFORMAT_GREEN_TYPE      0x8279\n#define GL_INTERNALFORMAT_BLUE_TYPE       0x827A\n#define GL_INTERNALFORMAT_ALPHA_TYPE      0x827B\n#define GL_INTERNALFORMAT_DEPTH_TYPE      0x827C\n#define GL_INTERNALFORMAT_STENCIL_TYPE    0x827D\n#define GL_MAX_WIDTH                      0x827E\n#define GL_MAX_HEIGHT                     0x827F\n#define GL_MAX_DEPTH                      0x8280\n#define GL_MAX_LAYERS                     0x8281\n#define GL_MAX_COMBINED_DIMENSIONS        0x8282\n#define GL_COLOR_COMPONENTS               0x8283\n#define GL_DEPTH_COMPONENTS               0x8284\n#define GL_STENCIL_COMPONENTS             0x8285\n#define GL_COLOR_RENDERABLE               0x8286\n#define GL_DEPTH_RENDERABLE               0x8287\n#define GL_STENCIL_RENDERABLE             0x8288\n#define GL_FRAMEBUFFER_RENDERABLE         0x8289\n#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A\n#define GL_FRAMEBUFFER_BLEND              0x828B\n#define GL_READ_PIXELS                    0x828C\n#define GL_READ_PIXELS_FORMAT             0x828D\n#define GL_READ_PIXELS_TYPE               0x828E\n#define GL_TEXTURE_IMAGE_FORMAT           0x828F\n#define GL_TEXTURE_IMAGE_TYPE             0x8290\n#define GL_GET_TEXTURE_IMAGE_FORMAT       0x8291\n#define GL_GET_TEXTURE_IMAGE_TYPE         0x8292\n#define GL_MIPMAP                         0x8293\n#define GL_MANUAL_GENERATE_MIPMAP         0x8294\n#define GL_AUTO_GENERATE_MIPMAP           0x8295\n#define GL_COLOR_ENCODING                 0x8296\n#define GL_SRGB_READ                      0x8297\n#define GL_SRGB_WRITE                     0x8298\n#define GL_SRGB_DECODE_ARB                0x8299\n#define GL_FILTER                         0x829A\n#define GL_VERTEX_TEXTURE                 0x829B\n#define GL_TESS_CONTROL_TEXTURE           0x829C\n#define GL_TESS_EVALUATION_TEXTURE        0x829D\n#define GL_GEOMETRY_TEXTURE               0x829E\n#define GL_FRAGMENT_TEXTURE               0x829F\n#define GL_COMPUTE_TEXTURE                0x82A0\n#define GL_TEXTURE_SHADOW                 0x82A1\n#define GL_TEXTURE_GATHER                 0x82A2\n#define GL_TEXTURE_GATHER_SHADOW          0x82A3\n#define GL_SHADER_IMAGE_LOAD              0x82A4\n#define GL_SHADER_IMAGE_STORE             0x82A5\n#define GL_SHADER_IMAGE_ATOMIC            0x82A6\n#define GL_IMAGE_TEXEL_SIZE               0x82A7\n#define GL_IMAGE_COMPATIBILITY_CLASS      0x82A8\n#define GL_IMAGE_PIXEL_FORMAT             0x82A9\n#define GL_IMAGE_PIXEL_TYPE               0x82AA\n#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC\n#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD\n#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE\n#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF\n#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1\n#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2\n#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE  0x82B3\n#define GL_CLEAR_BUFFER                   0x82B4\n#define GL_TEXTURE_VIEW                   0x82B5\n#define GL_VIEW_COMPATIBILITY_CLASS       0x82B6\n#define GL_FULL_SUPPORT                   0x82B7\n#define GL_CAVEAT_SUPPORT                 0x82B8\n#define GL_IMAGE_CLASS_4_X_32             0x82B9\n#define GL_IMAGE_CLASS_2_X_32             0x82BA\n#define GL_IMAGE_CLASS_1_X_32             0x82BB\n#define GL_IMAGE_CLASS_4_X_16             0x82BC\n#define GL_IMAGE_CLASS_2_X_16             0x82BD\n#define GL_IMAGE_CLASS_1_X_16             0x82BE\n#define GL_IMAGE_CLASS_4_X_8              0x82BF\n#define GL_IMAGE_CLASS_2_X_8              0x82C0\n#define GL_IMAGE_CLASS_1_X_8              0x82C1\n#define GL_IMAGE_CLASS_11_11_10           0x82C2\n#define GL_IMAGE_CLASS_10_10_10_2         0x82C3\n#define GL_VIEW_CLASS_128_BITS            0x82C4\n#define GL_VIEW_CLASS_96_BITS             0x82C5\n#define GL_VIEW_CLASS_64_BITS             0x82C6\n#define GL_VIEW_CLASS_48_BITS             0x82C7\n#define GL_VIEW_CLASS_32_BITS             0x82C8\n#define GL_VIEW_CLASS_24_BITS             0x82C9\n#define GL_VIEW_CLASS_16_BITS             0x82CA\n#define GL_VIEW_CLASS_8_BITS              0x82CB\n#define GL_VIEW_CLASS_S3TC_DXT1_RGB       0x82CC\n#define GL_VIEW_CLASS_S3TC_DXT1_RGBA      0x82CD\n#define GL_VIEW_CLASS_S3TC_DXT3_RGBA      0x82CE\n#define GL_VIEW_CLASS_S3TC_DXT5_RGBA      0x82CF\n#define GL_VIEW_CLASS_RGTC1_RED           0x82D0\n#define GL_VIEW_CLASS_RGTC2_RG            0x82D1\n#define GL_VIEW_CLASS_BPTC_UNORM          0x82D2\n#define GL_VIEW_CLASS_BPTC_FLOAT          0x82D3\n#endif\n\n#ifndef GL_ARB_invalidate_subdata\n#endif\n\n#ifndef GL_ARB_multi_draw_indirect\n#endif\n\n#ifndef GL_ARB_program_interface_query\n#define GL_UNIFORM                        0x92E1\n#define GL_UNIFORM_BLOCK                  0x92E2\n#define GL_PROGRAM_INPUT                  0x92E3\n#define GL_PROGRAM_OUTPUT                 0x92E4\n#define GL_BUFFER_VARIABLE                0x92E5\n#define GL_SHADER_STORAGE_BLOCK           0x92E6\n/* reuse GL_ATOMIC_COUNTER_BUFFER */\n#define GL_VERTEX_SUBROUTINE              0x92E8\n#define GL_TESS_CONTROL_SUBROUTINE        0x92E9\n#define GL_TESS_EVALUATION_SUBROUTINE     0x92EA\n#define GL_GEOMETRY_SUBROUTINE            0x92EB\n#define GL_FRAGMENT_SUBROUTINE            0x92EC\n#define GL_COMPUTE_SUBROUTINE             0x92ED\n#define GL_VERTEX_SUBROUTINE_UNIFORM      0x92EE\n#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF\n#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0\n#define GL_GEOMETRY_SUBROUTINE_UNIFORM    0x92F1\n#define GL_FRAGMENT_SUBROUTINE_UNIFORM    0x92F2\n#define GL_COMPUTE_SUBROUTINE_UNIFORM     0x92F3\n#define GL_TRANSFORM_FEEDBACK_VARYING     0x92F4\n#define GL_ACTIVE_RESOURCES               0x92F5\n#define GL_MAX_NAME_LENGTH                0x92F6\n#define GL_MAX_NUM_ACTIVE_VARIABLES       0x92F7\n#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8\n#define GL_NAME_LENGTH                    0x92F9\n#define GL_TYPE                           0x92FA\n#define GL_ARRAY_SIZE                     0x92FB\n#define GL_OFFSET                         0x92FC\n#define GL_BLOCK_INDEX                    0x92FD\n#define GL_ARRAY_STRIDE                   0x92FE\n#define GL_MATRIX_STRIDE                  0x92FF\n#define GL_IS_ROW_MAJOR                   0x9300\n#define GL_ATOMIC_COUNTER_BUFFER_INDEX    0x9301\n#define GL_BUFFER_BINDING                 0x9302\n#define GL_BUFFER_DATA_SIZE               0x9303\n#define GL_NUM_ACTIVE_VARIABLES           0x9304\n#define GL_ACTIVE_VARIABLES               0x9305\n#define GL_REFERENCED_BY_VERTEX_SHADER    0x9306\n#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307\n#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308\n#define GL_REFERENCED_BY_GEOMETRY_SHADER  0x9309\n#define GL_REFERENCED_BY_FRAGMENT_SHADER  0x930A\n#define GL_REFERENCED_BY_COMPUTE_SHADER   0x930B\n#define GL_TOP_LEVEL_ARRAY_SIZE           0x930C\n#define GL_TOP_LEVEL_ARRAY_STRIDE         0x930D\n#define GL_LOCATION                       0x930E\n#define GL_LOCATION_INDEX                 0x930F\n#define GL_IS_PER_PATCH                   0x92E7\n/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */\n/* reuse GL_COMPATIBLE_SUBROUTINES */\n#endif\n\n#ifndef GL_ARB_robust_buffer_access_behavior\n#endif\n\n#ifndef GL_ARB_shader_image_size\n#endif\n\n#ifndef GL_ARB_shader_storage_buffer_object\n#define GL_SHADER_STORAGE_BUFFER          0x90D2\n#define GL_SHADER_STORAGE_BUFFER_BINDING  0x90D3\n#define GL_SHADER_STORAGE_BUFFER_START    0x90D4\n#define GL_SHADER_STORAGE_BUFFER_SIZE     0x90D5\n#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6\n#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7\n#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8\n#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9\n#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA\n#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB\n#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC\n#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD\n#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE  0x90DE\n#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF\n#define GL_SHADER_STORAGE_BARRIER_BIT     0x2000\n#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS\n/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */\n#endif\n\n#ifndef GL_ARB_stencil_texturing\n#define GL_DEPTH_STENCIL_TEXTURE_MODE     0x90EA\n#endif\n\n#ifndef GL_ARB_texture_buffer_range\n#define GL_TEXTURE_BUFFER_OFFSET          0x919D\n#define GL_TEXTURE_BUFFER_SIZE            0x919E\n#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F\n#endif\n\n#ifndef GL_ARB_texture_query_levels\n#endif\n\n#ifndef GL_ARB_texture_storage_multisample\n#endif\n\n#ifndef GL_EXT_abgr\n#define GL_ABGR_EXT                       0x8000\n#endif\n\n#ifndef GL_EXT_blend_color\n#define GL_CONSTANT_COLOR_EXT             0x8001\n#define GL_ONE_MINUS_CONSTANT_COLOR_EXT   0x8002\n#define GL_CONSTANT_ALPHA_EXT             0x8003\n#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT   0x8004\n#define GL_BLEND_COLOR_EXT                0x8005\n#endif\n\n#ifndef GL_EXT_polygon_offset\n#define GL_POLYGON_OFFSET_EXT             0x8037\n#define GL_POLYGON_OFFSET_FACTOR_EXT      0x8038\n#define GL_POLYGON_OFFSET_BIAS_EXT        0x8039\n#endif\n\n#ifndef GL_EXT_texture\n#define GL_ALPHA4_EXT                     0x803B\n#define GL_ALPHA8_EXT                     0x803C\n#define GL_ALPHA12_EXT                    0x803D\n#define GL_ALPHA16_EXT                    0x803E\n#define GL_LUMINANCE4_EXT                 0x803F\n#define GL_LUMINANCE8_EXT                 0x8040\n#define GL_LUMINANCE12_EXT                0x8041\n#define GL_LUMINANCE16_EXT                0x8042\n#define GL_LUMINANCE4_ALPHA4_EXT          0x8043\n#define GL_LUMINANCE6_ALPHA2_EXT          0x8044\n#define GL_LUMINANCE8_ALPHA8_EXT          0x8045\n#define GL_LUMINANCE12_ALPHA4_EXT         0x8046\n#define GL_LUMINANCE12_ALPHA12_EXT        0x8047\n#define GL_LUMINANCE16_ALPHA16_EXT        0x8048\n#define GL_INTENSITY_EXT                  0x8049\n#define GL_INTENSITY4_EXT                 0x804A\n#define GL_INTENSITY8_EXT                 0x804B\n#define GL_INTENSITY12_EXT                0x804C\n#define GL_INTENSITY16_EXT                0x804D\n#define GL_RGB2_EXT                       0x804E\n#define GL_RGB4_EXT                       0x804F\n#define GL_RGB5_EXT                       0x8050\n#define GL_RGB8_EXT                       0x8051\n#define GL_RGB10_EXT                      0x8052\n#define GL_RGB12_EXT                      0x8053\n#define GL_RGB16_EXT                      0x8054\n#define GL_RGBA2_EXT                      0x8055\n#define GL_RGBA4_EXT                      0x8056\n#define GL_RGB5_A1_EXT                    0x8057\n#define GL_RGBA8_EXT                      0x8058\n#define GL_RGB10_A2_EXT                   0x8059\n#define GL_RGBA12_EXT                     0x805A\n#define GL_RGBA16_EXT                     0x805B\n#define GL_TEXTURE_RED_SIZE_EXT           0x805C\n#define GL_TEXTURE_GREEN_SIZE_EXT         0x805D\n#define GL_TEXTURE_BLUE_SIZE_EXT          0x805E\n#define GL_TEXTURE_ALPHA_SIZE_EXT         0x805F\n#define GL_TEXTURE_LUMINANCE_SIZE_EXT     0x8060\n#define GL_TEXTURE_INTENSITY_SIZE_EXT     0x8061\n#define GL_REPLACE_EXT                    0x8062\n#define GL_PROXY_TEXTURE_1D_EXT           0x8063\n#define GL_PROXY_TEXTURE_2D_EXT           0x8064\n#define GL_TEXTURE_TOO_LARGE_EXT          0x8065\n#endif\n\n#ifndef GL_EXT_texture3D\n#define GL_PACK_SKIP_IMAGES_EXT           0x806B\n#define GL_PACK_IMAGE_HEIGHT_EXT          0x806C\n#define GL_UNPACK_SKIP_IMAGES_EXT         0x806D\n#define GL_UNPACK_IMAGE_HEIGHT_EXT        0x806E\n#define GL_TEXTURE_3D_EXT                 0x806F\n#define GL_PROXY_TEXTURE_3D_EXT           0x8070\n#define GL_TEXTURE_DEPTH_EXT              0x8071\n#define GL_TEXTURE_WRAP_R_EXT             0x8072\n#define GL_MAX_3D_TEXTURE_SIZE_EXT        0x8073\n#endif\n\n#ifndef GL_SGIS_texture_filter4\n#define GL_FILTER4_SGIS                   0x8146\n#define GL_TEXTURE_FILTER4_SIZE_SGIS      0x8147\n#endif\n\n#ifndef GL_EXT_subtexture\n#endif\n\n#ifndef GL_EXT_copy_texture\n#endif\n\n#ifndef GL_EXT_histogram\n#define GL_HISTOGRAM_EXT                  0x8024\n#define GL_PROXY_HISTOGRAM_EXT            0x8025\n#define GL_HISTOGRAM_WIDTH_EXT            0x8026\n#define GL_HISTOGRAM_FORMAT_EXT           0x8027\n#define GL_HISTOGRAM_RED_SIZE_EXT         0x8028\n#define GL_HISTOGRAM_GREEN_SIZE_EXT       0x8029\n#define GL_HISTOGRAM_BLUE_SIZE_EXT        0x802A\n#define GL_HISTOGRAM_ALPHA_SIZE_EXT       0x802B\n#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT   0x802C\n#define GL_HISTOGRAM_SINK_EXT             0x802D\n#define GL_MINMAX_EXT                     0x802E\n#define GL_MINMAX_FORMAT_EXT              0x802F\n#define GL_MINMAX_SINK_EXT                0x8030\n#define GL_TABLE_TOO_LARGE_EXT            0x8031\n#endif\n\n#ifndef GL_EXT_convolution\n#define GL_CONVOLUTION_1D_EXT             0x8010\n#define GL_CONVOLUTION_2D_EXT             0x8011\n#define GL_SEPARABLE_2D_EXT               0x8012\n#define GL_CONVOLUTION_BORDER_MODE_EXT    0x8013\n#define GL_CONVOLUTION_FILTER_SCALE_EXT   0x8014\n#define GL_CONVOLUTION_FILTER_BIAS_EXT    0x8015\n#define GL_REDUCE_EXT                     0x8016\n#define GL_CONVOLUTION_FORMAT_EXT         0x8017\n#define GL_CONVOLUTION_WIDTH_EXT          0x8018\n#define GL_CONVOLUTION_HEIGHT_EXT         0x8019\n#define GL_MAX_CONVOLUTION_WIDTH_EXT      0x801A\n#define GL_MAX_CONVOLUTION_HEIGHT_EXT     0x801B\n#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C\n#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D\n#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E\n#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F\n#define GL_POST_CONVOLUTION_RED_BIAS_EXT  0x8020\n#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021\n#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022\n#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023\n#endif\n\n#ifndef GL_SGI_color_matrix\n#define GL_COLOR_MATRIX_SGI               0x80B1\n#define GL_COLOR_MATRIX_STACK_DEPTH_SGI   0x80B2\n#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3\n#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4\n#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5\n#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6\n#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7\n#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8\n#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9\n#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA\n#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB\n#endif\n\n#ifndef GL_SGI_color_table\n#define GL_COLOR_TABLE_SGI                0x80D0\n#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1\n#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2\n#define GL_PROXY_COLOR_TABLE_SGI          0x80D3\n#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4\n#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5\n#define GL_COLOR_TABLE_SCALE_SGI          0x80D6\n#define GL_COLOR_TABLE_BIAS_SGI           0x80D7\n#define GL_COLOR_TABLE_FORMAT_SGI         0x80D8\n#define GL_COLOR_TABLE_WIDTH_SGI          0x80D9\n#define GL_COLOR_TABLE_RED_SIZE_SGI       0x80DA\n#define GL_COLOR_TABLE_GREEN_SIZE_SGI     0x80DB\n#define GL_COLOR_TABLE_BLUE_SIZE_SGI      0x80DC\n#define GL_COLOR_TABLE_ALPHA_SIZE_SGI     0x80DD\n#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE\n#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF\n#endif\n\n#ifndef GL_SGIS_pixel_texture\n#define GL_PIXEL_TEXTURE_SGIS             0x8353\n#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354\n#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355\n#define GL_PIXEL_GROUP_COLOR_SGIS         0x8356\n#endif\n\n#ifndef GL_SGIX_pixel_texture\n#define GL_PIXEL_TEX_GEN_SGIX             0x8139\n#define GL_PIXEL_TEX_GEN_MODE_SGIX        0x832B\n#endif\n\n#ifndef GL_SGIS_texture4D\n#define GL_PACK_SKIP_VOLUMES_SGIS         0x8130\n#define GL_PACK_IMAGE_DEPTH_SGIS          0x8131\n#define GL_UNPACK_SKIP_VOLUMES_SGIS       0x8132\n#define GL_UNPACK_IMAGE_DEPTH_SGIS        0x8133\n#define GL_TEXTURE_4D_SGIS                0x8134\n#define GL_PROXY_TEXTURE_4D_SGIS          0x8135\n#define GL_TEXTURE_4DSIZE_SGIS            0x8136\n#define GL_TEXTURE_WRAP_Q_SGIS            0x8137\n#define GL_MAX_4D_TEXTURE_SIZE_SGIS       0x8138\n#define GL_TEXTURE_4D_BINDING_SGIS        0x814F\n#endif\n\n#ifndef GL_SGI_texture_color_table\n#define GL_TEXTURE_COLOR_TABLE_SGI        0x80BC\n#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI  0x80BD\n#endif\n\n#ifndef GL_EXT_cmyka\n#define GL_CMYK_EXT                       0x800C\n#define GL_CMYKA_EXT                      0x800D\n#define GL_PACK_CMYK_HINT_EXT             0x800E\n#define GL_UNPACK_CMYK_HINT_EXT           0x800F\n#endif\n\n#ifndef GL_EXT_texture_object\n#define GL_TEXTURE_PRIORITY_EXT           0x8066\n#define GL_TEXTURE_RESIDENT_EXT           0x8067\n#define GL_TEXTURE_1D_BINDING_EXT         0x8068\n#define GL_TEXTURE_2D_BINDING_EXT         0x8069\n#define GL_TEXTURE_3D_BINDING_EXT         0x806A\n#endif\n\n#ifndef GL_SGIS_detail_texture\n#define GL_DETAIL_TEXTURE_2D_SGIS         0x8095\n#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096\n#define GL_LINEAR_DETAIL_SGIS             0x8097\n#define GL_LINEAR_DETAIL_ALPHA_SGIS       0x8098\n#define GL_LINEAR_DETAIL_COLOR_SGIS       0x8099\n#define GL_DETAIL_TEXTURE_LEVEL_SGIS      0x809A\n#define GL_DETAIL_TEXTURE_MODE_SGIS       0x809B\n#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C\n#endif\n\n#ifndef GL_SGIS_sharpen_texture\n#define GL_LINEAR_SHARPEN_SGIS            0x80AD\n#define GL_LINEAR_SHARPEN_ALPHA_SGIS      0x80AE\n#define GL_LINEAR_SHARPEN_COLOR_SGIS      0x80AF\n#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0\n#endif\n\n#ifndef GL_EXT_packed_pixels\n#define GL_UNSIGNED_BYTE_3_3_2_EXT        0x8032\n#define GL_UNSIGNED_SHORT_4_4_4_4_EXT     0x8033\n#define GL_UNSIGNED_SHORT_5_5_5_1_EXT     0x8034\n#define GL_UNSIGNED_INT_8_8_8_8_EXT       0x8035\n#define GL_UNSIGNED_INT_10_10_10_2_EXT    0x8036\n#endif\n\n#ifndef GL_SGIS_texture_lod\n#define GL_TEXTURE_MIN_LOD_SGIS           0x813A\n#define GL_TEXTURE_MAX_LOD_SGIS           0x813B\n#define GL_TEXTURE_BASE_LEVEL_SGIS        0x813C\n#define GL_TEXTURE_MAX_LEVEL_SGIS         0x813D\n#endif\n\n#ifndef GL_SGIS_multisample\n#define GL_MULTISAMPLE_SGIS               0x809D\n#define GL_SAMPLE_ALPHA_TO_MASK_SGIS      0x809E\n#define GL_SAMPLE_ALPHA_TO_ONE_SGIS       0x809F\n#define GL_SAMPLE_MASK_SGIS               0x80A0\n#define GL_1PASS_SGIS                     0x80A1\n#define GL_2PASS_0_SGIS                   0x80A2\n#define GL_2PASS_1_SGIS                   0x80A3\n#define GL_4PASS_0_SGIS                   0x80A4\n#define GL_4PASS_1_SGIS                   0x80A5\n#define GL_4PASS_2_SGIS                   0x80A6\n#define GL_4PASS_3_SGIS                   0x80A7\n#define GL_SAMPLE_BUFFERS_SGIS            0x80A8\n#define GL_SAMPLES_SGIS                   0x80A9\n#define GL_SAMPLE_MASK_VALUE_SGIS         0x80AA\n#define GL_SAMPLE_MASK_INVERT_SGIS        0x80AB\n#define GL_SAMPLE_PATTERN_SGIS            0x80AC\n#endif\n\n#ifndef GL_EXT_rescale_normal\n#define GL_RESCALE_NORMAL_EXT             0x803A\n#endif\n\n#ifndef GL_EXT_vertex_array\n#define GL_VERTEX_ARRAY_EXT               0x8074\n#define GL_NORMAL_ARRAY_EXT               0x8075\n#define GL_COLOR_ARRAY_EXT                0x8076\n#define GL_INDEX_ARRAY_EXT                0x8077\n#define GL_TEXTURE_COORD_ARRAY_EXT        0x8078\n#define GL_EDGE_FLAG_ARRAY_EXT            0x8079\n#define GL_VERTEX_ARRAY_SIZE_EXT          0x807A\n#define GL_VERTEX_ARRAY_TYPE_EXT          0x807B\n#define GL_VERTEX_ARRAY_STRIDE_EXT        0x807C\n#define GL_VERTEX_ARRAY_COUNT_EXT         0x807D\n#define GL_NORMAL_ARRAY_TYPE_EXT          0x807E\n#define GL_NORMAL_ARRAY_STRIDE_EXT        0x807F\n#define GL_NORMAL_ARRAY_COUNT_EXT         0x8080\n#define GL_COLOR_ARRAY_SIZE_EXT           0x8081\n#define GL_COLOR_ARRAY_TYPE_EXT           0x8082\n#define GL_COLOR_ARRAY_STRIDE_EXT         0x8083\n#define GL_COLOR_ARRAY_COUNT_EXT          0x8084\n#define GL_INDEX_ARRAY_TYPE_EXT           0x8085\n#define GL_INDEX_ARRAY_STRIDE_EXT         0x8086\n#define GL_INDEX_ARRAY_COUNT_EXT          0x8087\n#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT   0x8088\n#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT   0x8089\n#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A\n#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT  0x808B\n#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT     0x808C\n#define GL_EDGE_FLAG_ARRAY_COUNT_EXT      0x808D\n#define GL_VERTEX_ARRAY_POINTER_EXT       0x808E\n#define GL_NORMAL_ARRAY_POINTER_EXT       0x808F\n#define GL_COLOR_ARRAY_POINTER_EXT        0x8090\n#define GL_INDEX_ARRAY_POINTER_EXT        0x8091\n#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092\n#define GL_EDGE_FLAG_ARRAY_POINTER_EXT    0x8093\n#endif\n\n#ifndef GL_EXT_misc_attribute\n#endif\n\n#ifndef GL_SGIS_generate_mipmap\n#define GL_GENERATE_MIPMAP_SGIS           0x8191\n#define GL_GENERATE_MIPMAP_HINT_SGIS      0x8192\n#endif\n\n#ifndef GL_SGIX_clipmap\n#define GL_LINEAR_CLIPMAP_LINEAR_SGIX     0x8170\n#define GL_TEXTURE_CLIPMAP_CENTER_SGIX    0x8171\n#define GL_TEXTURE_CLIPMAP_FRAME_SGIX     0x8172\n#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX    0x8173\n#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174\n#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175\n#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX     0x8176\n#define GL_MAX_CLIPMAP_DEPTH_SGIX         0x8177\n#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178\n#define GL_NEAREST_CLIPMAP_NEAREST_SGIX   0x844D\n#define GL_NEAREST_CLIPMAP_LINEAR_SGIX    0x844E\n#define GL_LINEAR_CLIPMAP_NEAREST_SGIX    0x844F\n#endif\n\n#ifndef GL_SGIX_shadow\n#define GL_TEXTURE_COMPARE_SGIX           0x819A\n#define GL_TEXTURE_COMPARE_OPERATOR_SGIX  0x819B\n#define GL_TEXTURE_LEQUAL_R_SGIX          0x819C\n#define GL_TEXTURE_GEQUAL_R_SGIX          0x819D\n#endif\n\n#ifndef GL_SGIS_texture_edge_clamp\n#define GL_CLAMP_TO_EDGE_SGIS             0x812F\n#endif\n\n#ifndef GL_SGIS_texture_border_clamp\n#define GL_CLAMP_TO_BORDER_SGIS           0x812D\n#endif\n\n#ifndef GL_EXT_blend_minmax\n#define GL_FUNC_ADD_EXT                   0x8006\n#define GL_MIN_EXT                        0x8007\n#define GL_MAX_EXT                        0x8008\n#define GL_BLEND_EQUATION_EXT             0x8009\n#endif\n\n#ifndef GL_EXT_blend_subtract\n#define GL_FUNC_SUBTRACT_EXT              0x800A\n#define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B\n#endif\n\n#ifndef GL_EXT_blend_logic_op\n#endif\n\n#ifndef GL_SGIX_interlace\n#define GL_INTERLACE_SGIX                 0x8094\n#endif\n\n#ifndef GL_SGIX_pixel_tiles\n#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E\n#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F\n#define GL_PIXEL_TILE_WIDTH_SGIX          0x8140\n#define GL_PIXEL_TILE_HEIGHT_SGIX         0x8141\n#define GL_PIXEL_TILE_GRID_WIDTH_SGIX     0x8142\n#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX    0x8143\n#define GL_PIXEL_TILE_GRID_DEPTH_SGIX     0x8144\n#define GL_PIXEL_TILE_CACHE_SIZE_SGIX     0x8145\n#endif\n\n#ifndef GL_SGIS_texture_select\n#define GL_DUAL_ALPHA4_SGIS               0x8110\n#define GL_DUAL_ALPHA8_SGIS               0x8111\n#define GL_DUAL_ALPHA12_SGIS              0x8112\n#define GL_DUAL_ALPHA16_SGIS              0x8113\n#define GL_DUAL_LUMINANCE4_SGIS           0x8114\n#define GL_DUAL_LUMINANCE8_SGIS           0x8115\n#define GL_DUAL_LUMINANCE12_SGIS          0x8116\n#define GL_DUAL_LUMINANCE16_SGIS          0x8117\n#define GL_DUAL_INTENSITY4_SGIS           0x8118\n#define GL_DUAL_INTENSITY8_SGIS           0x8119\n#define GL_DUAL_INTENSITY12_SGIS          0x811A\n#define GL_DUAL_INTENSITY16_SGIS          0x811B\n#define GL_DUAL_LUMINANCE_ALPHA4_SGIS     0x811C\n#define GL_DUAL_LUMINANCE_ALPHA8_SGIS     0x811D\n#define GL_QUAD_ALPHA4_SGIS               0x811E\n#define GL_QUAD_ALPHA8_SGIS               0x811F\n#define GL_QUAD_LUMINANCE4_SGIS           0x8120\n#define GL_QUAD_LUMINANCE8_SGIS           0x8121\n#define GL_QUAD_INTENSITY4_SGIS           0x8122\n#define GL_QUAD_INTENSITY8_SGIS           0x8123\n#define GL_DUAL_TEXTURE_SELECT_SGIS       0x8124\n#define GL_QUAD_TEXTURE_SELECT_SGIS       0x8125\n#endif\n\n#ifndef GL_SGIX_sprite\n#define GL_SPRITE_SGIX                    0x8148\n#define GL_SPRITE_MODE_SGIX               0x8149\n#define GL_SPRITE_AXIS_SGIX               0x814A\n#define GL_SPRITE_TRANSLATION_SGIX        0x814B\n#define GL_SPRITE_AXIAL_SGIX              0x814C\n#define GL_SPRITE_OBJECT_ALIGNED_SGIX     0x814D\n#define GL_SPRITE_EYE_ALIGNED_SGIX        0x814E\n#endif\n\n#ifndef GL_SGIX_texture_multi_buffer\n#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E\n#endif\n\n#ifndef GL_EXT_point_parameters\n#define GL_POINT_SIZE_MIN_EXT             0x8126\n#define GL_POINT_SIZE_MAX_EXT             0x8127\n#define GL_POINT_FADE_THRESHOLD_SIZE_EXT  0x8128\n#define GL_DISTANCE_ATTENUATION_EXT       0x8129\n#endif\n\n#ifndef GL_SGIS_point_parameters\n#define GL_POINT_SIZE_MIN_SGIS            0x8126\n#define GL_POINT_SIZE_MAX_SGIS            0x8127\n#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128\n#define GL_DISTANCE_ATTENUATION_SGIS      0x8129\n#endif\n\n#ifndef GL_SGIX_instruments\n#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180\n#define GL_INSTRUMENT_MEASUREMENTS_SGIX   0x8181\n#endif\n\n#ifndef GL_SGIX_texture_scale_bias\n#define GL_POST_TEXTURE_FILTER_BIAS_SGIX  0x8179\n#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A\n#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B\n#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C\n#endif\n\n#ifndef GL_SGIX_framezoom\n#define GL_FRAMEZOOM_SGIX                 0x818B\n#define GL_FRAMEZOOM_FACTOR_SGIX          0x818C\n#define GL_MAX_FRAMEZOOM_FACTOR_SGIX      0x818D\n#endif\n\n#ifndef GL_SGIX_tag_sample_buffer\n#endif\n\n#ifndef GL_FfdMaskSGIX\n#define GL_TEXTURE_DEFORMATION_BIT_SGIX   0x00000001\n#define GL_GEOMETRY_DEFORMATION_BIT_SGIX  0x00000002\n#endif\n\n#ifndef GL_SGIX_polynomial_ffd\n#define GL_GEOMETRY_DEFORMATION_SGIX      0x8194\n#define GL_TEXTURE_DEFORMATION_SGIX       0x8195\n#define GL_DEFORMATIONS_MASK_SGIX         0x8196\n#define GL_MAX_DEFORMATION_ORDER_SGIX     0x8197\n#endif\n\n#ifndef GL_SGIX_reference_plane\n#define GL_REFERENCE_PLANE_SGIX           0x817D\n#define GL_REFERENCE_PLANE_EQUATION_SGIX  0x817E\n#endif\n\n#ifndef GL_SGIX_flush_raster\n#endif\n\n#ifndef GL_SGIX_depth_texture\n#define GL_DEPTH_COMPONENT16_SGIX         0x81A5\n#define GL_DEPTH_COMPONENT24_SGIX         0x81A6\n#define GL_DEPTH_COMPONENT32_SGIX         0x81A7\n#endif\n\n#ifndef GL_SGIS_fog_function\n#define GL_FOG_FUNC_SGIS                  0x812A\n#define GL_FOG_FUNC_POINTS_SGIS           0x812B\n#define GL_MAX_FOG_FUNC_POINTS_SGIS       0x812C\n#endif\n\n#ifndef GL_SGIX_fog_offset\n#define GL_FOG_OFFSET_SGIX                0x8198\n#define GL_FOG_OFFSET_VALUE_SGIX          0x8199\n#endif\n\n#ifndef GL_HP_image_transform\n#define GL_IMAGE_SCALE_X_HP               0x8155\n#define GL_IMAGE_SCALE_Y_HP               0x8156\n#define GL_IMAGE_TRANSLATE_X_HP           0x8157\n#define GL_IMAGE_TRANSLATE_Y_HP           0x8158\n#define GL_IMAGE_ROTATE_ANGLE_HP          0x8159\n#define GL_IMAGE_ROTATE_ORIGIN_X_HP       0x815A\n#define GL_IMAGE_ROTATE_ORIGIN_Y_HP       0x815B\n#define GL_IMAGE_MAG_FILTER_HP            0x815C\n#define GL_IMAGE_MIN_FILTER_HP            0x815D\n#define GL_IMAGE_CUBIC_WEIGHT_HP          0x815E\n#define GL_CUBIC_HP                       0x815F\n#define GL_AVERAGE_HP                     0x8160\n#define GL_IMAGE_TRANSFORM_2D_HP          0x8161\n#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162\n#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163\n#endif\n\n#ifndef GL_HP_convolution_border_modes\n#define GL_IGNORE_BORDER_HP               0x8150\n#define GL_CONSTANT_BORDER_HP             0x8151\n#define GL_REPLICATE_BORDER_HP            0x8153\n#define GL_CONVOLUTION_BORDER_COLOR_HP    0x8154\n#endif\n\n#ifndef GL_INGR_palette_buffer\n#endif\n\n#ifndef GL_SGIX_texture_add_env\n#define GL_TEXTURE_ENV_BIAS_SGIX          0x80BE\n#endif\n\n#ifndef GL_EXT_color_subtable\n#endif\n\n#ifndef GL_PGI_vertex_hints\n#define GL_VERTEX_DATA_HINT_PGI           0x1A22A\n#define GL_VERTEX_CONSISTENT_HINT_PGI     0x1A22B\n#define GL_MATERIAL_SIDE_HINT_PGI         0x1A22C\n#define GL_MAX_VERTEX_HINT_PGI            0x1A22D\n#define GL_COLOR3_BIT_PGI                 0x00010000\n#define GL_COLOR4_BIT_PGI                 0x00020000\n#define GL_EDGEFLAG_BIT_PGI               0x00040000\n#define GL_INDEX_BIT_PGI                  0x00080000\n#define GL_MAT_AMBIENT_BIT_PGI            0x00100000\n#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000\n#define GL_MAT_DIFFUSE_BIT_PGI            0x00400000\n#define GL_MAT_EMISSION_BIT_PGI           0x00800000\n#define GL_MAT_COLOR_INDEXES_BIT_PGI      0x01000000\n#define GL_MAT_SHININESS_BIT_PGI          0x02000000\n#define GL_MAT_SPECULAR_BIT_PGI           0x04000000\n#define GL_NORMAL_BIT_PGI                 0x08000000\n#define GL_TEXCOORD1_BIT_PGI              0x10000000\n#define GL_TEXCOORD2_BIT_PGI              0x20000000\n#define GL_TEXCOORD3_BIT_PGI              0x40000000\n#define GL_TEXCOORD4_BIT_PGI              0x80000000\n#define GL_VERTEX23_BIT_PGI               0x00000004\n#define GL_VERTEX4_BIT_PGI                0x00000008\n#endif\n\n#ifndef GL_PGI_misc_hints\n#define GL_PREFER_DOUBLEBUFFER_HINT_PGI   0x1A1F8\n#define GL_CONSERVE_MEMORY_HINT_PGI       0x1A1FD\n#define GL_RECLAIM_MEMORY_HINT_PGI        0x1A1FE\n#define GL_NATIVE_GRAPHICS_HANDLE_PGI     0x1A202\n#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203\n#define GL_NATIVE_GRAPHICS_END_HINT_PGI   0x1A204\n#define GL_ALWAYS_FAST_HINT_PGI           0x1A20C\n#define GL_ALWAYS_SOFT_HINT_PGI           0x1A20D\n#define GL_ALLOW_DRAW_OBJ_HINT_PGI        0x1A20E\n#define GL_ALLOW_DRAW_WIN_HINT_PGI        0x1A20F\n#define GL_ALLOW_DRAW_FRG_HINT_PGI        0x1A210\n#define GL_ALLOW_DRAW_MEM_HINT_PGI        0x1A211\n#define GL_STRICT_DEPTHFUNC_HINT_PGI      0x1A216\n#define GL_STRICT_LIGHTING_HINT_PGI       0x1A217\n#define GL_STRICT_SCISSOR_HINT_PGI        0x1A218\n#define GL_FULL_STIPPLE_HINT_PGI          0x1A219\n#define GL_CLIP_NEAR_HINT_PGI             0x1A220\n#define GL_CLIP_FAR_HINT_PGI              0x1A221\n#define GL_WIDE_LINE_HINT_PGI             0x1A222\n#define GL_BACK_NORMALS_HINT_PGI          0x1A223\n#endif\n\n#ifndef GL_EXT_paletted_texture\n#define GL_COLOR_INDEX1_EXT               0x80E2\n#define GL_COLOR_INDEX2_EXT               0x80E3\n#define GL_COLOR_INDEX4_EXT               0x80E4\n#define GL_COLOR_INDEX8_EXT               0x80E5\n#define GL_COLOR_INDEX12_EXT              0x80E6\n#define GL_COLOR_INDEX16_EXT              0x80E7\n#define GL_TEXTURE_INDEX_SIZE_EXT         0x80ED\n#endif\n\n#ifndef GL_EXT_clip_volume_hint\n#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT  0x80F0\n#endif\n\n#ifndef GL_SGIX_list_priority\n#define GL_LIST_PRIORITY_SGIX             0x8182\n#endif\n\n#ifndef GL_SGIX_ir_instrument1\n#define GL_IR_INSTRUMENT1_SGIX            0x817F\n#endif\n\n#ifndef GL_SGIX_calligraphic_fragment\n#define GL_CALLIGRAPHIC_FRAGMENT_SGIX     0x8183\n#endif\n\n#ifndef GL_SGIX_texture_lod_bias\n#define GL_TEXTURE_LOD_BIAS_S_SGIX        0x818E\n#define GL_TEXTURE_LOD_BIAS_T_SGIX        0x818F\n#define GL_TEXTURE_LOD_BIAS_R_SGIX        0x8190\n#endif\n\n#ifndef GL_SGIX_shadow_ambient\n#define GL_SHADOW_AMBIENT_SGIX            0x80BF\n#endif\n\n#ifndef GL_EXT_index_texture\n#endif\n\n#ifndef GL_EXT_index_material\n#define GL_INDEX_MATERIAL_EXT             0x81B8\n#define GL_INDEX_MATERIAL_PARAMETER_EXT   0x81B9\n#define GL_INDEX_MATERIAL_FACE_EXT        0x81BA\n#endif\n\n#ifndef GL_EXT_index_func\n#define GL_INDEX_TEST_EXT                 0x81B5\n#define GL_INDEX_TEST_FUNC_EXT            0x81B6\n#define GL_INDEX_TEST_REF_EXT             0x81B7\n#endif\n\n#ifndef GL_EXT_index_array_formats\n#define GL_IUI_V2F_EXT                    0x81AD\n#define GL_IUI_V3F_EXT                    0x81AE\n#define GL_IUI_N3F_V2F_EXT                0x81AF\n#define GL_IUI_N3F_V3F_EXT                0x81B0\n#define GL_T2F_IUI_V2F_EXT                0x81B1\n#define GL_T2F_IUI_V3F_EXT                0x81B2\n#define GL_T2F_IUI_N3F_V2F_EXT            0x81B3\n#define GL_T2F_IUI_N3F_V3F_EXT            0x81B4\n#endif\n\n#ifndef GL_EXT_compiled_vertex_array\n#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT   0x81A8\n#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT   0x81A9\n#endif\n\n#ifndef GL_EXT_cull_vertex\n#define GL_CULL_VERTEX_EXT                0x81AA\n#define GL_CULL_VERTEX_EYE_POSITION_EXT   0x81AB\n#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC\n#endif\n\n#ifndef GL_SGIX_ycrcb\n#define GL_YCRCB_422_SGIX                 0x81BB\n#define GL_YCRCB_444_SGIX                 0x81BC\n#endif\n\n#ifndef GL_SGIX_fragment_lighting\n#define GL_FRAGMENT_LIGHTING_SGIX         0x8400\n#define GL_FRAGMENT_COLOR_MATERIAL_SGIX   0x8401\n#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402\n#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403\n#define GL_MAX_FRAGMENT_LIGHTS_SGIX       0x8404\n#define GL_MAX_ACTIVE_LIGHTS_SGIX         0x8405\n#define GL_CURRENT_RASTER_NORMAL_SGIX     0x8406\n#define GL_LIGHT_ENV_MODE_SGIX            0x8407\n#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408\n#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409\n#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A\n#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B\n#define GL_FRAGMENT_LIGHT0_SGIX           0x840C\n#define GL_FRAGMENT_LIGHT1_SGIX           0x840D\n#define GL_FRAGMENT_LIGHT2_SGIX           0x840E\n#define GL_FRAGMENT_LIGHT3_SGIX           0x840F\n#define GL_FRAGMENT_LIGHT4_SGIX           0x8410\n#define GL_FRAGMENT_LIGHT5_SGIX           0x8411\n#define GL_FRAGMENT_LIGHT6_SGIX           0x8412\n#define GL_FRAGMENT_LIGHT7_SGIX           0x8413\n#endif\n\n#ifndef GL_IBM_rasterpos_clip\n#define GL_RASTER_POSITION_UNCLIPPED_IBM  0x19262\n#endif\n\n#ifndef GL_HP_texture_lighting\n#define GL_TEXTURE_LIGHTING_MODE_HP       0x8167\n#define GL_TEXTURE_POST_SPECULAR_HP       0x8168\n#define GL_TEXTURE_PRE_SPECULAR_HP        0x8169\n#endif\n\n#ifndef GL_EXT_draw_range_elements\n#define GL_MAX_ELEMENTS_VERTICES_EXT      0x80E8\n#define GL_MAX_ELEMENTS_INDICES_EXT       0x80E9\n#endif\n\n#ifndef GL_WIN_phong_shading\n#define GL_PHONG_WIN                      0x80EA\n#define GL_PHONG_HINT_WIN                 0x80EB\n#endif\n\n#ifndef GL_WIN_specular_fog\n#define GL_FOG_SPECULAR_TEXTURE_WIN       0x80EC\n#endif\n\n#ifndef GL_EXT_light_texture\n#define GL_FRAGMENT_MATERIAL_EXT          0x8349\n#define GL_FRAGMENT_NORMAL_EXT            0x834A\n#define GL_FRAGMENT_COLOR_EXT             0x834C\n#define GL_ATTENUATION_EXT                0x834D\n#define GL_SHADOW_ATTENUATION_EXT         0x834E\n#define GL_TEXTURE_APPLICATION_MODE_EXT   0x834F\n#define GL_TEXTURE_LIGHT_EXT              0x8350\n#define GL_TEXTURE_MATERIAL_FACE_EXT      0x8351\n#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352\n/* reuse GL_FRAGMENT_DEPTH_EXT */\n#endif\n\n#ifndef GL_SGIX_blend_alpha_minmax\n#define GL_ALPHA_MIN_SGIX                 0x8320\n#define GL_ALPHA_MAX_SGIX                 0x8321\n#endif\n\n#ifndef GL_SGIX_impact_pixel_texture\n#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX   0x8184\n#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX     0x8185\n#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX     0x8186\n#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187\n#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188\n#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX    0x8189\n#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX    0x818A\n#endif\n\n#ifndef GL_EXT_bgra\n#define GL_BGR_EXT                        0x80E0\n#define GL_BGRA_EXT                       0x80E1\n#endif\n\n#ifndef GL_SGIX_async\n#define GL_ASYNC_MARKER_SGIX              0x8329\n#endif\n\n#ifndef GL_SGIX_async_pixel\n#define GL_ASYNC_TEX_IMAGE_SGIX           0x835C\n#define GL_ASYNC_DRAW_PIXELS_SGIX         0x835D\n#define GL_ASYNC_READ_PIXELS_SGIX         0x835E\n#define GL_MAX_ASYNC_TEX_IMAGE_SGIX       0x835F\n#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX     0x8360\n#define GL_MAX_ASYNC_READ_PIXELS_SGIX     0x8361\n#endif\n\n#ifndef GL_SGIX_async_histogram\n#define GL_ASYNC_HISTOGRAM_SGIX           0x832C\n#define GL_MAX_ASYNC_HISTOGRAM_SGIX       0x832D\n#endif\n\n#ifndef GL_INTEL_texture_scissor\n#endif\n\n#ifndef GL_INTEL_parallel_arrays\n#define GL_PARALLEL_ARRAYS_INTEL          0x83F4\n#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5\n#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6\n#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7\n#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8\n#endif\n\n#ifndef GL_HP_occlusion_test\n#define GL_OCCLUSION_TEST_HP              0x8165\n#define GL_OCCLUSION_TEST_RESULT_HP       0x8166\n#endif\n\n#ifndef GL_EXT_pixel_transform\n#define GL_PIXEL_TRANSFORM_2D_EXT         0x8330\n#define GL_PIXEL_MAG_FILTER_EXT           0x8331\n#define GL_PIXEL_MIN_FILTER_EXT           0x8332\n#define GL_PIXEL_CUBIC_WEIGHT_EXT         0x8333\n#define GL_CUBIC_EXT                      0x8334\n#define GL_AVERAGE_EXT                    0x8335\n#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336\n#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337\n#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT  0x8338\n#endif\n\n#ifndef GL_EXT_pixel_transform_color_table\n#endif\n\n#ifndef GL_EXT_shared_texture_palette\n#define GL_SHARED_TEXTURE_PALETTE_EXT     0x81FB\n#endif\n\n#ifndef GL_EXT_separate_specular_color\n#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT  0x81F8\n#define GL_SINGLE_COLOR_EXT               0x81F9\n#define GL_SEPARATE_SPECULAR_COLOR_EXT    0x81FA\n#endif\n\n#ifndef GL_EXT_secondary_color\n#define GL_COLOR_SUM_EXT                  0x8458\n#define GL_CURRENT_SECONDARY_COLOR_EXT    0x8459\n#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A\n#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B\n#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C\n#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D\n#define GL_SECONDARY_COLOR_ARRAY_EXT      0x845E\n#endif\n\n#ifndef GL_EXT_texture_perturb_normal\n#define GL_PERTURB_EXT                    0x85AE\n#define GL_TEXTURE_NORMAL_EXT             0x85AF\n#endif\n\n#ifndef GL_EXT_multi_draw_arrays\n#endif\n\n#ifndef GL_EXT_fog_coord\n#define GL_FOG_COORDINATE_SOURCE_EXT      0x8450\n#define GL_FOG_COORDINATE_EXT             0x8451\n#define GL_FRAGMENT_DEPTH_EXT             0x8452\n#define GL_CURRENT_FOG_COORDINATE_EXT     0x8453\n#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT  0x8454\n#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455\n#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456\n#define GL_FOG_COORDINATE_ARRAY_EXT       0x8457\n#endif\n\n#ifndef GL_REND_screen_coordinates\n#define GL_SCREEN_COORDINATES_REND        0x8490\n#define GL_INVERTED_SCREEN_W_REND         0x8491\n#endif\n\n#ifndef GL_EXT_coordinate_frame\n#define GL_TANGENT_ARRAY_EXT              0x8439\n#define GL_BINORMAL_ARRAY_EXT             0x843A\n#define GL_CURRENT_TANGENT_EXT            0x843B\n#define GL_CURRENT_BINORMAL_EXT           0x843C\n#define GL_TANGENT_ARRAY_TYPE_EXT         0x843E\n#define GL_TANGENT_ARRAY_STRIDE_EXT       0x843F\n#define GL_BINORMAL_ARRAY_TYPE_EXT        0x8440\n#define GL_BINORMAL_ARRAY_STRIDE_EXT      0x8441\n#define GL_TANGENT_ARRAY_POINTER_EXT      0x8442\n#define GL_BINORMAL_ARRAY_POINTER_EXT     0x8443\n#define GL_MAP1_TANGENT_EXT               0x8444\n#define GL_MAP2_TANGENT_EXT               0x8445\n#define GL_MAP1_BINORMAL_EXT              0x8446\n#define GL_MAP2_BINORMAL_EXT              0x8447\n#endif\n\n#ifndef GL_EXT_texture_env_combine\n#define GL_COMBINE_EXT                    0x8570\n#define GL_COMBINE_RGB_EXT                0x8571\n#define GL_COMBINE_ALPHA_EXT              0x8572\n#define GL_RGB_SCALE_EXT                  0x8573\n#define GL_ADD_SIGNED_EXT                 0x8574\n#define GL_INTERPOLATE_EXT                0x8575\n#define GL_CONSTANT_EXT                   0x8576\n#define GL_PRIMARY_COLOR_EXT              0x8577\n#define GL_PREVIOUS_EXT                   0x8578\n#define GL_SOURCE0_RGB_EXT                0x8580\n#define GL_SOURCE1_RGB_EXT                0x8581\n#define GL_SOURCE2_RGB_EXT                0x8582\n#define GL_SOURCE0_ALPHA_EXT              0x8588\n#define GL_SOURCE1_ALPHA_EXT              0x8589\n#define GL_SOURCE2_ALPHA_EXT              0x858A\n#define GL_OPERAND0_RGB_EXT               0x8590\n#define GL_OPERAND1_RGB_EXT               0x8591\n#define GL_OPERAND2_RGB_EXT               0x8592\n#define GL_OPERAND0_ALPHA_EXT             0x8598\n#define GL_OPERAND1_ALPHA_EXT             0x8599\n#define GL_OPERAND2_ALPHA_EXT             0x859A\n#endif\n\n#ifndef GL_APPLE_specular_vector\n#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0\n#endif\n\n#ifndef GL_APPLE_transform_hint\n#define GL_TRANSFORM_HINT_APPLE           0x85B1\n#endif\n\n#ifndef GL_SGIX_fog_scale\n#define GL_FOG_SCALE_SGIX                 0x81FC\n#define GL_FOG_SCALE_VALUE_SGIX           0x81FD\n#endif\n\n#ifndef GL_SUNX_constant_data\n#define GL_UNPACK_CONSTANT_DATA_SUNX      0x81D5\n#define GL_TEXTURE_CONSTANT_DATA_SUNX     0x81D6\n#endif\n\n#ifndef GL_SUN_global_alpha\n#define GL_GLOBAL_ALPHA_SUN               0x81D9\n#define GL_GLOBAL_ALPHA_FACTOR_SUN        0x81DA\n#endif\n\n#ifndef GL_SUN_triangle_list\n#define GL_RESTART_SUN                    0x0001\n#define GL_REPLACE_MIDDLE_SUN             0x0002\n#define GL_REPLACE_OLDEST_SUN             0x0003\n#define GL_TRIANGLE_LIST_SUN              0x81D7\n#define GL_REPLACEMENT_CODE_SUN           0x81D8\n#define GL_REPLACEMENT_CODE_ARRAY_SUN     0x85C0\n#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1\n#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2\n#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3\n#define GL_R1UI_V3F_SUN                   0x85C4\n#define GL_R1UI_C4UB_V3F_SUN              0x85C5\n#define GL_R1UI_C3F_V3F_SUN               0x85C6\n#define GL_R1UI_N3F_V3F_SUN               0x85C7\n#define GL_R1UI_C4F_N3F_V3F_SUN           0x85C8\n#define GL_R1UI_T2F_V3F_SUN               0x85C9\n#define GL_R1UI_T2F_N3F_V3F_SUN           0x85CA\n#define GL_R1UI_T2F_C4F_N3F_V3F_SUN       0x85CB\n#endif\n\n#ifndef GL_SUN_vertex\n#endif\n\n#ifndef GL_EXT_blend_func_separate\n#define GL_BLEND_DST_RGB_EXT              0x80C8\n#define GL_BLEND_SRC_RGB_EXT              0x80C9\n#define GL_BLEND_DST_ALPHA_EXT            0x80CA\n#define GL_BLEND_SRC_ALPHA_EXT            0x80CB\n#endif\n\n#ifndef GL_INGR_color_clamp\n#define GL_RED_MIN_CLAMP_INGR             0x8560\n#define GL_GREEN_MIN_CLAMP_INGR           0x8561\n#define GL_BLUE_MIN_CLAMP_INGR            0x8562\n#define GL_ALPHA_MIN_CLAMP_INGR           0x8563\n#define GL_RED_MAX_CLAMP_INGR             0x8564\n#define GL_GREEN_MAX_CLAMP_INGR           0x8565\n#define GL_BLUE_MAX_CLAMP_INGR            0x8566\n#define GL_ALPHA_MAX_CLAMP_INGR           0x8567\n#endif\n\n#ifndef GL_INGR_interlace_read\n#define GL_INTERLACE_READ_INGR            0x8568\n#endif\n\n#ifndef GL_EXT_stencil_wrap\n#define GL_INCR_WRAP_EXT                  0x8507\n#define GL_DECR_WRAP_EXT                  0x8508\n#endif\n\n#ifndef GL_EXT_422_pixels\n#define GL_422_EXT                        0x80CC\n#define GL_422_REV_EXT                    0x80CD\n#define GL_422_AVERAGE_EXT                0x80CE\n#define GL_422_REV_AVERAGE_EXT            0x80CF\n#endif\n\n#ifndef GL_NV_texgen_reflection\n#define GL_NORMAL_MAP_NV                  0x8511\n#define GL_REFLECTION_MAP_NV              0x8512\n#endif\n\n#ifndef GL_EXT_texture_cube_map\n#define GL_NORMAL_MAP_EXT                 0x8511\n#define GL_REFLECTION_MAP_EXT             0x8512\n#define GL_TEXTURE_CUBE_MAP_EXT           0x8513\n#define GL_TEXTURE_BINDING_CUBE_MAP_EXT   0x8514\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A\n#define GL_PROXY_TEXTURE_CUBE_MAP_EXT     0x851B\n#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT  0x851C\n#endif\n\n#ifndef GL_SUN_convolution_border_modes\n#define GL_WRAP_BORDER_SUN                0x81D4\n#endif\n\n#ifndef GL_EXT_texture_env_add\n#endif\n\n#ifndef GL_EXT_texture_lod_bias\n#define GL_MAX_TEXTURE_LOD_BIAS_EXT       0x84FD\n#define GL_TEXTURE_FILTER_CONTROL_EXT     0x8500\n#define GL_TEXTURE_LOD_BIAS_EXT           0x8501\n#endif\n\n#ifndef GL_EXT_texture_filter_anisotropic\n#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE\n#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF\n#endif\n\n#ifndef GL_EXT_vertex_weighting\n#define GL_MODELVIEW0_STACK_DEPTH_EXT     GL_MODELVIEW_STACK_DEPTH\n#define GL_MODELVIEW1_STACK_DEPTH_EXT     0x8502\n#define GL_MODELVIEW0_MATRIX_EXT          GL_MODELVIEW_MATRIX\n#define GL_MODELVIEW1_MATRIX_EXT          0x8506\n#define GL_VERTEX_WEIGHTING_EXT           0x8509\n#define GL_MODELVIEW0_EXT                 GL_MODELVIEW\n#define GL_MODELVIEW1_EXT                 0x850A\n#define GL_CURRENT_VERTEX_WEIGHT_EXT      0x850B\n#define GL_VERTEX_WEIGHT_ARRAY_EXT        0x850C\n#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT   0x850D\n#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT   0x850E\n#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F\n#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510\n#endif\n\n#ifndef GL_NV_light_max_exponent\n#define GL_MAX_SHININESS_NV               0x8504\n#define GL_MAX_SPOT_EXPONENT_NV           0x8505\n#endif\n\n#ifndef GL_NV_vertex_array_range\n#define GL_VERTEX_ARRAY_RANGE_NV          0x851D\n#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV   0x851E\n#define GL_VERTEX_ARRAY_RANGE_VALID_NV    0x851F\n#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520\n#define GL_VERTEX_ARRAY_RANGE_POINTER_NV  0x8521\n#endif\n\n#ifndef GL_NV_register_combiners\n#define GL_REGISTER_COMBINERS_NV          0x8522\n#define GL_VARIABLE_A_NV                  0x8523\n#define GL_VARIABLE_B_NV                  0x8524\n#define GL_VARIABLE_C_NV                  0x8525\n#define GL_VARIABLE_D_NV                  0x8526\n#define GL_VARIABLE_E_NV                  0x8527\n#define GL_VARIABLE_F_NV                  0x8528\n#define GL_VARIABLE_G_NV                  0x8529\n#define GL_CONSTANT_COLOR0_NV             0x852A\n#define GL_CONSTANT_COLOR1_NV             0x852B\n#define GL_PRIMARY_COLOR_NV               0x852C\n#define GL_SECONDARY_COLOR_NV             0x852D\n#define GL_SPARE0_NV                      0x852E\n#define GL_SPARE1_NV                      0x852F\n#define GL_DISCARD_NV                     0x8530\n#define GL_E_TIMES_F_NV                   0x8531\n#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532\n#define GL_UNSIGNED_IDENTITY_NV           0x8536\n#define GL_UNSIGNED_INVERT_NV             0x8537\n#define GL_EXPAND_NORMAL_NV               0x8538\n#define GL_EXPAND_NEGATE_NV               0x8539\n#define GL_HALF_BIAS_NORMAL_NV            0x853A\n#define GL_HALF_BIAS_NEGATE_NV            0x853B\n#define GL_SIGNED_IDENTITY_NV             0x853C\n#define GL_SIGNED_NEGATE_NV               0x853D\n#define GL_SCALE_BY_TWO_NV                0x853E\n#define GL_SCALE_BY_FOUR_NV               0x853F\n#define GL_SCALE_BY_ONE_HALF_NV           0x8540\n#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV   0x8541\n#define GL_COMBINER_INPUT_NV              0x8542\n#define GL_COMBINER_MAPPING_NV            0x8543\n#define GL_COMBINER_COMPONENT_USAGE_NV    0x8544\n#define GL_COMBINER_AB_DOT_PRODUCT_NV     0x8545\n#define GL_COMBINER_CD_DOT_PRODUCT_NV     0x8546\n#define GL_COMBINER_MUX_SUM_NV            0x8547\n#define GL_COMBINER_SCALE_NV              0x8548\n#define GL_COMBINER_BIAS_NV               0x8549\n#define GL_COMBINER_AB_OUTPUT_NV          0x854A\n#define GL_COMBINER_CD_OUTPUT_NV          0x854B\n#define GL_COMBINER_SUM_OUTPUT_NV         0x854C\n#define GL_MAX_GENERAL_COMBINERS_NV       0x854D\n#define GL_NUM_GENERAL_COMBINERS_NV       0x854E\n#define GL_COLOR_SUM_CLAMP_NV             0x854F\n#define GL_COMBINER0_NV                   0x8550\n#define GL_COMBINER1_NV                   0x8551\n#define GL_COMBINER2_NV                   0x8552\n#define GL_COMBINER3_NV                   0x8553\n#define GL_COMBINER4_NV                   0x8554\n#define GL_COMBINER5_NV                   0x8555\n#define GL_COMBINER6_NV                   0x8556\n#define GL_COMBINER7_NV                   0x8557\n/* reuse GL_TEXTURE0_ARB */\n/* reuse GL_TEXTURE1_ARB */\n/* reuse GL_ZERO */\n/* reuse GL_NONE */\n/* reuse GL_FOG */\n#endif\n\n#ifndef GL_NV_fog_distance\n#define GL_FOG_DISTANCE_MODE_NV           0x855A\n#define GL_EYE_RADIAL_NV                  0x855B\n#define GL_EYE_PLANE_ABSOLUTE_NV          0x855C\n/* reuse GL_EYE_PLANE */\n#endif\n\n#ifndef GL_NV_texgen_emboss\n#define GL_EMBOSS_LIGHT_NV                0x855D\n#define GL_EMBOSS_CONSTANT_NV             0x855E\n#define GL_EMBOSS_MAP_NV                  0x855F\n#endif\n\n#ifndef GL_NV_blend_square\n#endif\n\n#ifndef GL_NV_texture_env_combine4\n#define GL_COMBINE4_NV                    0x8503\n#define GL_SOURCE3_RGB_NV                 0x8583\n#define GL_SOURCE3_ALPHA_NV               0x858B\n#define GL_OPERAND3_RGB_NV                0x8593\n#define GL_OPERAND3_ALPHA_NV              0x859B\n#endif\n\n#ifndef GL_MESA_resize_buffers\n#endif\n\n#ifndef GL_MESA_window_pos\n#endif\n\n#ifndef GL_EXT_texture_compression_s3tc\n#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0\n#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1\n#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2\n#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3\n#endif\n\n#ifndef GL_IBM_cull_vertex\n#define GL_CULL_VERTEX_IBM                103050\n#endif\n\n#ifndef GL_IBM_multimode_draw_arrays\n#endif\n\n#ifndef GL_IBM_vertex_array_lists\n#define GL_VERTEX_ARRAY_LIST_IBM          103070\n#define GL_NORMAL_ARRAY_LIST_IBM          103071\n#define GL_COLOR_ARRAY_LIST_IBM           103072\n#define GL_INDEX_ARRAY_LIST_IBM           103073\n#define GL_TEXTURE_COORD_ARRAY_LIST_IBM   103074\n#define GL_EDGE_FLAG_ARRAY_LIST_IBM       103075\n#define GL_FOG_COORDINATE_ARRAY_LIST_IBM  103076\n#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077\n#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM   103080\n#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM   103081\n#define GL_COLOR_ARRAY_LIST_STRIDE_IBM    103082\n#define GL_INDEX_ARRAY_LIST_STRIDE_IBM    103083\n#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084\n#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085\n#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086\n#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087\n#endif\n\n#ifndef GL_SGIX_subsample\n#define GL_PACK_SUBSAMPLE_RATE_SGIX       0x85A0\n#define GL_UNPACK_SUBSAMPLE_RATE_SGIX     0x85A1\n#define GL_PIXEL_SUBSAMPLE_4444_SGIX      0x85A2\n#define GL_PIXEL_SUBSAMPLE_2424_SGIX      0x85A3\n#define GL_PIXEL_SUBSAMPLE_4242_SGIX      0x85A4\n#endif\n\n#ifndef GL_SGIX_ycrcb_subsample\n#endif\n\n#ifndef GL_SGIX_ycrcba\n#define GL_YCRCB_SGIX                     0x8318\n#define GL_YCRCBA_SGIX                    0x8319\n#endif\n\n#ifndef GL_SGI_depth_pass_instrument\n#define GL_DEPTH_PASS_INSTRUMENT_SGIX     0x8310\n#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311\n#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312\n#endif\n\n#ifndef GL_3DFX_texture_compression_FXT1\n#define GL_COMPRESSED_RGB_FXT1_3DFX       0x86B0\n#define GL_COMPRESSED_RGBA_FXT1_3DFX      0x86B1\n#endif\n\n#ifndef GL_3DFX_multisample\n#define GL_MULTISAMPLE_3DFX               0x86B2\n#define GL_SAMPLE_BUFFERS_3DFX            0x86B3\n#define GL_SAMPLES_3DFX                   0x86B4\n#define GL_MULTISAMPLE_BIT_3DFX           0x20000000\n#endif\n\n#ifndef GL_3DFX_tbuffer\n#endif\n\n#ifndef GL_EXT_multisample\n#define GL_MULTISAMPLE_EXT                0x809D\n#define GL_SAMPLE_ALPHA_TO_MASK_EXT       0x809E\n#define GL_SAMPLE_ALPHA_TO_ONE_EXT        0x809F\n#define GL_SAMPLE_MASK_EXT                0x80A0\n#define GL_1PASS_EXT                      0x80A1\n#define GL_2PASS_0_EXT                    0x80A2\n#define GL_2PASS_1_EXT                    0x80A3\n#define GL_4PASS_0_EXT                    0x80A4\n#define GL_4PASS_1_EXT                    0x80A5\n#define GL_4PASS_2_EXT                    0x80A6\n#define GL_4PASS_3_EXT                    0x80A7\n#define GL_SAMPLE_BUFFERS_EXT             0x80A8\n#define GL_SAMPLES_EXT                    0x80A9\n#define GL_SAMPLE_MASK_VALUE_EXT          0x80AA\n#define GL_SAMPLE_MASK_INVERT_EXT         0x80AB\n#define GL_SAMPLE_PATTERN_EXT             0x80AC\n#define GL_MULTISAMPLE_BIT_EXT            0x20000000\n#endif\n\n#ifndef GL_SGIX_vertex_preclip\n#define GL_VERTEX_PRECLIP_SGIX            0x83EE\n#define GL_VERTEX_PRECLIP_HINT_SGIX       0x83EF\n#endif\n\n#ifndef GL_SGIX_convolution_accuracy\n#define GL_CONVOLUTION_HINT_SGIX          0x8316\n#endif\n\n#ifndef GL_SGIX_resample\n#define GL_PACK_RESAMPLE_SGIX             0x842C\n#define GL_UNPACK_RESAMPLE_SGIX           0x842D\n#define GL_RESAMPLE_REPLICATE_SGIX        0x842E\n#define GL_RESAMPLE_ZERO_FILL_SGIX        0x842F\n#define GL_RESAMPLE_DECIMATE_SGIX         0x8430\n#endif\n\n#ifndef GL_SGIS_point_line_texgen\n#define GL_EYE_DISTANCE_TO_POINT_SGIS     0x81F0\n#define GL_OBJECT_DISTANCE_TO_POINT_SGIS  0x81F1\n#define GL_EYE_DISTANCE_TO_LINE_SGIS      0x81F2\n#define GL_OBJECT_DISTANCE_TO_LINE_SGIS   0x81F3\n#define GL_EYE_POINT_SGIS                 0x81F4\n#define GL_OBJECT_POINT_SGIS              0x81F5\n#define GL_EYE_LINE_SGIS                  0x81F6\n#define GL_OBJECT_LINE_SGIS               0x81F7\n#endif\n\n#ifndef GL_SGIS_texture_color_mask\n#define GL_TEXTURE_COLOR_WRITEMASK_SGIS   0x81EF\n#endif\n\n#ifndef GL_EXT_texture_env_dot3\n#define GL_DOT3_RGB_EXT                   0x8740\n#define GL_DOT3_RGBA_EXT                  0x8741\n#endif\n\n#ifndef GL_ATI_texture_mirror_once\n#define GL_MIRROR_CLAMP_ATI               0x8742\n#define GL_MIRROR_CLAMP_TO_EDGE_ATI       0x8743\n#endif\n\n#ifndef GL_NV_fence\n#define GL_ALL_COMPLETED_NV               0x84F2\n#define GL_FENCE_STATUS_NV                0x84F3\n#define GL_FENCE_CONDITION_NV             0x84F4\n#endif\n\n#ifndef GL_IBM_texture_mirrored_repeat\n#define GL_MIRRORED_REPEAT_IBM            0x8370\n#endif\n\n#ifndef GL_NV_evaluators\n#define GL_EVAL_2D_NV                     0x86C0\n#define GL_EVAL_TRIANGULAR_2D_NV          0x86C1\n#define GL_MAP_TESSELLATION_NV            0x86C2\n#define GL_MAP_ATTRIB_U_ORDER_NV          0x86C3\n#define GL_MAP_ATTRIB_V_ORDER_NV          0x86C4\n#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5\n#define GL_EVAL_VERTEX_ATTRIB0_NV         0x86C6\n#define GL_EVAL_VERTEX_ATTRIB1_NV         0x86C7\n#define GL_EVAL_VERTEX_ATTRIB2_NV         0x86C8\n#define GL_EVAL_VERTEX_ATTRIB3_NV         0x86C9\n#define GL_EVAL_VERTEX_ATTRIB4_NV         0x86CA\n#define GL_EVAL_VERTEX_ATTRIB5_NV         0x86CB\n#define GL_EVAL_VERTEX_ATTRIB6_NV         0x86CC\n#define GL_EVAL_VERTEX_ATTRIB7_NV         0x86CD\n#define GL_EVAL_VERTEX_ATTRIB8_NV         0x86CE\n#define GL_EVAL_VERTEX_ATTRIB9_NV         0x86CF\n#define GL_EVAL_VERTEX_ATTRIB10_NV        0x86D0\n#define GL_EVAL_VERTEX_ATTRIB11_NV        0x86D1\n#define GL_EVAL_VERTEX_ATTRIB12_NV        0x86D2\n#define GL_EVAL_VERTEX_ATTRIB13_NV        0x86D3\n#define GL_EVAL_VERTEX_ATTRIB14_NV        0x86D4\n#define GL_EVAL_VERTEX_ATTRIB15_NV        0x86D5\n#define GL_MAX_MAP_TESSELLATION_NV        0x86D6\n#define GL_MAX_RATIONAL_EVAL_ORDER_NV     0x86D7\n#endif\n\n#ifndef GL_NV_packed_depth_stencil\n#define GL_DEPTH_STENCIL_NV               0x84F9\n#define GL_UNSIGNED_INT_24_8_NV           0x84FA\n#endif\n\n#ifndef GL_NV_register_combiners2\n#define GL_PER_STAGE_CONSTANTS_NV         0x8535\n#endif\n\n#ifndef GL_NV_texture_compression_vtc\n#endif\n\n#ifndef GL_NV_texture_rectangle\n#define GL_TEXTURE_RECTANGLE_NV           0x84F5\n#define GL_TEXTURE_BINDING_RECTANGLE_NV   0x84F6\n#define GL_PROXY_TEXTURE_RECTANGLE_NV     0x84F7\n#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV  0x84F8\n#endif\n\n#ifndef GL_NV_texture_shader\n#define GL_OFFSET_TEXTURE_RECTANGLE_NV    0x864C\n#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D\n#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E\n#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9\n#define GL_UNSIGNED_INT_S8_S8_8_8_NV      0x86DA\n#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV  0x86DB\n#define GL_DSDT_MAG_INTENSITY_NV          0x86DC\n#define GL_SHADER_CONSISTENT_NV           0x86DD\n#define GL_TEXTURE_SHADER_NV              0x86DE\n#define GL_SHADER_OPERATION_NV            0x86DF\n#define GL_CULL_MODES_NV                  0x86E0\n#define GL_OFFSET_TEXTURE_MATRIX_NV       0x86E1\n#define GL_OFFSET_TEXTURE_SCALE_NV        0x86E2\n#define GL_OFFSET_TEXTURE_BIAS_NV         0x86E3\n#define GL_OFFSET_TEXTURE_2D_MATRIX_NV    GL_OFFSET_TEXTURE_MATRIX_NV\n#define GL_OFFSET_TEXTURE_2D_SCALE_NV     GL_OFFSET_TEXTURE_SCALE_NV\n#define GL_OFFSET_TEXTURE_2D_BIAS_NV      GL_OFFSET_TEXTURE_BIAS_NV\n#define GL_PREVIOUS_TEXTURE_INPUT_NV      0x86E4\n#define GL_CONST_EYE_NV                   0x86E5\n#define GL_PASS_THROUGH_NV                0x86E6\n#define GL_CULL_FRAGMENT_NV               0x86E7\n#define GL_OFFSET_TEXTURE_2D_NV           0x86E8\n#define GL_DEPENDENT_AR_TEXTURE_2D_NV     0x86E9\n#define GL_DEPENDENT_GB_TEXTURE_2D_NV     0x86EA\n#define GL_DOT_PRODUCT_NV                 0x86EC\n#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV   0x86ED\n#define GL_DOT_PRODUCT_TEXTURE_2D_NV      0x86EE\n#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0\n#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1\n#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2\n#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3\n#define GL_HILO_NV                        0x86F4\n#define GL_DSDT_NV                        0x86F5\n#define GL_DSDT_MAG_NV                    0x86F6\n#define GL_DSDT_MAG_VIB_NV                0x86F7\n#define GL_HILO16_NV                      0x86F8\n#define GL_SIGNED_HILO_NV                 0x86F9\n#define GL_SIGNED_HILO16_NV               0x86FA\n#define GL_SIGNED_RGBA_NV                 0x86FB\n#define GL_SIGNED_RGBA8_NV                0x86FC\n#define GL_SIGNED_RGB_NV                  0x86FE\n#define GL_SIGNED_RGB8_NV                 0x86FF\n#define GL_SIGNED_LUMINANCE_NV            0x8701\n#define GL_SIGNED_LUMINANCE8_NV           0x8702\n#define GL_SIGNED_LUMINANCE_ALPHA_NV      0x8703\n#define GL_SIGNED_LUMINANCE8_ALPHA8_NV    0x8704\n#define GL_SIGNED_ALPHA_NV                0x8705\n#define GL_SIGNED_ALPHA8_NV               0x8706\n#define GL_SIGNED_INTENSITY_NV            0x8707\n#define GL_SIGNED_INTENSITY8_NV           0x8708\n#define GL_DSDT8_NV                       0x8709\n#define GL_DSDT8_MAG8_NV                  0x870A\n#define GL_DSDT8_MAG8_INTENSITY8_NV       0x870B\n#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV   0x870C\n#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D\n#define GL_HI_SCALE_NV                    0x870E\n#define GL_LO_SCALE_NV                    0x870F\n#define GL_DS_SCALE_NV                    0x8710\n#define GL_DT_SCALE_NV                    0x8711\n#define GL_MAGNITUDE_SCALE_NV             0x8712\n#define GL_VIBRANCE_SCALE_NV              0x8713\n#define GL_HI_BIAS_NV                     0x8714\n#define GL_LO_BIAS_NV                     0x8715\n#define GL_DS_BIAS_NV                     0x8716\n#define GL_DT_BIAS_NV                     0x8717\n#define GL_MAGNITUDE_BIAS_NV              0x8718\n#define GL_VIBRANCE_BIAS_NV               0x8719\n#define GL_TEXTURE_BORDER_VALUES_NV       0x871A\n#define GL_TEXTURE_HI_SIZE_NV             0x871B\n#define GL_TEXTURE_LO_SIZE_NV             0x871C\n#define GL_TEXTURE_DS_SIZE_NV             0x871D\n#define GL_TEXTURE_DT_SIZE_NV             0x871E\n#define GL_TEXTURE_MAG_SIZE_NV            0x871F\n#endif\n\n#ifndef GL_NV_texture_shader2\n#define GL_DOT_PRODUCT_TEXTURE_3D_NV      0x86EF\n#endif\n\n#ifndef GL_NV_vertex_array_range2\n#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533\n#endif\n\n#ifndef GL_NV_vertex_program\n#define GL_VERTEX_PROGRAM_NV              0x8620\n#define GL_VERTEX_STATE_PROGRAM_NV        0x8621\n#define GL_ATTRIB_ARRAY_SIZE_NV           0x8623\n#define GL_ATTRIB_ARRAY_STRIDE_NV         0x8624\n#define GL_ATTRIB_ARRAY_TYPE_NV           0x8625\n#define GL_CURRENT_ATTRIB_NV              0x8626\n#define GL_PROGRAM_LENGTH_NV              0x8627\n#define GL_PROGRAM_STRING_NV              0x8628\n#define GL_MODELVIEW_PROJECTION_NV        0x8629\n#define GL_IDENTITY_NV                    0x862A\n#define GL_INVERSE_NV                     0x862B\n#define GL_TRANSPOSE_NV                   0x862C\n#define GL_INVERSE_TRANSPOSE_NV           0x862D\n#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E\n#define GL_MAX_TRACK_MATRICES_NV          0x862F\n#define GL_MATRIX0_NV                     0x8630\n#define GL_MATRIX1_NV                     0x8631\n#define GL_MATRIX2_NV                     0x8632\n#define GL_MATRIX3_NV                     0x8633\n#define GL_MATRIX4_NV                     0x8634\n#define GL_MATRIX5_NV                     0x8635\n#define GL_MATRIX6_NV                     0x8636\n#define GL_MATRIX7_NV                     0x8637\n#define GL_CURRENT_MATRIX_STACK_DEPTH_NV  0x8640\n#define GL_CURRENT_MATRIX_NV              0x8641\n#define GL_VERTEX_PROGRAM_POINT_SIZE_NV   0x8642\n#define GL_VERTEX_PROGRAM_TWO_SIDE_NV     0x8643\n#define GL_PROGRAM_PARAMETER_NV           0x8644\n#define GL_ATTRIB_ARRAY_POINTER_NV        0x8645\n#define GL_PROGRAM_TARGET_NV              0x8646\n#define GL_PROGRAM_RESIDENT_NV            0x8647\n#define GL_TRACK_MATRIX_NV                0x8648\n#define GL_TRACK_MATRIX_TRANSFORM_NV      0x8649\n#define GL_VERTEX_PROGRAM_BINDING_NV      0x864A\n#define GL_PROGRAM_ERROR_POSITION_NV      0x864B\n#define GL_VERTEX_ATTRIB_ARRAY0_NV        0x8650\n#define GL_VERTEX_ATTRIB_ARRAY1_NV        0x8651\n#define GL_VERTEX_ATTRIB_ARRAY2_NV        0x8652\n#define GL_VERTEX_ATTRIB_ARRAY3_NV        0x8653\n#define GL_VERTEX_ATTRIB_ARRAY4_NV        0x8654\n#define GL_VERTEX_ATTRIB_ARRAY5_NV        0x8655\n#define GL_VERTEX_ATTRIB_ARRAY6_NV        0x8656\n#define GL_VERTEX_ATTRIB_ARRAY7_NV        0x8657\n#define GL_VERTEX_ATTRIB_ARRAY8_NV        0x8658\n#define GL_VERTEX_ATTRIB_ARRAY9_NV        0x8659\n#define GL_VERTEX_ATTRIB_ARRAY10_NV       0x865A\n#define GL_VERTEX_ATTRIB_ARRAY11_NV       0x865B\n#define GL_VERTEX_ATTRIB_ARRAY12_NV       0x865C\n#define GL_VERTEX_ATTRIB_ARRAY13_NV       0x865D\n#define GL_VERTEX_ATTRIB_ARRAY14_NV       0x865E\n#define GL_VERTEX_ATTRIB_ARRAY15_NV       0x865F\n#define GL_MAP1_VERTEX_ATTRIB0_4_NV       0x8660\n#define GL_MAP1_VERTEX_ATTRIB1_4_NV       0x8661\n#define GL_MAP1_VERTEX_ATTRIB2_4_NV       0x8662\n#define GL_MAP1_VERTEX_ATTRIB3_4_NV       0x8663\n#define GL_MAP1_VERTEX_ATTRIB4_4_NV       0x8664\n#define GL_MAP1_VERTEX_ATTRIB5_4_NV       0x8665\n#define GL_MAP1_VERTEX_ATTRIB6_4_NV       0x8666\n#define GL_MAP1_VERTEX_ATTRIB7_4_NV       0x8667\n#define GL_MAP1_VERTEX_ATTRIB8_4_NV       0x8668\n#define GL_MAP1_VERTEX_ATTRIB9_4_NV       0x8669\n#define GL_MAP1_VERTEX_ATTRIB10_4_NV      0x866A\n#define GL_MAP1_VERTEX_ATTRIB11_4_NV      0x866B\n#define GL_MAP1_VERTEX_ATTRIB12_4_NV      0x866C\n#define GL_MAP1_VERTEX_ATTRIB13_4_NV      0x866D\n#define GL_MAP1_VERTEX_ATTRIB14_4_NV      0x866E\n#define GL_MAP1_VERTEX_ATTRIB15_4_NV      0x866F\n#define GL_MAP2_VERTEX_ATTRIB0_4_NV       0x8670\n#define GL_MAP2_VERTEX_ATTRIB1_4_NV       0x8671\n#define GL_MAP2_VERTEX_ATTRIB2_4_NV       0x8672\n#define GL_MAP2_VERTEX_ATTRIB3_4_NV       0x8673\n#define GL_MAP2_VERTEX_ATTRIB4_4_NV       0x8674\n#define GL_MAP2_VERTEX_ATTRIB5_4_NV       0x8675\n#define GL_MAP2_VERTEX_ATTRIB6_4_NV       0x8676\n#define GL_MAP2_VERTEX_ATTRIB7_4_NV       0x8677\n#define GL_MAP2_VERTEX_ATTRIB8_4_NV       0x8678\n#define GL_MAP2_VERTEX_ATTRIB9_4_NV       0x8679\n#define GL_MAP2_VERTEX_ATTRIB10_4_NV      0x867A\n#define GL_MAP2_VERTEX_ATTRIB11_4_NV      0x867B\n#define GL_MAP2_VERTEX_ATTRIB12_4_NV      0x867C\n#define GL_MAP2_VERTEX_ATTRIB13_4_NV      0x867D\n#define GL_MAP2_VERTEX_ATTRIB14_4_NV      0x867E\n#define GL_MAP2_VERTEX_ATTRIB15_4_NV      0x867F\n#endif\n\n#ifndef GL_SGIX_texture_coordinate_clamp\n#define GL_TEXTURE_MAX_CLAMP_S_SGIX       0x8369\n#define GL_TEXTURE_MAX_CLAMP_T_SGIX       0x836A\n#define GL_TEXTURE_MAX_CLAMP_R_SGIX       0x836B\n#endif\n\n#ifndef GL_SGIX_scalebias_hint\n#define GL_SCALEBIAS_HINT_SGIX            0x8322\n#endif\n\n#ifndef GL_OML_interlace\n#define GL_INTERLACE_OML                  0x8980\n#define GL_INTERLACE_READ_OML             0x8981\n#endif\n\n#ifndef GL_OML_subsample\n#define GL_FORMAT_SUBSAMPLE_24_24_OML     0x8982\n#define GL_FORMAT_SUBSAMPLE_244_244_OML   0x8983\n#endif\n\n#ifndef GL_OML_resample\n#define GL_PACK_RESAMPLE_OML              0x8984\n#define GL_UNPACK_RESAMPLE_OML            0x8985\n#define GL_RESAMPLE_REPLICATE_OML         0x8986\n#define GL_RESAMPLE_ZERO_FILL_OML         0x8987\n#define GL_RESAMPLE_AVERAGE_OML           0x8988\n#define GL_RESAMPLE_DECIMATE_OML          0x8989\n#endif\n\n#ifndef GL_NV_copy_depth_to_color\n#define GL_DEPTH_STENCIL_TO_RGBA_NV       0x886E\n#define GL_DEPTH_STENCIL_TO_BGRA_NV       0x886F\n#endif\n\n#ifndef GL_ATI_envmap_bumpmap\n#define GL_BUMP_ROT_MATRIX_ATI            0x8775\n#define GL_BUMP_ROT_MATRIX_SIZE_ATI       0x8776\n#define GL_BUMP_NUM_TEX_UNITS_ATI         0x8777\n#define GL_BUMP_TEX_UNITS_ATI             0x8778\n#define GL_DUDV_ATI                       0x8779\n#define GL_DU8DV8_ATI                     0x877A\n#define GL_BUMP_ENVMAP_ATI                0x877B\n#define GL_BUMP_TARGET_ATI                0x877C\n#endif\n\n#ifndef GL_ATI_fragment_shader\n#define GL_FRAGMENT_SHADER_ATI            0x8920\n#define GL_REG_0_ATI                      0x8921\n#define GL_REG_1_ATI                      0x8922\n#define GL_REG_2_ATI                      0x8923\n#define GL_REG_3_ATI                      0x8924\n#define GL_REG_4_ATI                      0x8925\n#define GL_REG_5_ATI                      0x8926\n#define GL_REG_6_ATI                      0x8927\n#define GL_REG_7_ATI                      0x8928\n#define GL_REG_8_ATI                      0x8929\n#define GL_REG_9_ATI                      0x892A\n#define GL_REG_10_ATI                     0x892B\n#define GL_REG_11_ATI                     0x892C\n#define GL_REG_12_ATI                     0x892D\n#define GL_REG_13_ATI                     0x892E\n#define GL_REG_14_ATI                     0x892F\n#define GL_REG_15_ATI                     0x8930\n#define GL_REG_16_ATI                     0x8931\n#define GL_REG_17_ATI                     0x8932\n#define GL_REG_18_ATI                     0x8933\n#define GL_REG_19_ATI                     0x8934\n#define GL_REG_20_ATI                     0x8935\n#define GL_REG_21_ATI                     0x8936\n#define GL_REG_22_ATI                     0x8937\n#define GL_REG_23_ATI                     0x8938\n#define GL_REG_24_ATI                     0x8939\n#define GL_REG_25_ATI                     0x893A\n#define GL_REG_26_ATI                     0x893B\n#define GL_REG_27_ATI                     0x893C\n#define GL_REG_28_ATI                     0x893D\n#define GL_REG_29_ATI                     0x893E\n#define GL_REG_30_ATI                     0x893F\n#define GL_REG_31_ATI                     0x8940\n#define GL_CON_0_ATI                      0x8941\n#define GL_CON_1_ATI                      0x8942\n#define GL_CON_2_ATI                      0x8943\n#define GL_CON_3_ATI                      0x8944\n#define GL_CON_4_ATI                      0x8945\n#define GL_CON_5_ATI                      0x8946\n#define GL_CON_6_ATI                      0x8947\n#define GL_CON_7_ATI                      0x8948\n#define GL_CON_8_ATI                      0x8949\n#define GL_CON_9_ATI                      0x894A\n#define GL_CON_10_ATI                     0x894B\n#define GL_CON_11_ATI                     0x894C\n#define GL_CON_12_ATI                     0x894D\n#define GL_CON_13_ATI                     0x894E\n#define GL_CON_14_ATI                     0x894F\n#define GL_CON_15_ATI                     0x8950\n#define GL_CON_16_ATI                     0x8951\n#define GL_CON_17_ATI                     0x8952\n#define GL_CON_18_ATI                     0x8953\n#define GL_CON_19_ATI                     0x8954\n#define GL_CON_20_ATI                     0x8955\n#define GL_CON_21_ATI                     0x8956\n#define GL_CON_22_ATI                     0x8957\n#define GL_CON_23_ATI                     0x8958\n#define GL_CON_24_ATI                     0x8959\n#define GL_CON_25_ATI                     0x895A\n#define GL_CON_26_ATI                     0x895B\n#define GL_CON_27_ATI                     0x895C\n#define GL_CON_28_ATI                     0x895D\n#define GL_CON_29_ATI                     0x895E\n#define GL_CON_30_ATI                     0x895F\n#define GL_CON_31_ATI                     0x8960\n#define GL_MOV_ATI                        0x8961\n#define GL_ADD_ATI                        0x8963\n#define GL_MUL_ATI                        0x8964\n#define GL_SUB_ATI                        0x8965\n#define GL_DOT3_ATI                       0x8966\n#define GL_DOT4_ATI                       0x8967\n#define GL_MAD_ATI                        0x8968\n#define GL_LERP_ATI                       0x8969\n#define GL_CND_ATI                        0x896A\n#define GL_CND0_ATI                       0x896B\n#define GL_DOT2_ADD_ATI                   0x896C\n#define GL_SECONDARY_INTERPOLATOR_ATI     0x896D\n#define GL_NUM_FRAGMENT_REGISTERS_ATI     0x896E\n#define GL_NUM_FRAGMENT_CONSTANTS_ATI     0x896F\n#define GL_NUM_PASSES_ATI                 0x8970\n#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI  0x8971\n#define GL_NUM_INSTRUCTIONS_TOTAL_ATI     0x8972\n#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973\n#define GL_NUM_LOOPBACK_COMPONENTS_ATI    0x8974\n#define GL_COLOR_ALPHA_PAIRING_ATI        0x8975\n#define GL_SWIZZLE_STR_ATI                0x8976\n#define GL_SWIZZLE_STQ_ATI                0x8977\n#define GL_SWIZZLE_STR_DR_ATI             0x8978\n#define GL_SWIZZLE_STQ_DQ_ATI             0x8979\n#define GL_SWIZZLE_STRQ_ATI               0x897A\n#define GL_SWIZZLE_STRQ_DQ_ATI            0x897B\n#define GL_RED_BIT_ATI                    0x00000001\n#define GL_GREEN_BIT_ATI                  0x00000002\n#define GL_BLUE_BIT_ATI                   0x00000004\n#define GL_2X_BIT_ATI                     0x00000001\n#define GL_4X_BIT_ATI                     0x00000002\n#define GL_8X_BIT_ATI                     0x00000004\n#define GL_HALF_BIT_ATI                   0x00000008\n#define GL_QUARTER_BIT_ATI                0x00000010\n#define GL_EIGHTH_BIT_ATI                 0x00000020\n#define GL_SATURATE_BIT_ATI               0x00000040\n#define GL_COMP_BIT_ATI                   0x00000002\n#define GL_NEGATE_BIT_ATI                 0x00000004\n#define GL_BIAS_BIT_ATI                   0x00000008\n#endif\n\n#ifndef GL_ATI_pn_triangles\n#define GL_PN_TRIANGLES_ATI               0x87F0\n#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1\n#define GL_PN_TRIANGLES_POINT_MODE_ATI    0x87F2\n#define GL_PN_TRIANGLES_NORMAL_MODE_ATI   0x87F3\n#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4\n#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5\n#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6\n#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7\n#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8\n#endif\n\n#ifndef GL_ATI_vertex_array_object\n#define GL_STATIC_ATI                     0x8760\n#define GL_DYNAMIC_ATI                    0x8761\n#define GL_PRESERVE_ATI                   0x8762\n#define GL_DISCARD_ATI                    0x8763\n#define GL_OBJECT_BUFFER_SIZE_ATI         0x8764\n#define GL_OBJECT_BUFFER_USAGE_ATI        0x8765\n#define GL_ARRAY_OBJECT_BUFFER_ATI        0x8766\n#define GL_ARRAY_OBJECT_OFFSET_ATI        0x8767\n#endif\n\n#ifndef GL_EXT_vertex_shader\n#define GL_VERTEX_SHADER_EXT              0x8780\n#define GL_VERTEX_SHADER_BINDING_EXT      0x8781\n#define GL_OP_INDEX_EXT                   0x8782\n#define GL_OP_NEGATE_EXT                  0x8783\n#define GL_OP_DOT3_EXT                    0x8784\n#define GL_OP_DOT4_EXT                    0x8785\n#define GL_OP_MUL_EXT                     0x8786\n#define GL_OP_ADD_EXT                     0x8787\n#define GL_OP_MADD_EXT                    0x8788\n#define GL_OP_FRAC_EXT                    0x8789\n#define GL_OP_MAX_EXT                     0x878A\n#define GL_OP_MIN_EXT                     0x878B\n#define GL_OP_SET_GE_EXT                  0x878C\n#define GL_OP_SET_LT_EXT                  0x878D\n#define GL_OP_CLAMP_EXT                   0x878E\n#define GL_OP_FLOOR_EXT                   0x878F\n#define GL_OP_ROUND_EXT                   0x8790\n#define GL_OP_EXP_BASE_2_EXT              0x8791\n#define GL_OP_LOG_BASE_2_EXT              0x8792\n#define GL_OP_POWER_EXT                   0x8793\n#define GL_OP_RECIP_EXT                   0x8794\n#define GL_OP_RECIP_SQRT_EXT              0x8795\n#define GL_OP_SUB_EXT                     0x8796\n#define GL_OP_CROSS_PRODUCT_EXT           0x8797\n#define GL_OP_MULTIPLY_MATRIX_EXT         0x8798\n#define GL_OP_MOV_EXT                     0x8799\n#define GL_OUTPUT_VERTEX_EXT              0x879A\n#define GL_OUTPUT_COLOR0_EXT              0x879B\n#define GL_OUTPUT_COLOR1_EXT              0x879C\n#define GL_OUTPUT_TEXTURE_COORD0_EXT      0x879D\n#define GL_OUTPUT_TEXTURE_COORD1_EXT      0x879E\n#define GL_OUTPUT_TEXTURE_COORD2_EXT      0x879F\n#define GL_OUTPUT_TEXTURE_COORD3_EXT      0x87A0\n#define GL_OUTPUT_TEXTURE_COORD4_EXT      0x87A1\n#define GL_OUTPUT_TEXTURE_COORD5_EXT      0x87A2\n#define GL_OUTPUT_TEXTURE_COORD6_EXT      0x87A3\n#define GL_OUTPUT_TEXTURE_COORD7_EXT      0x87A4\n#define GL_OUTPUT_TEXTURE_COORD8_EXT      0x87A5\n#define GL_OUTPUT_TEXTURE_COORD9_EXT      0x87A6\n#define GL_OUTPUT_TEXTURE_COORD10_EXT     0x87A7\n#define GL_OUTPUT_TEXTURE_COORD11_EXT     0x87A8\n#define GL_OUTPUT_TEXTURE_COORD12_EXT     0x87A9\n#define GL_OUTPUT_TEXTURE_COORD13_EXT     0x87AA\n#define GL_OUTPUT_TEXTURE_COORD14_EXT     0x87AB\n#define GL_OUTPUT_TEXTURE_COORD15_EXT     0x87AC\n#define GL_OUTPUT_TEXTURE_COORD16_EXT     0x87AD\n#define GL_OUTPUT_TEXTURE_COORD17_EXT     0x87AE\n#define GL_OUTPUT_TEXTURE_COORD18_EXT     0x87AF\n#define GL_OUTPUT_TEXTURE_COORD19_EXT     0x87B0\n#define GL_OUTPUT_TEXTURE_COORD20_EXT     0x87B1\n#define GL_OUTPUT_TEXTURE_COORD21_EXT     0x87B2\n#define GL_OUTPUT_TEXTURE_COORD22_EXT     0x87B3\n#define GL_OUTPUT_TEXTURE_COORD23_EXT     0x87B4\n#define GL_OUTPUT_TEXTURE_COORD24_EXT     0x87B5\n#define GL_OUTPUT_TEXTURE_COORD25_EXT     0x87B6\n#define GL_OUTPUT_TEXTURE_COORD26_EXT     0x87B7\n#define GL_OUTPUT_TEXTURE_COORD27_EXT     0x87B8\n#define GL_OUTPUT_TEXTURE_COORD28_EXT     0x87B9\n#define GL_OUTPUT_TEXTURE_COORD29_EXT     0x87BA\n#define GL_OUTPUT_TEXTURE_COORD30_EXT     0x87BB\n#define GL_OUTPUT_TEXTURE_COORD31_EXT     0x87BC\n#define GL_OUTPUT_FOG_EXT                 0x87BD\n#define GL_SCALAR_EXT                     0x87BE\n#define GL_VECTOR_EXT                     0x87BF\n#define GL_MATRIX_EXT                     0x87C0\n#define GL_VARIANT_EXT                    0x87C1\n#define GL_INVARIANT_EXT                  0x87C2\n#define GL_LOCAL_CONSTANT_EXT             0x87C3\n#define GL_LOCAL_EXT                      0x87C4\n#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5\n#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6\n#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7\n#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8\n#define GL_MAX_VERTEX_SHADER_LOCALS_EXT   0x87C9\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE\n#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF\n#define GL_VERTEX_SHADER_VARIANTS_EXT     0x87D0\n#define GL_VERTEX_SHADER_INVARIANTS_EXT   0x87D1\n#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2\n#define GL_VERTEX_SHADER_LOCALS_EXT       0x87D3\n#define GL_VERTEX_SHADER_OPTIMIZED_EXT    0x87D4\n#define GL_X_EXT                          0x87D5\n#define GL_Y_EXT                          0x87D6\n#define GL_Z_EXT                          0x87D7\n#define GL_W_EXT                          0x87D8\n#define GL_NEGATIVE_X_EXT                 0x87D9\n#define GL_NEGATIVE_Y_EXT                 0x87DA\n#define GL_NEGATIVE_Z_EXT                 0x87DB\n#define GL_NEGATIVE_W_EXT                 0x87DC\n#define GL_ZERO_EXT                       0x87DD\n#define GL_ONE_EXT                        0x87DE\n#define GL_NEGATIVE_ONE_EXT               0x87DF\n#define GL_NORMALIZED_RANGE_EXT           0x87E0\n#define GL_FULL_RANGE_EXT                 0x87E1\n#define GL_CURRENT_VERTEX_EXT             0x87E2\n#define GL_MVP_MATRIX_EXT                 0x87E3\n#define GL_VARIANT_VALUE_EXT              0x87E4\n#define GL_VARIANT_DATATYPE_EXT           0x87E5\n#define GL_VARIANT_ARRAY_STRIDE_EXT       0x87E6\n#define GL_VARIANT_ARRAY_TYPE_EXT         0x87E7\n#define GL_VARIANT_ARRAY_EXT              0x87E8\n#define GL_VARIANT_ARRAY_POINTER_EXT      0x87E9\n#define GL_INVARIANT_VALUE_EXT            0x87EA\n#define GL_INVARIANT_DATATYPE_EXT         0x87EB\n#define GL_LOCAL_CONSTANT_VALUE_EXT       0x87EC\n#define GL_LOCAL_CONSTANT_DATATYPE_EXT    0x87ED\n#endif\n\n#ifndef GL_ATI_vertex_streams\n#define GL_MAX_VERTEX_STREAMS_ATI         0x876B\n#define GL_VERTEX_STREAM0_ATI             0x876C\n#define GL_VERTEX_STREAM1_ATI             0x876D\n#define GL_VERTEX_STREAM2_ATI             0x876E\n#define GL_VERTEX_STREAM3_ATI             0x876F\n#define GL_VERTEX_STREAM4_ATI             0x8770\n#define GL_VERTEX_STREAM5_ATI             0x8771\n#define GL_VERTEX_STREAM6_ATI             0x8772\n#define GL_VERTEX_STREAM7_ATI             0x8773\n#define GL_VERTEX_SOURCE_ATI              0x8774\n#endif\n\n#ifndef GL_ATI_element_array\n#define GL_ELEMENT_ARRAY_ATI              0x8768\n#define GL_ELEMENT_ARRAY_TYPE_ATI         0x8769\n#define GL_ELEMENT_ARRAY_POINTER_ATI      0x876A\n#endif\n\n#ifndef GL_SUN_mesh_array\n#define GL_QUAD_MESH_SUN                  0x8614\n#define GL_TRIANGLE_MESH_SUN              0x8615\n#endif\n\n#ifndef GL_SUN_slice_accum\n#define GL_SLICE_ACCUM_SUN                0x85CC\n#endif\n\n#ifndef GL_NV_multisample_filter_hint\n#define GL_MULTISAMPLE_FILTER_HINT_NV     0x8534\n#endif\n\n#ifndef GL_NV_depth_clamp\n#define GL_DEPTH_CLAMP_NV                 0x864F\n#endif\n\n#ifndef GL_NV_occlusion_query\n#define GL_PIXEL_COUNTER_BITS_NV          0x8864\n#define GL_CURRENT_OCCLUSION_QUERY_ID_NV  0x8865\n#define GL_PIXEL_COUNT_NV                 0x8866\n#define GL_PIXEL_COUNT_AVAILABLE_NV       0x8867\n#endif\n\n#ifndef GL_NV_point_sprite\n#define GL_POINT_SPRITE_NV                0x8861\n#define GL_COORD_REPLACE_NV               0x8862\n#define GL_POINT_SPRITE_R_MODE_NV         0x8863\n#endif\n\n#ifndef GL_NV_texture_shader3\n#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850\n#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851\n#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852\n#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853\n#define GL_OFFSET_HILO_TEXTURE_2D_NV      0x8854\n#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855\n#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856\n#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857\n#define GL_DEPENDENT_HILO_TEXTURE_2D_NV   0x8858\n#define GL_DEPENDENT_RGB_TEXTURE_3D_NV    0x8859\n#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A\n#define GL_DOT_PRODUCT_PASS_THROUGH_NV    0x885B\n#define GL_DOT_PRODUCT_TEXTURE_1D_NV      0x885C\n#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D\n#define GL_HILO8_NV                       0x885E\n#define GL_SIGNED_HILO8_NV                0x885F\n#define GL_FORCE_BLUE_TO_ONE_NV           0x8860\n#endif\n\n#ifndef GL_NV_vertex_program1_1\n#endif\n\n#ifndef GL_EXT_shadow_funcs\n#endif\n\n#ifndef GL_EXT_stencil_two_side\n#define GL_STENCIL_TEST_TWO_SIDE_EXT      0x8910\n#define GL_ACTIVE_STENCIL_FACE_EXT        0x8911\n#endif\n\n#ifndef GL_ATI_text_fragment_shader\n#define GL_TEXT_FRAGMENT_SHADER_ATI       0x8200\n#endif\n\n#ifndef GL_APPLE_client_storage\n#define GL_UNPACK_CLIENT_STORAGE_APPLE    0x85B2\n#endif\n\n#ifndef GL_APPLE_element_array\n#define GL_ELEMENT_ARRAY_APPLE            0x8A0C\n#define GL_ELEMENT_ARRAY_TYPE_APPLE       0x8A0D\n#define GL_ELEMENT_ARRAY_POINTER_APPLE    0x8A0E\n#endif\n\n#ifndef GL_APPLE_fence\n#define GL_DRAW_PIXELS_APPLE              0x8A0A\n#define GL_FENCE_APPLE                    0x8A0B\n#endif\n\n#ifndef GL_APPLE_vertex_array_object\n#define GL_VERTEX_ARRAY_BINDING_APPLE     0x85B5\n#endif\n\n#ifndef GL_APPLE_vertex_array_range\n#define GL_VERTEX_ARRAY_RANGE_APPLE       0x851D\n#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E\n#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F\n#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521\n#define GL_STORAGE_CLIENT_APPLE           0x85B4\n#define GL_STORAGE_CACHED_APPLE           0x85BE\n#define GL_STORAGE_SHARED_APPLE           0x85BF\n#endif\n\n#ifndef GL_APPLE_ycbcr_422\n#define GL_YCBCR_422_APPLE                0x85B9\n#define GL_UNSIGNED_SHORT_8_8_APPLE       0x85BA\n#define GL_UNSIGNED_SHORT_8_8_REV_APPLE   0x85BB\n#endif\n\n#ifndef GL_S3_s3tc\n#define GL_RGB_S3TC                       0x83A0\n#define GL_RGB4_S3TC                      0x83A1\n#define GL_RGBA_S3TC                      0x83A2\n#define GL_RGBA4_S3TC                     0x83A3\n#define GL_RGBA_DXT5_S3TC                 0x83A4\n#define GL_RGBA4_DXT5_S3TC                0x83A5\n#endif\n\n#ifndef GL_ATI_draw_buffers\n#define GL_MAX_DRAW_BUFFERS_ATI           0x8824\n#define GL_DRAW_BUFFER0_ATI               0x8825\n#define GL_DRAW_BUFFER1_ATI               0x8826\n#define GL_DRAW_BUFFER2_ATI               0x8827\n#define GL_DRAW_BUFFER3_ATI               0x8828\n#define GL_DRAW_BUFFER4_ATI               0x8829\n#define GL_DRAW_BUFFER5_ATI               0x882A\n#define GL_DRAW_BUFFER6_ATI               0x882B\n#define GL_DRAW_BUFFER7_ATI               0x882C\n#define GL_DRAW_BUFFER8_ATI               0x882D\n#define GL_DRAW_BUFFER9_ATI               0x882E\n#define GL_DRAW_BUFFER10_ATI              0x882F\n#define GL_DRAW_BUFFER11_ATI              0x8830\n#define GL_DRAW_BUFFER12_ATI              0x8831\n#define GL_DRAW_BUFFER13_ATI              0x8832\n#define GL_DRAW_BUFFER14_ATI              0x8833\n#define GL_DRAW_BUFFER15_ATI              0x8834\n#endif\n\n#ifndef GL_ATI_pixel_format_float\n#define GL_RGBA_FLOAT_MODE_ATI            0x8820\n#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835\n#endif\n\n#ifndef GL_ATI_texture_env_combine3\n#define GL_MODULATE_ADD_ATI               0x8744\n#define GL_MODULATE_SIGNED_ADD_ATI        0x8745\n#define GL_MODULATE_SUBTRACT_ATI          0x8746\n#endif\n\n#ifndef GL_ATI_texture_float\n#define GL_RGBA_FLOAT32_ATI               0x8814\n#define GL_RGB_FLOAT32_ATI                0x8815\n#define GL_ALPHA_FLOAT32_ATI              0x8816\n#define GL_INTENSITY_FLOAT32_ATI          0x8817\n#define GL_LUMINANCE_FLOAT32_ATI          0x8818\n#define GL_LUMINANCE_ALPHA_FLOAT32_ATI    0x8819\n#define GL_RGBA_FLOAT16_ATI               0x881A\n#define GL_RGB_FLOAT16_ATI                0x881B\n#define GL_ALPHA_FLOAT16_ATI              0x881C\n#define GL_INTENSITY_FLOAT16_ATI          0x881D\n#define GL_LUMINANCE_FLOAT16_ATI          0x881E\n#define GL_LUMINANCE_ALPHA_FLOAT16_ATI    0x881F\n#endif\n\n#ifndef GL_NV_float_buffer\n#define GL_FLOAT_R_NV                     0x8880\n#define GL_FLOAT_RG_NV                    0x8881\n#define GL_FLOAT_RGB_NV                   0x8882\n#define GL_FLOAT_RGBA_NV                  0x8883\n#define GL_FLOAT_R16_NV                   0x8884\n#define GL_FLOAT_R32_NV                   0x8885\n#define GL_FLOAT_RG16_NV                  0x8886\n#define GL_FLOAT_RG32_NV                  0x8887\n#define GL_FLOAT_RGB16_NV                 0x8888\n#define GL_FLOAT_RGB32_NV                 0x8889\n#define GL_FLOAT_RGBA16_NV                0x888A\n#define GL_FLOAT_RGBA32_NV                0x888B\n#define GL_TEXTURE_FLOAT_COMPONENTS_NV    0x888C\n#define GL_FLOAT_CLEAR_COLOR_VALUE_NV     0x888D\n#define GL_FLOAT_RGBA_MODE_NV             0x888E\n#endif\n\n#ifndef GL_NV_fragment_program\n#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868\n#define GL_FRAGMENT_PROGRAM_NV            0x8870\n#define GL_MAX_TEXTURE_COORDS_NV          0x8871\n#define GL_MAX_TEXTURE_IMAGE_UNITS_NV     0x8872\n#define GL_FRAGMENT_PROGRAM_BINDING_NV    0x8873\n#define GL_PROGRAM_ERROR_STRING_NV        0x8874\n#endif\n\n#ifndef GL_NV_half_float\n#define GL_HALF_FLOAT_NV                  0x140B\n#endif\n\n#ifndef GL_NV_pixel_data_range\n#define GL_WRITE_PIXEL_DATA_RANGE_NV      0x8878\n#define GL_READ_PIXEL_DATA_RANGE_NV       0x8879\n#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A\n#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B\n#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C\n#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D\n#endif\n\n#ifndef GL_NV_primitive_restart\n#define GL_PRIMITIVE_RESTART_NV           0x8558\n#define GL_PRIMITIVE_RESTART_INDEX_NV     0x8559\n#endif\n\n#ifndef GL_NV_texture_expand_normal\n#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F\n#endif\n\n#ifndef GL_NV_vertex_program2\n#endif\n\n#ifndef GL_ATI_map_object_buffer\n#endif\n\n#ifndef GL_ATI_separate_stencil\n#define GL_STENCIL_BACK_FUNC_ATI          0x8800\n#define GL_STENCIL_BACK_FAIL_ATI          0x8801\n#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802\n#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803\n#endif\n\n#ifndef GL_ATI_vertex_attrib_array_object\n#endif\n\n#ifndef GL_OES_read_format\n#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A\n#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B\n#endif\n\n#ifndef GL_EXT_depth_bounds_test\n#define GL_DEPTH_BOUNDS_TEST_EXT          0x8890\n#define GL_DEPTH_BOUNDS_EXT               0x8891\n#endif\n\n#ifndef GL_EXT_texture_mirror_clamp\n#define GL_MIRROR_CLAMP_EXT               0x8742\n#define GL_MIRROR_CLAMP_TO_EDGE_EXT       0x8743\n#define GL_MIRROR_CLAMP_TO_BORDER_EXT     0x8912\n#endif\n\n#ifndef GL_EXT_blend_equation_separate\n#define GL_BLEND_EQUATION_RGB_EXT         0x8009\n#define GL_BLEND_EQUATION_ALPHA_EXT       0x883D\n#endif\n\n#ifndef GL_MESA_pack_invert\n#define GL_PACK_INVERT_MESA               0x8758\n#endif\n\n#ifndef GL_MESA_ycbcr_texture\n#define GL_UNSIGNED_SHORT_8_8_MESA        0x85BA\n#define GL_UNSIGNED_SHORT_8_8_REV_MESA    0x85BB\n#define GL_YCBCR_MESA                     0x8757\n#endif\n\n#ifndef GL_EXT_pixel_buffer_object\n#define GL_PIXEL_PACK_BUFFER_EXT          0x88EB\n#define GL_PIXEL_UNPACK_BUFFER_EXT        0x88EC\n#define GL_PIXEL_PACK_BUFFER_BINDING_EXT  0x88ED\n#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF\n#endif\n\n#ifndef GL_NV_fragment_program_option\n#endif\n\n#ifndef GL_NV_fragment_program2\n#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4\n#define GL_MAX_PROGRAM_CALL_DEPTH_NV      0x88F5\n#define GL_MAX_PROGRAM_IF_DEPTH_NV        0x88F6\n#define GL_MAX_PROGRAM_LOOP_DEPTH_NV      0x88F7\n#define GL_MAX_PROGRAM_LOOP_COUNT_NV      0x88F8\n#endif\n\n#ifndef GL_NV_vertex_program2_option\n/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */\n/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */\n#endif\n\n#ifndef GL_NV_vertex_program3\n/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */\n#endif\n\n#ifndef GL_EXT_framebuffer_object\n#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506\n#define GL_MAX_RENDERBUFFER_SIZE_EXT      0x84E8\n#define GL_FRAMEBUFFER_BINDING_EXT        0x8CA6\n#define GL_RENDERBUFFER_BINDING_EXT       0x8CA7\n#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0\n#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4\n#define GL_FRAMEBUFFER_COMPLETE_EXT       0x8CD5\n#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6\n#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7\n#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9\n#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA\n#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB\n#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC\n#define GL_FRAMEBUFFER_UNSUPPORTED_EXT    0x8CDD\n#define GL_MAX_COLOR_ATTACHMENTS_EXT      0x8CDF\n#define GL_COLOR_ATTACHMENT0_EXT          0x8CE0\n#define GL_COLOR_ATTACHMENT1_EXT          0x8CE1\n#define GL_COLOR_ATTACHMENT2_EXT          0x8CE2\n#define GL_COLOR_ATTACHMENT3_EXT          0x8CE3\n#define GL_COLOR_ATTACHMENT4_EXT          0x8CE4\n#define GL_COLOR_ATTACHMENT5_EXT          0x8CE5\n#define GL_COLOR_ATTACHMENT6_EXT          0x8CE6\n#define GL_COLOR_ATTACHMENT7_EXT          0x8CE7\n#define GL_COLOR_ATTACHMENT8_EXT          0x8CE8\n#define GL_COLOR_ATTACHMENT9_EXT          0x8CE9\n#define GL_COLOR_ATTACHMENT10_EXT         0x8CEA\n#define GL_COLOR_ATTACHMENT11_EXT         0x8CEB\n#define GL_COLOR_ATTACHMENT12_EXT         0x8CEC\n#define GL_COLOR_ATTACHMENT13_EXT         0x8CED\n#define GL_COLOR_ATTACHMENT14_EXT         0x8CEE\n#define GL_COLOR_ATTACHMENT15_EXT         0x8CEF\n#define GL_DEPTH_ATTACHMENT_EXT           0x8D00\n#define GL_STENCIL_ATTACHMENT_EXT         0x8D20\n#define GL_FRAMEBUFFER_EXT                0x8D40\n#define GL_RENDERBUFFER_EXT               0x8D41\n#define GL_RENDERBUFFER_WIDTH_EXT         0x8D42\n#define GL_RENDERBUFFER_HEIGHT_EXT        0x8D43\n#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44\n#define GL_STENCIL_INDEX1_EXT             0x8D46\n#define GL_STENCIL_INDEX4_EXT             0x8D47\n#define GL_STENCIL_INDEX8_EXT             0x8D48\n#define GL_STENCIL_INDEX16_EXT            0x8D49\n#define GL_RENDERBUFFER_RED_SIZE_EXT      0x8D50\n#define GL_RENDERBUFFER_GREEN_SIZE_EXT    0x8D51\n#define GL_RENDERBUFFER_BLUE_SIZE_EXT     0x8D52\n#define GL_RENDERBUFFER_ALPHA_SIZE_EXT    0x8D53\n#define GL_RENDERBUFFER_DEPTH_SIZE_EXT    0x8D54\n#define GL_RENDERBUFFER_STENCIL_SIZE_EXT  0x8D55\n#endif\n\n#ifndef GL_GREMEDY_string_marker\n#endif\n\n#ifndef GL_EXT_packed_depth_stencil\n#define GL_DEPTH_STENCIL_EXT              0x84F9\n#define GL_UNSIGNED_INT_24_8_EXT          0x84FA\n#define GL_DEPTH24_STENCIL8_EXT           0x88F0\n#define GL_TEXTURE_STENCIL_SIZE_EXT       0x88F1\n#endif\n\n#ifndef GL_EXT_stencil_clear_tag\n#define GL_STENCIL_TAG_BITS_EXT           0x88F2\n#define GL_STENCIL_CLEAR_TAG_VALUE_EXT    0x88F3\n#endif\n\n#ifndef GL_EXT_texture_sRGB\n#define GL_SRGB_EXT                       0x8C40\n#define GL_SRGB8_EXT                      0x8C41\n#define GL_SRGB_ALPHA_EXT                 0x8C42\n#define GL_SRGB8_ALPHA8_EXT               0x8C43\n#define GL_SLUMINANCE_ALPHA_EXT           0x8C44\n#define GL_SLUMINANCE8_ALPHA8_EXT         0x8C45\n#define GL_SLUMINANCE_EXT                 0x8C46\n#define GL_SLUMINANCE8_EXT                0x8C47\n#define GL_COMPRESSED_SRGB_EXT            0x8C48\n#define GL_COMPRESSED_SRGB_ALPHA_EXT      0x8C49\n#define GL_COMPRESSED_SLUMINANCE_EXT      0x8C4A\n#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B\n#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  0x8C4C\n#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D\n#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E\n#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F\n#endif\n\n#ifndef GL_EXT_framebuffer_blit\n#define GL_READ_FRAMEBUFFER_EXT           0x8CA8\n#define GL_DRAW_FRAMEBUFFER_EXT           0x8CA9\n#define GL_DRAW_FRAMEBUFFER_BINDING_EXT   GL_FRAMEBUFFER_BINDING_EXT\n#define GL_READ_FRAMEBUFFER_BINDING_EXT   0x8CAA\n#endif\n\n#ifndef GL_EXT_framebuffer_multisample\n#define GL_RENDERBUFFER_SAMPLES_EXT       0x8CAB\n#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56\n#define GL_MAX_SAMPLES_EXT                0x8D57\n#endif\n\n#ifndef GL_MESAX_texture_stack\n#define GL_TEXTURE_1D_STACK_MESAX         0x8759\n#define GL_TEXTURE_2D_STACK_MESAX         0x875A\n#define GL_PROXY_TEXTURE_1D_STACK_MESAX   0x875B\n#define GL_PROXY_TEXTURE_2D_STACK_MESAX   0x875C\n#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D\n#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E\n#endif\n\n#ifndef GL_EXT_timer_query\n#define GL_TIME_ELAPSED_EXT               0x88BF\n#endif\n\n#ifndef GL_EXT_gpu_program_parameters\n#endif\n\n#ifndef GL_APPLE_flush_buffer_range\n#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12\n#define GL_BUFFER_FLUSHING_UNMAP_APPLE    0x8A13\n#endif\n\n#ifndef GL_NV_gpu_program4\n#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV    0x8904\n#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV    0x8905\n#define GL_PROGRAM_ATTRIB_COMPONENTS_NV   0x8906\n#define GL_PROGRAM_RESULT_COMPONENTS_NV   0x8907\n#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908\n#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909\n#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5\n#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6\n#endif\n\n#ifndef GL_NV_geometry_program4\n#define GL_LINES_ADJACENCY_EXT            0x000A\n#define GL_LINE_STRIP_ADJACENCY_EXT       0x000B\n#define GL_TRIANGLES_ADJACENCY_EXT        0x000C\n#define GL_TRIANGLE_STRIP_ADJACENCY_EXT   0x000D\n#define GL_GEOMETRY_PROGRAM_NV            0x8C26\n#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27\n#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28\n#define GL_GEOMETRY_VERTICES_OUT_EXT      0x8DDA\n#define GL_GEOMETRY_INPUT_TYPE_EXT        0x8DDB\n#define GL_GEOMETRY_OUTPUT_TYPE_EXT       0x8DDC\n#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29\n#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4\n#define GL_PROGRAM_POINT_SIZE_EXT         0x8642\n#endif\n\n#ifndef GL_EXT_geometry_shader4\n#define GL_GEOMETRY_SHADER_EXT            0x8DD9\n/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */\n/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */\n/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */\n/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */\n#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD\n#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE\n#define GL_MAX_VARYING_COMPONENTS_EXT     0x8B4B\n#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF\n#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0\n#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1\n/* reuse GL_LINES_ADJACENCY_EXT */\n/* reuse GL_LINE_STRIP_ADJACENCY_EXT */\n/* reuse GL_TRIANGLES_ADJACENCY_EXT */\n/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */\n/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */\n/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */\n/* reuse GL_PROGRAM_POINT_SIZE_EXT */\n#endif\n\n#ifndef GL_NV_vertex_program4\n#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD\n#endif\n\n#ifndef GL_EXT_gpu_shader4\n#define GL_SAMPLER_1D_ARRAY_EXT           0x8DC0\n#define GL_SAMPLER_2D_ARRAY_EXT           0x8DC1\n#define GL_SAMPLER_BUFFER_EXT             0x8DC2\n#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT    0x8DC3\n#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT    0x8DC4\n#define GL_SAMPLER_CUBE_SHADOW_EXT        0x8DC5\n#define GL_UNSIGNED_INT_VEC2_EXT          0x8DC6\n#define GL_UNSIGNED_INT_VEC3_EXT          0x8DC7\n#define GL_UNSIGNED_INT_VEC4_EXT          0x8DC8\n#define GL_INT_SAMPLER_1D_EXT             0x8DC9\n#define GL_INT_SAMPLER_2D_EXT             0x8DCA\n#define GL_INT_SAMPLER_3D_EXT             0x8DCB\n#define GL_INT_SAMPLER_CUBE_EXT           0x8DCC\n#define GL_INT_SAMPLER_2D_RECT_EXT        0x8DCD\n#define GL_INT_SAMPLER_1D_ARRAY_EXT       0x8DCE\n#define GL_INT_SAMPLER_2D_ARRAY_EXT       0x8DCF\n#define GL_INT_SAMPLER_BUFFER_EXT         0x8DD0\n#define GL_UNSIGNED_INT_SAMPLER_1D_EXT    0x8DD1\n#define GL_UNSIGNED_INT_SAMPLER_2D_EXT    0x8DD2\n#define GL_UNSIGNED_INT_SAMPLER_3D_EXT    0x8DD3\n#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT  0x8DD4\n#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5\n#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6\n#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7\n#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8\n#endif\n\n#ifndef GL_EXT_draw_instanced\n#endif\n\n#ifndef GL_EXT_packed_float\n#define GL_R11F_G11F_B10F_EXT             0x8C3A\n#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B\n#define GL_RGBA_SIGNED_COMPONENTS_EXT     0x8C3C\n#endif\n\n#ifndef GL_EXT_texture_array\n#define GL_TEXTURE_1D_ARRAY_EXT           0x8C18\n#define GL_PROXY_TEXTURE_1D_ARRAY_EXT     0x8C19\n#define GL_TEXTURE_2D_ARRAY_EXT           0x8C1A\n#define GL_PROXY_TEXTURE_2D_ARRAY_EXT     0x8C1B\n#define GL_TEXTURE_BINDING_1D_ARRAY_EXT   0x8C1C\n#define GL_TEXTURE_BINDING_2D_ARRAY_EXT   0x8C1D\n#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT   0x88FF\n#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E\n/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */\n#endif\n\n#ifndef GL_EXT_texture_buffer_object\n#define GL_TEXTURE_BUFFER_EXT             0x8C2A\n#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT    0x8C2B\n#define GL_TEXTURE_BINDING_BUFFER_EXT     0x8C2C\n#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D\n#define GL_TEXTURE_BUFFER_FORMAT_EXT      0x8C2E\n#endif\n\n#ifndef GL_EXT_texture_compression_latc\n#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70\n#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71\n#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72\n#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73\n#endif\n\n#ifndef GL_EXT_texture_compression_rgtc\n#define GL_COMPRESSED_RED_RGTC1_EXT       0x8DBB\n#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC\n#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD\n#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE\n#endif\n\n#ifndef GL_EXT_texture_shared_exponent\n#define GL_RGB9_E5_EXT                    0x8C3D\n#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT   0x8C3E\n#define GL_TEXTURE_SHARED_SIZE_EXT        0x8C3F\n#endif\n\n#ifndef GL_NV_depth_buffer_float\n#define GL_DEPTH_COMPONENT32F_NV          0x8DAB\n#define GL_DEPTH32F_STENCIL8_NV           0x8DAC\n#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD\n#define GL_DEPTH_BUFFER_FLOAT_MODE_NV     0x8DAF\n#endif\n\n#ifndef GL_NV_fragment_program4\n#endif\n\n#ifndef GL_NV_framebuffer_multisample_coverage\n#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB\n#define GL_RENDERBUFFER_COLOR_SAMPLES_NV  0x8E10\n#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11\n#define GL_MULTISAMPLE_COVERAGE_MODES_NV  0x8E12\n#endif\n\n#ifndef GL_EXT_framebuffer_sRGB\n#define GL_FRAMEBUFFER_SRGB_EXT           0x8DB9\n#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT   0x8DBA\n#endif\n\n#ifndef GL_NV_geometry_shader4\n#endif\n\n#ifndef GL_NV_parameter_buffer_object\n#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0\n#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1\n#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2\n#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3\n#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4\n#endif\n\n#ifndef GL_EXT_draw_buffers2\n#endif\n\n#ifndef GL_NV_transform_feedback\n#define GL_BACK_PRIMARY_COLOR_NV          0x8C77\n#define GL_BACK_SECONDARY_COLOR_NV        0x8C78\n#define GL_TEXTURE_COORD_NV               0x8C79\n#define GL_CLIP_DISTANCE_NV               0x8C7A\n#define GL_VERTEX_ID_NV                   0x8C7B\n#define GL_PRIMITIVE_ID_NV                0x8C7C\n#define GL_GENERIC_ATTRIB_NV              0x8C7D\n#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV  0x8C7E\n#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80\n#define GL_ACTIVE_VARYINGS_NV             0x8C81\n#define GL_ACTIVE_VARYING_MAX_LENGTH_NV   0x8C82\n#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83\n#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84\n#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85\n#define GL_TRANSFORM_FEEDBACK_RECORD_NV   0x8C86\n#define GL_PRIMITIVES_GENERATED_NV        0x8C87\n#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88\n#define GL_RASTERIZER_DISCARD_NV          0x8C89\n#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B\n#define GL_INTERLEAVED_ATTRIBS_NV         0x8C8C\n#define GL_SEPARATE_ATTRIBS_NV            0x8C8D\n#define GL_TRANSFORM_FEEDBACK_BUFFER_NV   0x8C8E\n#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F\n#define GL_LAYER_NV                       0x8DAA\n#define GL_NEXT_BUFFER_NV                 -2\n#define GL_SKIP_COMPONENTS4_NV            -3\n#define GL_SKIP_COMPONENTS3_NV            -4\n#define GL_SKIP_COMPONENTS2_NV            -5\n#define GL_SKIP_COMPONENTS1_NV            -6\n#endif\n\n#ifndef GL_EXT_bindable_uniform\n#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2\n#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3\n#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4\n#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT  0x8DED\n#define GL_UNIFORM_BUFFER_EXT             0x8DEE\n#define GL_UNIFORM_BUFFER_BINDING_EXT     0x8DEF\n#endif\n\n#ifndef GL_EXT_texture_integer\n#define GL_RGBA32UI_EXT                   0x8D70\n#define GL_RGB32UI_EXT                    0x8D71\n#define GL_ALPHA32UI_EXT                  0x8D72\n#define GL_INTENSITY32UI_EXT              0x8D73\n#define GL_LUMINANCE32UI_EXT              0x8D74\n#define GL_LUMINANCE_ALPHA32UI_EXT        0x8D75\n#define GL_RGBA16UI_EXT                   0x8D76\n#define GL_RGB16UI_EXT                    0x8D77\n#define GL_ALPHA16UI_EXT                  0x8D78\n#define GL_INTENSITY16UI_EXT              0x8D79\n#define GL_LUMINANCE16UI_EXT              0x8D7A\n#define GL_LUMINANCE_ALPHA16UI_EXT        0x8D7B\n#define GL_RGBA8UI_EXT                    0x8D7C\n#define GL_RGB8UI_EXT                     0x8D7D\n#define GL_ALPHA8UI_EXT                   0x8D7E\n#define GL_INTENSITY8UI_EXT               0x8D7F\n#define GL_LUMINANCE8UI_EXT               0x8D80\n#define GL_LUMINANCE_ALPHA8UI_EXT         0x8D81\n#define GL_RGBA32I_EXT                    0x8D82\n#define GL_RGB32I_EXT                     0x8D83\n#define GL_ALPHA32I_EXT                   0x8D84\n#define GL_INTENSITY32I_EXT               0x8D85\n#define GL_LUMINANCE32I_EXT               0x8D86\n#define GL_LUMINANCE_ALPHA32I_EXT         0x8D87\n#define GL_RGBA16I_EXT                    0x8D88\n#define GL_RGB16I_EXT                     0x8D89\n#define GL_ALPHA16I_EXT                   0x8D8A\n#define GL_INTENSITY16I_EXT               0x8D8B\n#define GL_LUMINANCE16I_EXT               0x8D8C\n#define GL_LUMINANCE_ALPHA16I_EXT         0x8D8D\n#define GL_RGBA8I_EXT                     0x8D8E\n#define GL_RGB8I_EXT                      0x8D8F\n#define GL_ALPHA8I_EXT                    0x8D90\n#define GL_INTENSITY8I_EXT                0x8D91\n#define GL_LUMINANCE8I_EXT                0x8D92\n#define GL_LUMINANCE_ALPHA8I_EXT          0x8D93\n#define GL_RED_INTEGER_EXT                0x8D94\n#define GL_GREEN_INTEGER_EXT              0x8D95\n#define GL_BLUE_INTEGER_EXT               0x8D96\n#define GL_ALPHA_INTEGER_EXT              0x8D97\n#define GL_RGB_INTEGER_EXT                0x8D98\n#define GL_RGBA_INTEGER_EXT               0x8D99\n#define GL_BGR_INTEGER_EXT                0x8D9A\n#define GL_BGRA_INTEGER_EXT               0x8D9B\n#define GL_LUMINANCE_INTEGER_EXT          0x8D9C\n#define GL_LUMINANCE_ALPHA_INTEGER_EXT    0x8D9D\n#define GL_RGBA_INTEGER_MODE_EXT          0x8D9E\n#endif\n\n#ifndef GL_GREMEDY_frame_terminator\n#endif\n\n#ifndef GL_NV_conditional_render\n#define GL_QUERY_WAIT_NV                  0x8E13\n#define GL_QUERY_NO_WAIT_NV               0x8E14\n#define GL_QUERY_BY_REGION_WAIT_NV        0x8E15\n#define GL_QUERY_BY_REGION_NO_WAIT_NV     0x8E16\n#endif\n\n#ifndef GL_NV_present_video\n#define GL_FRAME_NV                       0x8E26\n#define GL_FIELDS_NV                      0x8E27\n#define GL_CURRENT_TIME_NV                0x8E28\n#define GL_NUM_FILL_STREAMS_NV            0x8E29\n#define GL_PRESENT_TIME_NV                0x8E2A\n#define GL_PRESENT_DURATION_NV            0x8E2B\n#endif\n\n#ifndef GL_EXT_transform_feedback\n#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT  0x8C8E\n#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84\n#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85\n#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F\n#define GL_INTERLEAVED_ATTRIBS_EXT        0x8C8C\n#define GL_SEPARATE_ATTRIBS_EXT           0x8C8D\n#define GL_PRIMITIVES_GENERATED_EXT       0x8C87\n#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88\n#define GL_RASTERIZER_DISCARD_EXT         0x8C89\n#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80\n#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83\n#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F\n#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76\n#endif\n\n#ifndef GL_EXT_direct_state_access\n#define GL_PROGRAM_MATRIX_EXT             0x8E2D\n#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT   0x8E2E\n#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F\n#endif\n\n#ifndef GL_EXT_vertex_array_bgra\n/* reuse GL_BGRA */\n#endif\n\n#ifndef GL_EXT_texture_swizzle\n#define GL_TEXTURE_SWIZZLE_R_EXT          0x8E42\n#define GL_TEXTURE_SWIZZLE_G_EXT          0x8E43\n#define GL_TEXTURE_SWIZZLE_B_EXT          0x8E44\n#define GL_TEXTURE_SWIZZLE_A_EXT          0x8E45\n#define GL_TEXTURE_SWIZZLE_RGBA_EXT       0x8E46\n#endif\n\n#ifndef GL_NV_explicit_multisample\n#define GL_SAMPLE_POSITION_NV             0x8E50\n#define GL_SAMPLE_MASK_NV                 0x8E51\n#define GL_SAMPLE_MASK_VALUE_NV           0x8E52\n#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53\n#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54\n#define GL_TEXTURE_RENDERBUFFER_NV        0x8E55\n#define GL_SAMPLER_RENDERBUFFER_NV        0x8E56\n#define GL_INT_SAMPLER_RENDERBUFFER_NV    0x8E57\n#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58\n#define GL_MAX_SAMPLE_MASK_WORDS_NV       0x8E59\n#endif\n\n#ifndef GL_NV_transform_feedback2\n#define GL_TRANSFORM_FEEDBACK_NV          0x8E22\n#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23\n#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24\n#define GL_TRANSFORM_FEEDBACK_BINDING_NV  0x8E25\n#endif\n\n#ifndef GL_ATI_meminfo\n#define GL_VBO_FREE_MEMORY_ATI            0x87FB\n#define GL_TEXTURE_FREE_MEMORY_ATI        0x87FC\n#define GL_RENDERBUFFER_FREE_MEMORY_ATI   0x87FD\n#endif\n\n#ifndef GL_AMD_performance_monitor\n#define GL_COUNTER_TYPE_AMD               0x8BC0\n#define GL_COUNTER_RANGE_AMD              0x8BC1\n#define GL_UNSIGNED_INT64_AMD             0x8BC2\n#define GL_PERCENTAGE_AMD                 0x8BC3\n#define GL_PERFMON_RESULT_AVAILABLE_AMD   0x8BC4\n#define GL_PERFMON_RESULT_SIZE_AMD        0x8BC5\n#define GL_PERFMON_RESULT_AMD             0x8BC6\n#endif\n\n#ifndef GL_AMD_texture_texture4\n#endif\n\n#ifndef GL_AMD_vertex_shader_tesselator\n#define GL_SAMPLER_BUFFER_AMD             0x9001\n#define GL_INT_SAMPLER_BUFFER_AMD         0x9002\n#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003\n#define GL_TESSELLATION_MODE_AMD          0x9004\n#define GL_TESSELLATION_FACTOR_AMD        0x9005\n#define GL_DISCRETE_AMD                   0x9006\n#define GL_CONTINUOUS_AMD                 0x9007\n#endif\n\n#ifndef GL_EXT_provoking_vertex\n#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C\n#define GL_FIRST_VERTEX_CONVENTION_EXT    0x8E4D\n#define GL_LAST_VERTEX_CONVENTION_EXT     0x8E4E\n#define GL_PROVOKING_VERTEX_EXT           0x8E4F\n#endif\n\n#ifndef GL_EXT_texture_snorm\n#define GL_ALPHA_SNORM                    0x9010\n#define GL_LUMINANCE_SNORM                0x9011\n#define GL_LUMINANCE_ALPHA_SNORM          0x9012\n#define GL_INTENSITY_SNORM                0x9013\n#define GL_ALPHA8_SNORM                   0x9014\n#define GL_LUMINANCE8_SNORM               0x9015\n#define GL_LUMINANCE8_ALPHA8_SNORM        0x9016\n#define GL_INTENSITY8_SNORM               0x9017\n#define GL_ALPHA16_SNORM                  0x9018\n#define GL_LUMINANCE16_SNORM              0x9019\n#define GL_LUMINANCE16_ALPHA16_SNORM      0x901A\n#define GL_INTENSITY16_SNORM              0x901B\n/* reuse GL_RED_SNORM */\n/* reuse GL_RG_SNORM */\n/* reuse GL_RGB_SNORM */\n/* reuse GL_RGBA_SNORM */\n/* reuse GL_R8_SNORM */\n/* reuse GL_RG8_SNORM */\n/* reuse GL_RGB8_SNORM */\n/* reuse GL_RGBA8_SNORM */\n/* reuse GL_R16_SNORM */\n/* reuse GL_RG16_SNORM */\n/* reuse GL_RGB16_SNORM */\n/* reuse GL_RGBA16_SNORM */\n/* reuse GL_SIGNED_NORMALIZED */\n#endif\n\n#ifndef GL_AMD_draw_buffers_blend\n#endif\n\n#ifndef GL_APPLE_texture_range\n#define GL_TEXTURE_RANGE_LENGTH_APPLE     0x85B7\n#define GL_TEXTURE_RANGE_POINTER_APPLE    0x85B8\n#define GL_TEXTURE_STORAGE_HINT_APPLE     0x85BC\n#define GL_STORAGE_PRIVATE_APPLE          0x85BD\n/* reuse GL_STORAGE_CACHED_APPLE */\n/* reuse GL_STORAGE_SHARED_APPLE */\n#endif\n\n#ifndef GL_APPLE_float_pixels\n#define GL_HALF_APPLE                     0x140B\n#define GL_RGBA_FLOAT32_APPLE             0x8814\n#define GL_RGB_FLOAT32_APPLE              0x8815\n#define GL_ALPHA_FLOAT32_APPLE            0x8816\n#define GL_INTENSITY_FLOAT32_APPLE        0x8817\n#define GL_LUMINANCE_FLOAT32_APPLE        0x8818\n#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE  0x8819\n#define GL_RGBA_FLOAT16_APPLE             0x881A\n#define GL_RGB_FLOAT16_APPLE              0x881B\n#define GL_ALPHA_FLOAT16_APPLE            0x881C\n#define GL_INTENSITY_FLOAT16_APPLE        0x881D\n#define GL_LUMINANCE_FLOAT16_APPLE        0x881E\n#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE  0x881F\n#define GL_COLOR_FLOAT_APPLE              0x8A0F\n#endif\n\n#ifndef GL_APPLE_vertex_program_evaluators\n#define GL_VERTEX_ATTRIB_MAP1_APPLE       0x8A00\n#define GL_VERTEX_ATTRIB_MAP2_APPLE       0x8A01\n#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE  0x8A02\n#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03\n#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04\n#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05\n#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE  0x8A06\n#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07\n#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08\n#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09\n#endif\n\n#ifndef GL_APPLE_aux_depth_stencil\n#define GL_AUX_DEPTH_STENCIL_APPLE        0x8A14\n#endif\n\n#ifndef GL_APPLE_object_purgeable\n#define GL_BUFFER_OBJECT_APPLE            0x85B3\n#define GL_RELEASED_APPLE                 0x8A19\n#define GL_VOLATILE_APPLE                 0x8A1A\n#define GL_RETAINED_APPLE                 0x8A1B\n#define GL_UNDEFINED_APPLE                0x8A1C\n#define GL_PURGEABLE_APPLE                0x8A1D\n#endif\n\n#ifndef GL_APPLE_row_bytes\n#define GL_PACK_ROW_BYTES_APPLE           0x8A15\n#define GL_UNPACK_ROW_BYTES_APPLE         0x8A16\n#endif\n\n#ifndef GL_APPLE_rgb_422\n#define GL_RGB_422_APPLE                  0x8A1F\n/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */\n/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */\n#endif\n\n#ifndef GL_NV_video_capture\n#define GL_VIDEO_BUFFER_NV                0x9020\n#define GL_VIDEO_BUFFER_BINDING_NV        0x9021\n#define GL_FIELD_UPPER_NV                 0x9022\n#define GL_FIELD_LOWER_NV                 0x9023\n#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV   0x9024\n#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025\n#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026\n#define GL_LAST_VIDEO_CAPTURE_STATUS_NV   0x9027\n#define GL_VIDEO_BUFFER_PITCH_NV          0x9028\n#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029\n#define GL_VIDEO_COLOR_CONVERSION_MAX_NV  0x902A\n#define GL_VIDEO_COLOR_CONVERSION_MIN_NV  0x902B\n#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C\n#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D\n#define GL_PARTIAL_SUCCESS_NV             0x902E\n#define GL_SUCCESS_NV                     0x902F\n#define GL_FAILURE_NV                     0x9030\n#define GL_YCBYCR8_422_NV                 0x9031\n#define GL_YCBAYCR8A_4224_NV              0x9032\n#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV  0x9033\n#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034\n#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV  0x9035\n#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036\n#define GL_Z4Y12Z4CB12Z4CR12_444_NV       0x9037\n#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV   0x9038\n#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV  0x9039\n#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A\n#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B\n#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C\n#endif\n\n#ifndef GL_NV_copy_image\n#endif\n\n#ifndef GL_EXT_separate_shader_objects\n#define GL_ACTIVE_PROGRAM_EXT             0x8B8D\n#endif\n\n#ifndef GL_NV_parameter_buffer_object2\n#endif\n\n#ifndef GL_NV_shader_buffer_load\n#define GL_BUFFER_GPU_ADDRESS_NV          0x8F1D\n#define GL_GPU_ADDRESS_NV                 0x8F34\n#define GL_MAX_SHADER_BUFFER_ADDRESS_NV   0x8F35\n#endif\n\n#ifndef GL_NV_vertex_buffer_unified_memory\n#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E\n#define GL_ELEMENT_ARRAY_UNIFIED_NV       0x8F1F\n#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20\n#define GL_VERTEX_ARRAY_ADDRESS_NV        0x8F21\n#define GL_NORMAL_ARRAY_ADDRESS_NV        0x8F22\n#define GL_COLOR_ARRAY_ADDRESS_NV         0x8F23\n#define GL_INDEX_ARRAY_ADDRESS_NV         0x8F24\n#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25\n#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV     0x8F26\n#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27\n#define GL_FOG_COORD_ARRAY_ADDRESS_NV     0x8F28\n#define GL_ELEMENT_ARRAY_ADDRESS_NV       0x8F29\n#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV  0x8F2A\n#define GL_VERTEX_ARRAY_LENGTH_NV         0x8F2B\n#define GL_NORMAL_ARRAY_LENGTH_NV         0x8F2C\n#define GL_COLOR_ARRAY_LENGTH_NV          0x8F2D\n#define GL_INDEX_ARRAY_LENGTH_NV          0x8F2E\n#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV  0x8F2F\n#define GL_EDGE_FLAG_ARRAY_LENGTH_NV      0x8F30\n#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31\n#define GL_FOG_COORD_ARRAY_LENGTH_NV      0x8F32\n#define GL_ELEMENT_ARRAY_LENGTH_NV        0x8F33\n#define GL_DRAW_INDIRECT_UNIFIED_NV       0x8F40\n#define GL_DRAW_INDIRECT_ADDRESS_NV       0x8F41\n#define GL_DRAW_INDIRECT_LENGTH_NV        0x8F42\n#endif\n\n#ifndef GL_NV_texture_barrier\n#endif\n\n#ifndef GL_AMD_shader_stencil_export\n#endif\n\n#ifndef GL_AMD_seamless_cubemap_per_texture\n/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */\n#endif\n\n#ifndef GL_AMD_conservative_depth\n#endif\n\n#ifndef GL_EXT_shader_image_load_store\n#define GL_MAX_IMAGE_UNITS_EXT            0x8F38\n#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39\n#define GL_IMAGE_BINDING_NAME_EXT         0x8F3A\n#define GL_IMAGE_BINDING_LEVEL_EXT        0x8F3B\n#define GL_IMAGE_BINDING_LAYERED_EXT      0x8F3C\n#define GL_IMAGE_BINDING_LAYER_EXT        0x8F3D\n#define GL_IMAGE_BINDING_ACCESS_EXT       0x8F3E\n#define GL_IMAGE_1D_EXT                   0x904C\n#define GL_IMAGE_2D_EXT                   0x904D\n#define GL_IMAGE_3D_EXT                   0x904E\n#define GL_IMAGE_2D_RECT_EXT              0x904F\n#define GL_IMAGE_CUBE_EXT                 0x9050\n#define GL_IMAGE_BUFFER_EXT               0x9051\n#define GL_IMAGE_1D_ARRAY_EXT             0x9052\n#define GL_IMAGE_2D_ARRAY_EXT             0x9053\n#define GL_IMAGE_CUBE_MAP_ARRAY_EXT       0x9054\n#define GL_IMAGE_2D_MULTISAMPLE_EXT       0x9055\n#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056\n#define GL_INT_IMAGE_1D_EXT               0x9057\n#define GL_INT_IMAGE_2D_EXT               0x9058\n#define GL_INT_IMAGE_3D_EXT               0x9059\n#define GL_INT_IMAGE_2D_RECT_EXT          0x905A\n#define GL_INT_IMAGE_CUBE_EXT             0x905B\n#define GL_INT_IMAGE_BUFFER_EXT           0x905C\n#define GL_INT_IMAGE_1D_ARRAY_EXT         0x905D\n#define GL_INT_IMAGE_2D_ARRAY_EXT         0x905E\n#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT   0x905F\n#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT   0x9060\n#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061\n#define GL_UNSIGNED_INT_IMAGE_1D_EXT      0x9062\n#define GL_UNSIGNED_INT_IMAGE_2D_EXT      0x9063\n#define GL_UNSIGNED_INT_IMAGE_3D_EXT      0x9064\n#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065\n#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT    0x9066\n#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT  0x9067\n#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068\n#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069\n#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A\n#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B\n#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C\n#define GL_MAX_IMAGE_SAMPLES_EXT          0x906D\n#define GL_IMAGE_BINDING_FORMAT_EXT       0x906E\n#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001\n#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT  0x00000002\n#define GL_UNIFORM_BARRIER_BIT_EXT        0x00000004\n#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT  0x00000008\n#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020\n#define GL_COMMAND_BARRIER_BIT_EXT        0x00000040\n#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT   0x00000080\n#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100\n#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT  0x00000200\n#define GL_FRAMEBUFFER_BARRIER_BIT_EXT    0x00000400\n#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800\n#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000\n#define GL_ALL_BARRIER_BITS_EXT           0xFFFFFFFF\n#endif\n\n#ifndef GL_EXT_vertex_attrib_64bit\n/* reuse GL_DOUBLE */\n#define GL_DOUBLE_VEC2_EXT                0x8FFC\n#define GL_DOUBLE_VEC3_EXT                0x8FFD\n#define GL_DOUBLE_VEC4_EXT                0x8FFE\n#define GL_DOUBLE_MAT2_EXT                0x8F46\n#define GL_DOUBLE_MAT3_EXT                0x8F47\n#define GL_DOUBLE_MAT4_EXT                0x8F48\n#define GL_DOUBLE_MAT2x3_EXT              0x8F49\n#define GL_DOUBLE_MAT2x4_EXT              0x8F4A\n#define GL_DOUBLE_MAT3x2_EXT              0x8F4B\n#define GL_DOUBLE_MAT3x4_EXT              0x8F4C\n#define GL_DOUBLE_MAT4x2_EXT              0x8F4D\n#define GL_DOUBLE_MAT4x3_EXT              0x8F4E\n#endif\n\n#ifndef GL_NV_gpu_program5\n#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A\n#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B\n#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C\n#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D\n#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F\n#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44\n#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV  0x8F45\n#endif\n\n#ifndef GL_NV_gpu_shader5\n#define GL_INT64_NV                       0x140E\n#define GL_UNSIGNED_INT64_NV              0x140F\n#define GL_INT8_NV                        0x8FE0\n#define GL_INT8_VEC2_NV                   0x8FE1\n#define GL_INT8_VEC3_NV                   0x8FE2\n#define GL_INT8_VEC4_NV                   0x8FE3\n#define GL_INT16_NV                       0x8FE4\n#define GL_INT16_VEC2_NV                  0x8FE5\n#define GL_INT16_VEC3_NV                  0x8FE6\n#define GL_INT16_VEC4_NV                  0x8FE7\n#define GL_INT64_VEC2_NV                  0x8FE9\n#define GL_INT64_VEC3_NV                  0x8FEA\n#define GL_INT64_VEC4_NV                  0x8FEB\n#define GL_UNSIGNED_INT8_NV               0x8FEC\n#define GL_UNSIGNED_INT8_VEC2_NV          0x8FED\n#define GL_UNSIGNED_INT8_VEC3_NV          0x8FEE\n#define GL_UNSIGNED_INT8_VEC4_NV          0x8FEF\n#define GL_UNSIGNED_INT16_NV              0x8FF0\n#define GL_UNSIGNED_INT16_VEC2_NV         0x8FF1\n#define GL_UNSIGNED_INT16_VEC3_NV         0x8FF2\n#define GL_UNSIGNED_INT16_VEC4_NV         0x8FF3\n#define GL_UNSIGNED_INT64_VEC2_NV         0x8FF5\n#define GL_UNSIGNED_INT64_VEC3_NV         0x8FF6\n#define GL_UNSIGNED_INT64_VEC4_NV         0x8FF7\n#define GL_FLOAT16_NV                     0x8FF8\n#define GL_FLOAT16_VEC2_NV                0x8FF9\n#define GL_FLOAT16_VEC3_NV                0x8FFA\n#define GL_FLOAT16_VEC4_NV                0x8FFB\n/* reuse GL_PATCHES */\n#endif\n\n#ifndef GL_NV_shader_buffer_store\n#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010\n/* reuse GL_READ_WRITE */\n/* reuse GL_WRITE_ONLY */\n#endif\n\n#ifndef GL_NV_tessellation_program5\n#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV   0x86D8\n#define GL_TESS_CONTROL_PROGRAM_NV        0x891E\n#define GL_TESS_EVALUATION_PROGRAM_NV     0x891F\n#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74\n#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75\n#endif\n\n#ifndef GL_NV_vertex_attrib_integer_64bit\n/* reuse GL_INT64_NV */\n/* reuse GL_UNSIGNED_INT64_NV */\n#endif\n\n#ifndef GL_NV_multisample_coverage\n#define GL_COVERAGE_SAMPLES_NV            0x80A9\n#define GL_COLOR_SAMPLES_NV               0x8E20\n#endif\n\n#ifndef GL_AMD_name_gen_delete\n#define GL_DATA_BUFFER_AMD                0x9151\n#define GL_PERFORMANCE_MONITOR_AMD        0x9152\n#define GL_QUERY_OBJECT_AMD               0x9153\n#define GL_VERTEX_ARRAY_OBJECT_AMD        0x9154\n#define GL_SAMPLER_OBJECT_AMD             0x9155\n#endif\n\n#ifndef GL_AMD_debug_output\n#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD   0x9143\n#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD  0x9144\n#define GL_DEBUG_LOGGED_MESSAGES_AMD      0x9145\n#define GL_DEBUG_SEVERITY_HIGH_AMD        0x9146\n#define GL_DEBUG_SEVERITY_MEDIUM_AMD      0x9147\n#define GL_DEBUG_SEVERITY_LOW_AMD         0x9148\n#define GL_DEBUG_CATEGORY_API_ERROR_AMD   0x9149\n#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A\n#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B\n#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C\n#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D\n#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E\n#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F\n#define GL_DEBUG_CATEGORY_OTHER_AMD       0x9150\n#endif\n\n#ifndef GL_NV_vdpau_interop\n#define GL_SURFACE_STATE_NV               0x86EB\n#define GL_SURFACE_REGISTERED_NV          0x86FD\n#define GL_SURFACE_MAPPED_NV              0x8700\n#define GL_WRITE_DISCARD_NV               0x88BE\n#endif\n\n#ifndef GL_AMD_transform_feedback3_lines_triangles\n#endif\n\n#ifndef GL_AMD_depth_clamp_separate\n#define GL_DEPTH_CLAMP_NEAR_AMD           0x901E\n#define GL_DEPTH_CLAMP_FAR_AMD            0x901F\n#endif\n\n#ifndef GL_EXT_texture_sRGB_decode\n#define GL_TEXTURE_SRGB_DECODE_EXT        0x8A48\n#define GL_DECODE_EXT                     0x8A49\n#define GL_SKIP_DECODE_EXT                0x8A4A\n#endif\n\n#ifndef GL_NV_texture_multisample\n#define GL_TEXTURE_COVERAGE_SAMPLES_NV    0x9045\n#define GL_TEXTURE_COLOR_SAMPLES_NV       0x9046\n#endif\n\n#ifndef GL_AMD_blend_minmax_factor\n#define GL_FACTOR_MIN_AMD                 0x901C\n#define GL_FACTOR_MAX_AMD                 0x901D\n#endif\n\n#ifndef GL_AMD_sample_positions\n#define GL_SUBSAMPLE_DISTANCE_AMD         0x883F\n#endif\n\n#ifndef GL_EXT_x11_sync_object\n#define GL_SYNC_X11_FENCE_EXT             0x90E1\n#endif\n\n#ifndef GL_AMD_multi_draw_indirect\n#endif\n\n#ifndef GL_EXT_framebuffer_multisample_blit_scaled\n#define GL_SCALED_RESOLVE_FASTEST_EXT     0x90BA\n#define GL_SCALED_RESOLVE_NICEST_EXT      0x90BB\n#endif\n\n#ifndef GL_NV_path_rendering\n#define GL_PATH_FORMAT_SVG_NV             0x9070\n#define GL_PATH_FORMAT_PS_NV              0x9071\n#define GL_STANDARD_FONT_NAME_NV          0x9072\n#define GL_SYSTEM_FONT_NAME_NV            0x9073\n#define GL_FILE_NAME_NV                   0x9074\n#define GL_PATH_STROKE_WIDTH_NV           0x9075\n#define GL_PATH_END_CAPS_NV               0x9076\n#define GL_PATH_INITIAL_END_CAP_NV        0x9077\n#define GL_PATH_TERMINAL_END_CAP_NV       0x9078\n#define GL_PATH_JOIN_STYLE_NV             0x9079\n#define GL_PATH_MITER_LIMIT_NV            0x907A\n#define GL_PATH_DASH_CAPS_NV              0x907B\n#define GL_PATH_INITIAL_DASH_CAP_NV       0x907C\n#define GL_PATH_TERMINAL_DASH_CAP_NV      0x907D\n#define GL_PATH_DASH_OFFSET_NV            0x907E\n#define GL_PATH_CLIENT_LENGTH_NV          0x907F\n#define GL_PATH_FILL_MODE_NV              0x9080\n#define GL_PATH_FILL_MASK_NV              0x9081\n#define GL_PATH_FILL_COVER_MODE_NV        0x9082\n#define GL_PATH_STROKE_COVER_MODE_NV      0x9083\n#define GL_PATH_STROKE_MASK_NV            0x9084\n#define GL_PATH_SAMPLE_QUALITY_NV         0x9085\n#define GL_PATH_STROKE_BOUND_NV           0x9086\n#define GL_PATH_STROKE_OVERSAMPLE_COUNT_NV 0x9087\n#define GL_COUNT_UP_NV                    0x9088\n#define GL_COUNT_DOWN_NV                  0x9089\n#define GL_PATH_OBJECT_BOUNDING_BOX_NV    0x908A\n#define GL_CONVEX_HULL_NV                 0x908B\n#define GL_MULTI_HULLS_NV                 0x908C\n#define GL_BOUNDING_BOX_NV                0x908D\n#define GL_TRANSLATE_X_NV                 0x908E\n#define GL_TRANSLATE_Y_NV                 0x908F\n#define GL_TRANSLATE_2D_NV                0x9090\n#define GL_TRANSLATE_3D_NV                0x9091\n#define GL_AFFINE_2D_NV                   0x9092\n#define GL_PROJECTIVE_2D_NV               0x9093\n#define GL_AFFINE_3D_NV                   0x9094\n#define GL_PROJECTIVE_3D_NV               0x9095\n#define GL_TRANSPOSE_AFFINE_2D_NV         0x9096\n#define GL_TRANSPOSE_PROJECTIVE_2D_NV     0x9097\n#define GL_TRANSPOSE_AFFINE_3D_NV         0x9098\n#define GL_TRANSPOSE_PROJECTIVE_3D_NV     0x9099\n#define GL_UTF8_NV                        0x909A\n#define GL_UTF16_NV                       0x909B\n#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C\n#define GL_PATH_COMMAND_COUNT_NV          0x909D\n#define GL_PATH_COORD_COUNT_NV            0x909E\n#define GL_PATH_DASH_ARRAY_COUNT_NV       0x909F\n#define GL_PATH_COMPUTED_LENGTH_NV        0x90A0\n#define GL_PATH_FILL_BOUNDING_BOX_NV      0x90A1\n#define GL_PATH_STROKE_BOUNDING_BOX_NV    0x90A2\n#define GL_SQUARE_NV                      0x90A3\n#define GL_ROUND_NV                       0x90A4\n#define GL_TRIANGULAR_NV                  0x90A5\n#define GL_BEVEL_NV                       0x90A6\n#define GL_MITER_REVERT_NV                0x90A7\n#define GL_MITER_TRUNCATE_NV              0x90A8\n#define GL_SKIP_MISSING_GLYPH_NV          0x90A9\n#define GL_USE_MISSING_GLYPH_NV           0x90AA\n#define GL_PATH_ERROR_POSITION_NV         0x90AB\n#define GL_PATH_FOG_GEN_MODE_NV           0x90AC\n#define GL_ACCUM_ADJACENT_PAIRS_NV        0x90AD\n#define GL_ADJACENT_PAIRS_NV              0x90AE\n#define GL_FIRST_TO_REST_NV               0x90AF\n#define GL_PATH_GEN_MODE_NV               0x90B0\n#define GL_PATH_GEN_COEFF_NV              0x90B1\n#define GL_PATH_GEN_COLOR_FORMAT_NV       0x90B2\n#define GL_PATH_GEN_COMPONENTS_NV         0x90B3\n#define GL_PATH_STENCIL_FUNC_NV           0x90B7\n#define GL_PATH_STENCIL_REF_NV            0x90B8\n#define GL_PATH_STENCIL_VALUE_MASK_NV     0x90B9\n#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD\n#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE\n#define GL_PATH_COVER_DEPTH_FUNC_NV       0x90BF\n#define GL_PATH_DASH_OFFSET_RESET_NV      0x90B4\n#define GL_MOVE_TO_RESETS_NV              0x90B5\n#define GL_MOVE_TO_CONTINUES_NV           0x90B6\n#define GL_CLOSE_PATH_NV                  0x00\n#define GL_MOVE_TO_NV                     0x02\n#define GL_RELATIVE_MOVE_TO_NV            0x03\n#define GL_LINE_TO_NV                     0x04\n#define GL_RELATIVE_LINE_TO_NV            0x05\n#define GL_HORIZONTAL_LINE_TO_NV          0x06\n#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07\n#define GL_VERTICAL_LINE_TO_NV            0x08\n#define GL_RELATIVE_VERTICAL_LINE_TO_NV   0x09\n#define GL_QUADRATIC_CURVE_TO_NV          0x0A\n#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B\n#define GL_CUBIC_CURVE_TO_NV              0x0C\n#define GL_RELATIVE_CUBIC_CURVE_TO_NV     0x0D\n#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV   0x0E\n#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F\n#define GL_SMOOTH_CUBIC_CURVE_TO_NV       0x10\n#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11\n#define GL_SMALL_CCW_ARC_TO_NV            0x12\n#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV   0x13\n#define GL_SMALL_CW_ARC_TO_NV             0x14\n#define GL_RELATIVE_SMALL_CW_ARC_TO_NV    0x15\n#define GL_LARGE_CCW_ARC_TO_NV            0x16\n#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV   0x17\n#define GL_LARGE_CW_ARC_TO_NV             0x18\n#define GL_RELATIVE_LARGE_CW_ARC_TO_NV    0x19\n#define GL_RESTART_PATH_NV                0xF0\n#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV    0xF2\n#define GL_DUP_LAST_CUBIC_CURVE_TO_NV     0xF4\n#define GL_RECT_NV                        0xF6\n#define GL_CIRCULAR_CCW_ARC_TO_NV         0xF8\n#define GL_CIRCULAR_CW_ARC_TO_NV          0xFA\n#define GL_CIRCULAR_TANGENT_ARC_TO_NV     0xFC\n#define GL_ARC_TO_NV                      0xFE\n#define GL_RELATIVE_ARC_TO_NV             0xFF\n#define GL_BOLD_BIT_NV                    0x01\n#define GL_ITALIC_BIT_NV                  0x02\n#define GL_GLYPH_WIDTH_BIT_NV             0x01\n#define GL_GLYPH_HEIGHT_BIT_NV            0x02\n#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04\n#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08\n#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10\n#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20\n#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40\n#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80\n#define GL_GLYPH_HAS_KERNING_NV           0x100\n#define GL_FONT_X_MIN_BOUNDS_NV           0x00010000\n#define GL_FONT_Y_MIN_BOUNDS_NV           0x00020000\n#define GL_FONT_X_MAX_BOUNDS_NV           0x00040000\n#define GL_FONT_Y_MAX_BOUNDS_NV           0x00080000\n#define GL_FONT_UNITS_PER_EM_NV           0x00100000\n#define GL_FONT_ASCENDER_NV               0x00200000\n#define GL_FONT_DESCENDER_NV              0x00400000\n#define GL_FONT_HEIGHT_NV                 0x00800000\n#define GL_FONT_MAX_ADVANCE_WIDTH_NV      0x01000000\n#define GL_FONT_MAX_ADVANCE_HEIGHT_NV     0x02000000\n#define GL_FONT_UNDERLINE_POSITION_NV     0x04000000\n#define GL_FONT_UNDERLINE_THICKNESS_NV    0x08000000\n#define GL_FONT_HAS_KERNING_NV            0x10000000\n#endif\n\n#ifndef GL_AMD_pinned_memory\n#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160\n#endif\n\n#ifndef GL_AMD_stencil_operation_extended\n#define GL_SET_AMD                        0x874A\n#define GL_REPLACE_VALUE_AMD              0x874B\n#define GL_STENCIL_OP_VALUE_AMD           0x874C\n#define GL_STENCIL_BACK_OP_VALUE_AMD      0x874D\n#endif\n\n#ifndef GL_AMD_vertex_shader_viewport_index\n#endif\n\n#ifndef GL_AMD_vertex_shader_layer\n#endif\n\n#ifndef GL_NV_bindless_texture\n#endif\n\n#ifndef GL_NV_shader_atomic_float\n#endif\n\n#ifndef GL_AMD_query_buffer_object\n#define GL_QUERY_BUFFER_AMD               0x9192\n#define GL_QUERY_BUFFER_BINDING_AMD       0x9193\n#define GL_QUERY_RESULT_NO_WAIT_AMD       0x9194\n#endif\n\n#ifndef GL_AMD_sparse_texture\n#define GL_VIRTUAL_PAGE_SIZE_X_AMD        0x9195\n#define GL_VIRTUAL_PAGE_SIZE_Y_AMD        0x9196\n#define GL_VIRTUAL_PAGE_SIZE_Z_AMD        0x9197\n#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD    0x9198\n#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199\n#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A\n#define GL_MIN_SPARSE_LEVEL_AMD           0x919B\n#define GL_MIN_LOD_WARNING_AMD            0x919C\n#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001\n#endif\n\n\n/*************************************************************/\n\n#include <stddef.h>\n#ifndef GL_VERSION_2_0\n/* GL type for program/shader text */\ntypedef char GLchar;\n#endif\n\n#ifndef GL_VERSION_1_5\n/* GL types for handling large vertex buffer objects */\ntypedef ptrdiff_t GLintptr;\ntypedef ptrdiff_t GLsizeiptr;\n#endif\n\n#ifndef GL_ARB_vertex_buffer_object\n/* GL types for handling large vertex buffer objects */\ntypedef ptrdiff_t GLintptrARB;\ntypedef ptrdiff_t GLsizeiptrARB;\n#endif\n\n#ifndef GL_ARB_shader_objects\n/* GL types for program/shader text and shader object handles */\ntypedef char GLcharARB;\ntypedef void * GLhandleARB;\n#endif\n\n/* GL type for \"half\" precision (s10e5) float data in host memory */\n#ifndef GL_ARB_half_float_pixel\ntypedef unsigned short GLhalfARB;\n#endif\n\n#ifndef GL_NV_half_float\ntypedef unsigned short GLhalfNV;\n#endif\n\n#ifndef GLEXT_64_TYPES_DEFINED\n/* This code block is duplicated in glxext.h, so must be protected */\n#define GLEXT_64_TYPES_DEFINED\n/* Define int32_t, int64_t, and uint64_t types for UST/MSC */\n/* (as used in the GL_EXT_timer_query extension). */\n#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n#include <inttypes.h>\n#elif defined(__sun__) || defined(__digital__)\n#include <inttypes.h>\n#if defined(__STDC__)\n#if defined(__arch64__) || defined(_LP64)\ntypedef long int int64_t;\ntypedef unsigned long int uint64_t;\n#else\ntypedef long long int int64_t;\ntypedef unsigned long long int uint64_t;\n#endif /* __arch64__ */\n#endif /* __STDC__ */\n#elif defined( __VMS ) || defined(__sgi)\n#include <inttypes.h>\n#elif defined(__SCO__) || defined(__USLC__)\n#include <stdint.h>\n#elif defined(__UNIXOS2__) || defined(__SOL64__)\ntypedef long int int32_t;\ntypedef long long int int64_t;\ntypedef unsigned long long int uint64_t;\n#elif defined(_WIN32) && defined(__GNUC__)\n#include <stdint.h>\n#elif defined(_WIN32)\ntypedef __int32 int32_t;\ntypedef __int64 int64_t;\ntypedef unsigned __int64 uint64_t;\n#else\n/* Fallback if nothing above works */\n#include <inttypes.h>\n#endif\n#endif\n\n#ifndef GL_EXT_timer_query\ntypedef int64_t GLint64EXT;\ntypedef uint64_t GLuint64EXT;\n#endif\n\n#ifndef GL_ARB_sync\ntypedef int64_t GLint64;\ntypedef uint64_t GLuint64;\ntypedef struct __GLsync *GLsync;\n#endif\n\n#ifndef GL_ARB_cl_event\n/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */\nstruct _cl_context;\nstruct _cl_event;\n#endif\n\n#ifndef GL_ARB_debug_output\ntypedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);\n#endif\n\n#ifndef GL_AMD_debug_output\ntypedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);\n#endif\n\n#ifndef GL_KHR_debug\ntypedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);\n#endif\n\n#ifndef GL_NV_vdpau_interop\ntypedef GLintptr GLvdpauSurfaceNV;\n#endif\n\n#ifndef GL_VERSION_1_2\n#define GL_VERSION_1_2 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);\nGLAPI void APIENTRY glBlendEquation (GLenum mode);\nGLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);\nGLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);\nGLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\nGLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table);\nGLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);\nGLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);\nGLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);\nGLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);\nGLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);\nGLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params);\nGLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\nGLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image);\nGLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);\nGLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);\nGLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\nGLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\nGLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);\nGLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink);\nGLAPI void APIENTRY glResetHistogram (GLenum target);\nGLAPI void APIENTRY glResetMinmax (GLenum target);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);\ntypedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);\ntypedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);\ntypedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\ntypedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);\ntypedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);\ntypedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);\ntypedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\ntypedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\ntypedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);\ntypedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);\ntypedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);\n#endif\n\n#ifndef GL_VERSION_1_3\n#define GL_VERSION_1_3 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glActiveTexture (GLenum texture);\nGLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);\nGLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img);\nGLAPI void APIENTRY glClientActiveTexture (GLenum texture);\nGLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s);\nGLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v);\nGLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s);\nGLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v);\nGLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s);\nGLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v);\nGLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s);\nGLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v);\nGLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);\nGLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v);\nGLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);\nGLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v);\nGLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t);\nGLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v);\nGLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);\nGLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v);\nGLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);\nGLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v);\nGLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);\nGLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v);\nGLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);\nGLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v);\nGLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);\nGLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v);\nGLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);\nGLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v);\nGLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);\nGLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v);\nGLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);\nGLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v);\nGLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);\nGLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v);\nGLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m);\nGLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m);\nGLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m);\nGLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);\ntypedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);\ntypedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);\ntypedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);\ntypedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);\ntypedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);\ntypedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);\n#endif\n\n#ifndef GL_VERSION_1_4\n#define GL_VERSION_1_4 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\nGLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);\nGLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount);\nGLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);\nGLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);\nGLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);\nGLAPI void APIENTRY glFogCoordf (GLfloat coord);\nGLAPI void APIENTRY glFogCoordfv (const GLfloat *coord);\nGLAPI void APIENTRY glFogCoordd (GLdouble coord);\nGLAPI void APIENTRY glFogCoorddv (const GLdouble *coord);\nGLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);\nGLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v);\nGLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);\nGLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v);\nGLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);\nGLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v);\nGLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue);\nGLAPI void APIENTRY glSecondaryColor3iv (const GLint *v);\nGLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);\nGLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v);\nGLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);\nGLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v);\nGLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);\nGLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v);\nGLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);\nGLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v);\nGLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y);\nGLAPI void APIENTRY glWindowPos2dv (const GLdouble *v);\nGLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y);\nGLAPI void APIENTRY glWindowPos2fv (const GLfloat *v);\nGLAPI void APIENTRY glWindowPos2i (GLint x, GLint y);\nGLAPI void APIENTRY glWindowPos2iv (const GLint *v);\nGLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y);\nGLAPI void APIENTRY glWindowPos2sv (const GLshort *v);\nGLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glWindowPos3dv (const GLdouble *v);\nGLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glWindowPos3fv (const GLfloat *v);\nGLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z);\nGLAPI void APIENTRY glWindowPos3iv (const GLint *v);\nGLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z);\nGLAPI void APIENTRY glWindowPos3sv (const GLshort *v);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\ntypedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);\ntypedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount);\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);\ntypedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);\ntypedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);\ntypedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);\ntypedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);\n#endif\n\n#ifndef GL_VERSION_1_5\n#define GL_VERSION_1_5 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);\nGLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);\nGLAPI GLboolean APIENTRY glIsQuery (GLuint id);\nGLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);\nGLAPI void APIENTRY glEndQuery (GLenum target);\nGLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);\nGLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);\nGLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);\nGLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);\nGLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);\nGLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);\nGLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);\nGLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);\nGLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access);\nGLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);\nGLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);\ntypedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);\ntypedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);\ntypedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);\ntypedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);\ntypedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);\ntypedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);\ntypedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);\ntypedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);\ntypedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);\ntypedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);\ntypedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);\n#endif\n\n#ifndef GL_VERSION_2_0\n#define GL_VERSION_2_0 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);\nGLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);\nGLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);\nGLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);\nGLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);\nGLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);\nGLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);\nGLAPI void APIENTRY glCompileShader (GLuint shader);\nGLAPI GLuint APIENTRY glCreateProgram (void);\nGLAPI GLuint APIENTRY glCreateShader (GLenum type);\nGLAPI void APIENTRY glDeleteProgram (GLuint program);\nGLAPI void APIENTRY glDeleteShader (GLuint shader);\nGLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);\nGLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);\nGLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);\nGLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);\nGLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);\nGLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);\nGLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);\nGLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);\nGLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);\nGLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);\nGLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);\nGLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);\nGLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);\nGLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);\nGLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer);\nGLAPI GLboolean APIENTRY glIsProgram (GLuint program);\nGLAPI GLboolean APIENTRY glIsShader (GLuint shader);\nGLAPI void APIENTRY glLinkProgram (GLuint program);\nGLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length);\nGLAPI void APIENTRY glUseProgram (GLuint program);\nGLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);\nGLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);\nGLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\nGLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\nGLAPI void APIENTRY glUniform1i (GLint location, GLint v0);\nGLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);\nGLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);\nGLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\nGLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glValidateProgram (GLuint program);\nGLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);\nGLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);\nGLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);\nGLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);\nGLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);\nGLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);\nGLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);\nGLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);\nGLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\nGLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);\nGLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);\nGLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);\nGLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\nGLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);\nGLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);\nGLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);\ntypedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);\ntypedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);\ntypedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);\ntypedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);\ntypedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);\ntypedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);\ntypedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);\ntypedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);\ntypedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);\ntypedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);\ntypedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);\ntypedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);\ntypedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);\ntypedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);\ntypedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);\ntypedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);\ntypedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);\ntypedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);\ntypedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);\ntypedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);\ntypedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);\ntypedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);\ntypedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);\ntypedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);\ntypedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);\ntypedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);\ntypedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length);\ntypedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);\ntypedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);\ntypedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);\ntypedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\ntypedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\ntypedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);\ntypedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);\ntypedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);\ntypedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\ntypedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);\n#endif\n\n#ifndef GL_VERSION_2_1\n#define GL_VERSION_2_1 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\n#endif\n\n#ifndef GL_VERSION_3_0\n#define GL_VERSION_3_0 1\n/* OpenGL 3.0 also reuses entry points from these extensions: */\n/* ARB_framebuffer_object */\n/* ARB_map_buffer_range */\n/* ARB_vertex_array_object */\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);\nGLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);\nGLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);\nGLAPI void APIENTRY glEnablei (GLenum target, GLuint index);\nGLAPI void APIENTRY glDisablei (GLenum target, GLuint index);\nGLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);\nGLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);\nGLAPI void APIENTRY glEndTransformFeedback (void);\nGLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\nGLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);\nGLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode);\nGLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);\nGLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);\nGLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);\nGLAPI void APIENTRY glEndConditionalRender (void);\nGLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);\nGLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);\nGLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);\nGLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);\nGLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);\nGLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);\nGLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);\nGLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);\nGLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\nGLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);\nGLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);\nGLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);\nGLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);\nGLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);\nGLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);\nGLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);\nGLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);\nGLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);\nGLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\nGLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);\nGLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);\nGLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);\nGLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);\nGLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);\nGLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);\nGLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);\ntypedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);\ntypedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);\ntypedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);\ntypedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);\ntypedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);\ntypedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);\ntypedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);\ntypedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\ntypedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);\ntypedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode);\ntypedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);\ntypedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);\ntypedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);\ntypedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);\ntypedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);\ntypedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);\ntypedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);\ntypedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);\ntypedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);\ntypedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);\ntypedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\ntypedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);\ntypedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);\ntypedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);\ntypedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);\ntypedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);\ntypedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);\n#endif\n\n#ifndef GL_VERSION_3_1\n#define GL_VERSION_3_1 1\n/* OpenGL 3.1 also reuses entry points from these extensions: */\n/* ARB_copy_buffer */\n/* ARB_uniform_buffer_object */\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);\nGLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount);\nGLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);\nGLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount);\ntypedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);\ntypedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);\n#endif\n\n#ifndef GL_VERSION_3_2\n#define GL_VERSION_3_2 1\n/* OpenGL 3.2 also reuses entry points from these extensions: */\n/* ARB_draw_elements_base_vertex */\n/* ARB_provoking_vertex */\n/* ARB_sync */\n/* ARB_texture_multisample */\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);\nGLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);\nGLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);\ntypedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);\n#endif\n\n#ifndef GL_VERSION_3_3\n#define GL_VERSION_3_3 1\n/* OpenGL 3.3 also reuses entry points from these extensions: */\n/* ARB_blend_func_extended */\n/* ARB_sampler_objects */\n/* ARB_explicit_attrib_location, but it has none */\n/* ARB_occlusion_query2 (no entry points) */\n/* ARB_shader_bit_encoding (no entry points) */\n/* ARB_texture_rgb10_a2ui (no entry points) */\n/* ARB_texture_swizzle (no entry points) */\n/* ARB_timer_query */\n/* ARB_vertex_type_2_10_10_10_rev */\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);\n#endif\n\n#ifndef GL_VERSION_4_0\n#define GL_VERSION_4_0 1\n/* OpenGL 4.0 also reuses entry points from these extensions: */\n/* ARB_texture_query_lod (no entry points) */\n/* ARB_draw_indirect */\n/* ARB_gpu_shader5 (no entry points) */\n/* ARB_gpu_shader_fp64 */\n/* ARB_shader_subroutine */\n/* ARB_tessellation_shader */\n/* ARB_texture_buffer_object_rgb32 (no entry points) */\n/* ARB_texture_cube_map_array (no entry points) */\n/* ARB_texture_gather (no entry points) */\n/* ARB_transform_feedback2 */\n/* ARB_transform_feedback3 */\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glMinSampleShading (GLfloat value);\nGLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);\nGLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\nGLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);\nGLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value);\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\ntypedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);\ntypedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\n#endif\n\n#ifndef GL_VERSION_4_1\n#define GL_VERSION_4_1 1\n/* OpenGL 4.1 reuses entry points from these extensions: */\n/* ARB_ES2_compatibility */\n/* ARB_get_program_binary */\n/* ARB_separate_shader_objects */\n/* ARB_shader_precision (no entry points) */\n/* ARB_vertex_attrib_64bit */\n/* ARB_viewport_array */\n#endif\n\n#ifndef GL_VERSION_4_2\n#define GL_VERSION_4_2 1\n/* OpenGL 4.2 reuses entry points from these extensions: */\n/* ARB_base_instance */\n/* ARB_shading_language_420pack (no entry points) */\n/* ARB_transform_feedback_instanced */\n/* ARB_compressed_texture_pixel_storage (no entry points) */\n/* ARB_conservative_depth (no entry points) */\n/* ARB_internalformat_query */\n/* ARB_map_buffer_alignment (no entry points) */\n/* ARB_shader_atomic_counters */\n/* ARB_shader_image_load_store */\n/* ARB_shading_language_packing (no entry points) */\n/* ARB_texture_storage */\n#endif\n\n#ifndef GL_VERSION_4_3\n#define GL_VERSION_4_3 1\n/* OpenGL 4.3 reuses entry points from these extensions: */\n/* ARB_arrays_of_arrays (no entry points, GLSL only) */\n/* ARB_fragment_layer_viewport (no entry points, GLSL only) */\n/* ARB_shader_image_size (no entry points, GLSL only) */\n/* ARB_ES3_compatibility (no entry points) */\n/* ARB_clear_buffer_object */\n/* ARB_compute_shader */\n/* ARB_copy_image */\n/* KHR_debug (includes ARB_debug_output commands promoted to KHR without suffixes) */\n/* ARB_explicit_uniform_location (no entry points) */\n/* ARB_framebuffer_no_attachments */\n/* ARB_internalformat_query2 */\n/* ARB_invalidate_subdata */\n/* ARB_multi_draw_indirect */\n/* ARB_program_interface_query */\n/* ARB_robust_buffer_access_behavior (no entry points) */\n/* ARB_shader_storage_buffer_object */\n/* ARB_stencil_texturing (no entry points) */\n/* ARB_texture_buffer_range */\n/* ARB_texture_query_levels (no entry points) */\n/* ARB_texture_storage_multisample */\n/* ARB_texture_view */\n/* ARB_vertex_attrib_binding */\n#endif\n\n#ifndef GL_ARB_multitexture\n#define GL_ARB_multitexture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glActiveTextureARB (GLenum texture);\nGLAPI void APIENTRY glClientActiveTextureARB (GLenum texture);\nGLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s);\nGLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);\nGLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s);\nGLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);\nGLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s);\nGLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v);\nGLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s);\nGLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v);\nGLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);\nGLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);\nGLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);\nGLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);\nGLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);\nGLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v);\nGLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);\nGLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v);\nGLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);\nGLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);\nGLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);\nGLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);\nGLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);\nGLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v);\nGLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);\nGLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v);\nGLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);\nGLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);\nGLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);\nGLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);\nGLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);\nGLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v);\nGLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);\nGLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);\ntypedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);\n#endif\n\n#ifndef GL_ARB_transpose_matrix\n#define GL_ARB_transpose_matrix 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m);\nGLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m);\nGLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m);\nGLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);\ntypedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);\ntypedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);\ntypedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);\n#endif\n\n#ifndef GL_ARB_multisample\n#define GL_ARB_multisample 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert);\n#endif\n\n#ifndef GL_ARB_texture_env_add\n#define GL_ARB_texture_env_add 1\n#endif\n\n#ifndef GL_ARB_texture_cube_map\n#define GL_ARB_texture_cube_map 1\n#endif\n\n#ifndef GL_ARB_texture_compression\n#define GL_ARB_texture_compression 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);\nGLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);\n#endif\n\n#ifndef GL_ARB_texture_border_clamp\n#define GL_ARB_texture_border_clamp 1\n#endif\n\n#ifndef GL_ARB_point_parameters\n#define GL_ARB_point_parameters 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param);\nGLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);\n#endif\n\n#ifndef GL_ARB_vertex_blend\n#define GL_ARB_vertex_blend 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights);\nGLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights);\nGLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights);\nGLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights);\nGLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights);\nGLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights);\nGLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights);\nGLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights);\nGLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glVertexBlendARB (GLint count);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);\ntypedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);\ntypedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);\ntypedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);\ntypedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);\ntypedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);\ntypedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);\ntypedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);\ntypedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);\n#endif\n\n#ifndef GL_ARB_matrix_palette\n#define GL_ARB_matrix_palette 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index);\nGLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices);\nGLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices);\nGLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices);\nGLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);\ntypedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);\ntypedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);\ntypedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);\ntypedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif\n\n#ifndef GL_ARB_texture_env_combine\n#define GL_ARB_texture_env_combine 1\n#endif\n\n#ifndef GL_ARB_texture_env_crossbar\n#define GL_ARB_texture_env_crossbar 1\n#endif\n\n#ifndef GL_ARB_texture_env_dot3\n#define GL_ARB_texture_env_dot3 1\n#endif\n\n#ifndef GL_ARB_texture_mirrored_repeat\n#define GL_ARB_texture_mirrored_repeat 1\n#endif\n\n#ifndef GL_ARB_depth_texture\n#define GL_ARB_depth_texture 1\n#endif\n\n#ifndef GL_ARB_shadow\n#define GL_ARB_shadow 1\n#endif\n\n#ifndef GL_ARB_shadow_ambient\n#define GL_ARB_shadow_ambient 1\n#endif\n\n#ifndef GL_ARB_window_pos\n#define GL_ARB_window_pos 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y);\nGLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v);\nGLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y);\nGLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v);\nGLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y);\nGLAPI void APIENTRY glWindowPos2ivARB (const GLint *v);\nGLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y);\nGLAPI void APIENTRY glWindowPos2svARB (const GLshort *v);\nGLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v);\nGLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v);\nGLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z);\nGLAPI void APIENTRY glWindowPos3ivARB (const GLint *v);\nGLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z);\nGLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);\n#endif\n\n#ifndef GL_ARB_vertex_program\n#define GL_ARB_vertex_program 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x);\nGLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x);\nGLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x);\nGLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);\nGLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);\nGLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);\nGLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);\nGLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);\nGLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\nGLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);\nGLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v);\nGLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v);\nGLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\nGLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);\nGLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v);\nGLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index);\nGLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index);\nGLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string);\nGLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program);\nGLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs);\nGLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs);\nGLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);\nGLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);\nGLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);\nGLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);\nGLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);\nGLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);\nGLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);\nGLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);\nGLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string);\nGLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);\nGLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer);\nGLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);\ntypedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);\ntypedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);\ntypedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);\ntypedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);\ntypedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);\ntypedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);\n#endif\n\n#ifndef GL_ARB_fragment_program\n#define GL_ARB_fragment_program 1\n/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */\n#endif\n\n#ifndef GL_ARB_vertex_buffer_object\n#define GL_ARB_vertex_buffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer);\nGLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers);\nGLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers);\nGLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer);\nGLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);\nGLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);\nGLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);\nGLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access);\nGLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target);\nGLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);\ntypedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);\ntypedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);\ntypedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);\ntypedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);\ntypedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);\ntypedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);\ntypedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);\n#endif\n\n#ifndef GL_ARB_occlusion_query\n#define GL_ARB_occlusion_query 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids);\nGLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids);\nGLAPI GLboolean APIENTRY glIsQueryARB (GLuint id);\nGLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id);\nGLAPI void APIENTRY glEndQueryARB (GLenum target);\nGLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);\ntypedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);\ntypedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);\ntypedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);\n#endif\n\n#ifndef GL_ARB_shader_objects\n#define GL_ARB_shader_objects 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj);\nGLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname);\nGLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);\nGLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType);\nGLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);\nGLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj);\nGLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);\nGLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);\nGLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj);\nGLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj);\nGLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj);\nGLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0);\nGLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);\nGLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\nGLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\nGLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0);\nGLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1);\nGLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);\nGLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\nGLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);\nGLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);\nGLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);\nGLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);\nGLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);\nGLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);\nGLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);\ntypedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);\ntypedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);\ntypedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);\ntypedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);\ntypedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);\ntypedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);\ntypedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);\ntypedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);\ntypedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);\ntypedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);\ntypedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);\ntypedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);\ntypedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\ntypedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\ntypedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);\ntypedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);\ntypedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);\ntypedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\ntypedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);\ntypedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);\ntypedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);\ntypedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);\ntypedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);\ntypedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);\n#endif\n\n#ifndef GL_ARB_vertex_shader\n#define GL_ARB_vertex_shader 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);\nGLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);\nGLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);\ntypedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);\ntypedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);\n#endif\n\n#ifndef GL_ARB_fragment_shader\n#define GL_ARB_fragment_shader 1\n#endif\n\n#ifndef GL_ARB_shading_language_100\n#define GL_ARB_shading_language_100 1\n#endif\n\n#ifndef GL_ARB_texture_non_power_of_two\n#define GL_ARB_texture_non_power_of_two 1\n#endif\n\n#ifndef GL_ARB_point_sprite\n#define GL_ARB_point_sprite 1\n#endif\n\n#ifndef GL_ARB_fragment_program_shadow\n#define GL_ARB_fragment_program_shadow 1\n#endif\n\n#ifndef GL_ARB_draw_buffers\n#define GL_ARB_draw_buffers 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);\n#endif\n\n#ifndef GL_ARB_texture_rectangle\n#define GL_ARB_texture_rectangle 1\n#endif\n\n#ifndef GL_ARB_color_buffer_float\n#define GL_ARB_color_buffer_float 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);\n#endif\n\n#ifndef GL_ARB_half_float_pixel\n#define GL_ARB_half_float_pixel 1\n#endif\n\n#ifndef GL_ARB_texture_float\n#define GL_ARB_texture_float 1\n#endif\n\n#ifndef GL_ARB_pixel_buffer_object\n#define GL_ARB_pixel_buffer_object 1\n#endif\n\n#ifndef GL_ARB_depth_buffer_float\n#define GL_ARB_depth_buffer_float 1\n#endif\n\n#ifndef GL_ARB_draw_instanced\n#define GL_ARB_draw_instanced 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);\nGLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);\n#endif\n\n#ifndef GL_ARB_framebuffer_object\n#define GL_ARB_framebuffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);\nGLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);\nGLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);\nGLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);\nGLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);\nGLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);\nGLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);\nGLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);\nGLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);\nGLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);\nGLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\nGLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\nGLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);\nGLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\nGLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGenerateMipmap (GLenum target);\nGLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\nGLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);\ntypedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);\ntypedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);\ntypedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);\ntypedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);\ntypedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);\ntypedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\ntypedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);\n#endif\n\n#ifndef GL_ARB_framebuffer_sRGB\n#define GL_ARB_framebuffer_sRGB 1\n#endif\n\n#ifndef GL_ARB_geometry_shader4\n#define GL_ARB_geometry_shader4 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value);\nGLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level);\nGLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);\nGLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);\n#endif\n\n#ifndef GL_ARB_half_float_vertex\n#define GL_ARB_half_float_vertex 1\n#endif\n\n#ifndef GL_ARB_instanced_arrays\n#define GL_ARB_instanced_arrays 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);\n#endif\n\n#ifndef GL_ARB_map_buffer_range\n#define GL_ARB_map_buffer_range 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);\nGLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);\ntypedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);\n#endif\n\n#ifndef GL_ARB_texture_buffer_object\n#define GL_ARB_texture_buffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);\n#endif\n\n#ifndef GL_ARB_texture_compression_rgtc\n#define GL_ARB_texture_compression_rgtc 1\n#endif\n\n#ifndef GL_ARB_texture_rg\n#define GL_ARB_texture_rg 1\n#endif\n\n#ifndef GL_ARB_vertex_array_object\n#define GL_ARB_vertex_array_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindVertexArray (GLuint array);\nGLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);\nGLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);\nGLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);\ntypedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);\ntypedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);\ntypedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);\n#endif\n\n#ifndef GL_ARB_uniform_buffer_object\n#define GL_ARB_uniform_buffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices);\nGLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);\nGLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);\nGLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);\nGLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices);\ntypedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);\ntypedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);\ntypedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);\ntypedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);\n#endif\n\n#ifndef GL_ARB_compatibility\n#define GL_ARB_compatibility 1\n#endif\n\n#ifndef GL_ARB_copy_buffer\n#define GL_ARB_copy_buffer 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);\n#endif\n\n#ifndef GL_ARB_shader_texture_lod\n#define GL_ARB_shader_texture_lod 1\n#endif\n\n#ifndef GL_ARB_depth_clamp\n#define GL_ARB_depth_clamp 1\n#endif\n\n#ifndef GL_ARB_draw_elements_base_vertex\n#define GL_ARB_draw_elements_base_vertex 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);\nGLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);\nGLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);\nGLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);\ntypedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);\ntypedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);\n#endif\n\n#ifndef GL_ARB_fragment_coord_conventions\n#define GL_ARB_fragment_coord_conventions 1\n#endif\n\n#ifndef GL_ARB_provoking_vertex\n#define GL_ARB_provoking_vertex 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProvokingVertex (GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);\n#endif\n\n#ifndef GL_ARB_seamless_cube_map\n#define GL_ARB_seamless_cube_map 1\n#endif\n\n#ifndef GL_ARB_sync\n#define GL_ARB_sync 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);\nGLAPI GLboolean APIENTRY glIsSync (GLsync sync);\nGLAPI void APIENTRY glDeleteSync (GLsync sync);\nGLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);\nGLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);\nGLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params);\nGLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);\ntypedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);\ntypedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);\ntypedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);\ntypedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);\ntypedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);\ntypedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);\n#endif\n\n#ifndef GL_ARB_texture_multisample\n#define GL_ARB_texture_multisample 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);\nGLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);\nGLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);\nGLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);\ntypedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);\ntypedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);\ntypedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);\n#endif\n\n#ifndef GL_ARB_vertex_array_bgra\n#define GL_ARB_vertex_array_bgra 1\n#endif\n\n#ifndef GL_ARB_draw_buffers_blend\n#define GL_ARB_draw_buffers_blend 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);\nGLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\nGLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);\nGLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\ntypedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);\ntypedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\n#endif\n\n#ifndef GL_ARB_sample_shading\n#define GL_ARB_sample_shading 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glMinSampleShadingARB (GLfloat value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value);\n#endif\n\n#ifndef GL_ARB_texture_cube_map_array\n#define GL_ARB_texture_cube_map_array 1\n#endif\n\n#ifndef GL_ARB_texture_gather\n#define GL_ARB_texture_gather 1\n#endif\n\n#ifndef GL_ARB_texture_query_lod\n#define GL_ARB_texture_query_lod 1\n#endif\n\n#ifndef GL_ARB_shading_language_include\n#define GL_ARB_shading_language_include 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);\nGLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);\nGLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);\nGLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);\nGLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);\nGLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);\ntypedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);\ntypedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);\ntypedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);\ntypedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);\ntypedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_ARB_texture_compression_bptc\n#define GL_ARB_texture_compression_bptc 1\n#endif\n\n#ifndef GL_ARB_blend_func_extended\n#define GL_ARB_blend_func_extended 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);\nGLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);\ntypedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);\n#endif\n\n#ifndef GL_ARB_explicit_attrib_location\n#define GL_ARB_explicit_attrib_location 1\n#endif\n\n#ifndef GL_ARB_occlusion_query2\n#define GL_ARB_occlusion_query2 1\n#endif\n\n#ifndef GL_ARB_sampler_objects\n#define GL_ARB_sampler_objects 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);\nGLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);\nGLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);\nGLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);\nGLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);\nGLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);\nGLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);\nGLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);\nGLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);\nGLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);\ntypedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);\ntypedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);\ntypedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);\ntypedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);\ntypedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);\ntypedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);\ntypedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);\ntypedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);\n#endif\n\n#ifndef GL_ARB_shader_bit_encoding\n#define GL_ARB_shader_bit_encoding 1\n#endif\n\n#ifndef GL_ARB_texture_rgb10_a2ui\n#define GL_ARB_texture_rgb10_a2ui 1\n#endif\n\n#ifndef GL_ARB_texture_swizzle\n#define GL_ARB_texture_swizzle 1\n#endif\n\n#ifndef GL_ARB_timer_query\n#define GL_ARB_timer_query 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);\nGLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);\nGLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);\ntypedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);\ntypedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);\n#endif\n\n#ifndef GL_ARB_vertex_type_2_10_10_10_rev\n#define GL_ARB_vertex_type_2_10_10_10_rev 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);\nGLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);\nGLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);\nGLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);\nGLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);\nGLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);\nGLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);\nGLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);\nGLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);\nGLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);\nGLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);\nGLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);\nGLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);\nGLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);\nGLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);\nGLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);\nGLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);\nGLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);\nGLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);\nGLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);\nGLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);\nGLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);\nGLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);\nGLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);\nGLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);\nGLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);\nGLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);\nGLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);\nGLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);\nGLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);\ntypedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);\ntypedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);\ntypedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);\ntypedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);\ntypedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);\ntypedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);\ntypedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);\ntypedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);\ntypedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);\ntypedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);\ntypedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);\n#endif\n\n#ifndef GL_ARB_draw_indirect\n#define GL_ARB_draw_indirect 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect);\nGLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);\n#endif\n\n#ifndef GL_ARB_gpu_shader5\n#define GL_ARB_gpu_shader5 1\n#endif\n\n#ifndef GL_ARB_gpu_shader_fp64\n#define GL_ARB_gpu_shader_fp64 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);\nGLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);\nGLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);\ntypedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);\n#endif\n\n#ifndef GL_ARB_shader_subroutine\n#define GL_ARB_shader_subroutine 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);\nGLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);\nGLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);\nGLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);\nGLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);\nGLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);\nGLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);\nGLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);\ntypedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);\ntypedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);\ntypedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);\ntypedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);\ntypedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);\ntypedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);\n#endif\n\n#ifndef GL_ARB_tessellation_shader\n#define GL_ARB_tessellation_shader 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);\nGLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);\ntypedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);\n#endif\n\n#ifndef GL_ARB_texture_buffer_object_rgb32\n#define GL_ARB_texture_buffer_object_rgb32 1\n#endif\n\n#ifndef GL_ARB_transform_feedback2\n#define GL_ARB_transform_feedback2 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);\nGLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);\nGLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);\nGLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);\nGLAPI void APIENTRY glPauseTransformFeedback (void);\nGLAPI void APIENTRY glResumeTransformFeedback (void);\nGLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);\ntypedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);\ntypedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);\ntypedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);\ntypedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);\ntypedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);\n#endif\n\n#ifndef GL_ARB_transform_feedback3\n#define GL_ARB_transform_feedback3 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);\nGLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);\nGLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);\nGLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);\ntypedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);\ntypedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);\ntypedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_ARB_ES2_compatibility\n#define GL_ARB_ES2_compatibility 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glReleaseShaderCompiler (void);\nGLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);\nGLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);\nGLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f);\nGLAPI void APIENTRY glClearDepthf (GLfloat d);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);\ntypedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);\ntypedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);\ntypedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);\ntypedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);\n#endif\n\n#ifndef GL_ARB_get_program_binary\n#define GL_ARB_get_program_binary 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);\nGLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);\nGLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);\ntypedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);\n#endif\n\n#ifndef GL_ARB_separate_shader_objects\n#define GL_ARB_separate_shader_objects 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);\nGLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);\nGLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* const *strings);\nGLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);\nGLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);\nGLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);\nGLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);\nGLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);\nGLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);\nGLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);\nGLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);\nGLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);\nGLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);\nGLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);\nGLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);\nGLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);\nGLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);\nGLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\nGLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);\nGLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);\nGLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\nGLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\nGLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);\nGLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\nGLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);\nGLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);\ntypedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);\ntypedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* const *strings);\ntypedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);\ntypedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);\ntypedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);\ntypedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);\ntypedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);\ntypedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);\n#endif\n\n#ifndef GL_ARB_vertex_attrib_64bit\n#define GL_ARB_vertex_attrib_64bit 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);\nGLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);\nGLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);\n#endif\n\n#ifndef GL_ARB_viewport_array\n#define GL_ARB_viewport_array 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);\nGLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);\nGLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);\nGLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);\nGLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v);\nGLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f);\nGLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);\nGLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);\ntypedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);\ntypedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f);\ntypedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);\ntypedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);\n#endif\n\n#ifndef GL_ARB_cl_event\n#define GL_ARB_cl_event 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);\n#endif\n\n#ifndef GL_ARB_debug_output\n#define GL_ARB_debug_output 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);\nGLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);\nGLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam);\nGLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam);\ntypedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);\n#endif\n\n#ifndef GL_ARB_robustness\n#define GL_ARB_robustness 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);\nGLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);\nGLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);\nGLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v);\nGLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values);\nGLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values);\nGLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values);\nGLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern);\nGLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);\nGLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);\nGLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);\nGLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);\nGLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);\nGLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);\nGLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);\nGLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);\nGLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);\nGLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);\nGLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);\nGLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);\ntypedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);\ntypedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);\ntypedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);\ntypedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values);\ntypedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values);\ntypedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values);\ntypedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern);\ntypedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);\ntypedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);\ntypedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);\ntypedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);\ntypedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);\ntypedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);\ntypedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);\ntypedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);\ntypedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);\ntypedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);\ntypedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);\n#endif\n\n#ifndef GL_ARB_shader_stencil_export\n#define GL_ARB_shader_stencil_export 1\n#endif\n\n#ifndef GL_ARB_base_instance\n#define GL_ARB_base_instance 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);\nGLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);\nGLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);\n#endif\n\n#ifndef GL_ARB_shading_language_420pack\n#define GL_ARB_shading_language_420pack 1\n#endif\n\n#ifndef GL_ARB_transform_feedback_instanced\n#define GL_ARB_transform_feedback_instanced 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount);\nGLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount);\ntypedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);\n#endif\n\n#ifndef GL_ARB_compressed_texture_pixel_storage\n#define GL_ARB_compressed_texture_pixel_storage 1\n#endif\n\n#ifndef GL_ARB_conservative_depth\n#define GL_ARB_conservative_depth 1\n#endif\n\n#ifndef GL_ARB_internalformat_query\n#define GL_ARB_internalformat_query 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);\n#endif\n\n#ifndef GL_ARB_map_buffer_alignment\n#define GL_ARB_map_buffer_alignment 1\n#endif\n\n#ifndef GL_ARB_shader_atomic_counters\n#define GL_ARB_shader_atomic_counters 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_ARB_shader_image_load_store\n#define GL_ARB_shader_image_load_store 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);\nGLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);\ntypedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);\n#endif\n\n#ifndef GL_ARB_shading_language_packing\n#define GL_ARB_shading_language_packing 1\n#endif\n\n#ifndef GL_ARB_texture_storage\n#define GL_ARB_texture_storage 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);\nGLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);\nGLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);\nGLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);\ntypedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);\ntypedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);\ntypedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);\n#endif\n\n#ifndef GL_KHR_texture_compression_astc_ldr\n#define GL_KHR_texture_compression_astc_ldr 1\n#endif\n\n#ifndef GL_KHR_debug\n#define GL_KHR_debug 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);\nGLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);\nGLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam);\nGLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);\nGLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message);\nGLAPI void APIENTRY glPopDebugGroup (void);\nGLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);\nGLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);\nGLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label);\nGLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);\ntypedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);\ntypedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);\ntypedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);\ntypedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);\ntypedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);\ntypedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);\ntypedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);\n#endif\n\n#ifndef GL_ARB_arrays_of_arrays\n#define GL_ARB_arrays_of_arrays 1\n#endif\n\n#ifndef GL_ARB_clear_buffer_object\n#define GL_ARB_clear_buffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);\nGLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);\nGLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);\nGLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);\ntypedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);\ntypedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);\ntypedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);\n#endif\n\n#ifndef GL_ARB_compute_shader\n#define GL_ARB_compute_shader 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);\nGLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);\ntypedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);\n#endif\n\n#ifndef GL_ARB_copy_image\n#define GL_ARB_copy_image 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);\n#endif\n\n#ifndef GL_ARB_texture_view\n#define GL_ARB_texture_view 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);\n#endif\n\n#ifndef GL_ARB_vertex_attrib_binding\n#define GL_ARB_vertex_attrib_binding 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);\nGLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);\nGLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);\nGLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);\nGLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);\nGLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);\nGLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);\nGLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);\nGLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);\nGLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);\nGLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex);\nGLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);\ntypedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor);\n#endif\n\n#ifndef GL_ARB_robustness_isolation\n#define GL_ARB_robustness_isolation 1\n#endif\n\n#ifndef GL_ARB_ES3_compatibility\n#define GL_ARB_ES3_compatibility 1\n#endif\n\n#ifndef GL_ARB_explicit_uniform_location\n#define GL_ARB_explicit_uniform_location 1\n#endif\n\n#ifndef GL_ARB_fragment_layer_viewport\n#define GL_ARB_fragment_layer_viewport 1\n#endif\n\n#ifndef GL_ARB_framebuffer_no_attachments\n#define GL_ARB_framebuffer_no_attachments 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);\nGLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param);\nGLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_ARB_internalformat_query2\n#define GL_ARB_internalformat_query2 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);\n#endif\n\n#ifndef GL_ARB_invalidate_subdata\n#define GL_ARB_invalidate_subdata 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);\nGLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level);\nGLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length);\nGLAPI void APIENTRY glInvalidateBufferData (GLuint buffer);\nGLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);\nGLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);\ntypedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);\ntypedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer);\ntypedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);\ntypedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);\n#endif\n\n#ifndef GL_ARB_multi_draw_indirect\n#define GL_ARB_multi_draw_indirect 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);\nGLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);\ntypedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);\n#endif\n\n#ifndef GL_ARB_program_interface_query\n#define GL_ARB_program_interface_query 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);\nGLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);\nGLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);\nGLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);\nGLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);\nGLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);\ntypedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);\ntypedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);\ntypedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);\ntypedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);\ntypedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);\n#endif\n\n#ifndef GL_ARB_robust_buffer_access_behavior\n#define GL_ARB_robust_buffer_access_behavior 1\n#endif\n\n#ifndef GL_ARB_shader_image_size\n#define GL_ARB_shader_image_size 1\n#endif\n\n#ifndef GL_ARB_shader_storage_buffer_object\n#define GL_ARB_shader_storage_buffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);\n#endif\n\n#ifndef GL_ARB_stencil_texturing\n#define GL_ARB_stencil_texturing 1\n#endif\n\n#ifndef GL_ARB_texture_buffer_range\n#define GL_ARB_texture_buffer_range 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);\nGLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);\ntypedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);\n#endif\n\n#ifndef GL_ARB_texture_query_levels\n#define GL_ARB_texture_query_levels 1\n#endif\n\n#ifndef GL_ARB_texture_storage_multisample\n#define GL_ARB_texture_storage_multisample 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);\nGLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);\nGLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);\nGLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);\ntypedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);\ntypedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);\ntypedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);\n#endif\n\n#ifndef GL_EXT_abgr\n#define GL_EXT_abgr 1\n#endif\n\n#ifndef GL_EXT_blend_color\n#define GL_EXT_blend_color 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);\n#endif\n\n#ifndef GL_EXT_polygon_offset\n#define GL_EXT_polygon_offset 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);\n#endif\n\n#ifndef GL_EXT_texture\n#define GL_EXT_texture 1\n#endif\n\n#ifndef GL_EXT_texture3D\n#define GL_EXT_texture3D 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\n#endif\n\n#ifndef GL_SGIS_texture_filter4\n#define GL_SGIS_texture_filter4 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights);\nGLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);\ntypedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);\n#endif\n\n#ifndef GL_EXT_subtexture\n#define GL_EXT_subtexture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);\n#endif\n\n#ifndef GL_EXT_copy_texture\n#define GL_EXT_copy_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\nGLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\nGLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\nGLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\ntypedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\ntypedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\ntypedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\n#endif\n\n#ifndef GL_EXT_histogram\n#define GL_EXT_histogram 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\nGLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\nGLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);\nGLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink);\nGLAPI void APIENTRY glResetHistogramEXT (GLenum target);\nGLAPI void APIENTRY glResetMinmaxEXT (GLenum target);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\ntypedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\ntypedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);\ntypedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);\ntypedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);\n#endif\n\n#ifndef GL_EXT_convolution\n#define GL_EXT_convolution 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);\nGLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);\nGLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params);\nGLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params);\nGLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\nGLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image);\nGLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);\nGLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);\ntypedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\ntypedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);\ntypedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);\ntypedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);\n#endif\n\n#ifndef GL_SGI_color_matrix\n#define GL_SGI_color_matrix 1\n#endif\n\n#ifndef GL_SGI_color_table\n#define GL_SGI_color_table 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);\nGLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\nGLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table);\nGLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);\ntypedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_SGIX_pixel_texture\n#define GL_SGIX_pixel_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);\n#endif\n\n#ifndef GL_SGIS_pixel_texture\n#define GL_SGIS_pixel_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param);\nGLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params);\nGLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param);\nGLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);\n#endif\n\n#ifndef GL_SGIS_texture4D\n#define GL_SGIS_texture4D 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);\n#endif\n\n#ifndef GL_SGI_texture_color_table\n#define GL_SGI_texture_color_table 1\n#endif\n\n#ifndef GL_EXT_cmyka\n#define GL_EXT_cmyka 1\n#endif\n\n#ifndef GL_EXT_texture_object\n#define GL_EXT_texture_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences);\nGLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture);\nGLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures);\nGLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures);\nGLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture);\nGLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);\ntypedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);\ntypedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);\ntypedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);\ntypedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);\ntypedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);\n#endif\n\n#ifndef GL_SGIS_detail_texture\n#define GL_SGIS_detail_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);\nGLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);\ntypedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);\n#endif\n\n#ifndef GL_SGIS_sharpen_texture\n#define GL_SGIS_sharpen_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);\nGLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);\ntypedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);\n#endif\n\n#ifndef GL_EXT_packed_pixels\n#define GL_EXT_packed_pixels 1\n#endif\n\n#ifndef GL_SGIS_texture_lod\n#define GL_SGIS_texture_lod 1\n#endif\n\n#ifndef GL_SGIS_multisample\n#define GL_SGIS_multisample 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert);\nGLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);\ntypedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);\n#endif\n\n#ifndef GL_EXT_rescale_normal\n#define GL_EXT_rescale_normal 1\n#endif\n\n#ifndef GL_EXT_vertex_array\n#define GL_EXT_vertex_array 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glArrayElementEXT (GLint i);\nGLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\nGLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count);\nGLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);\nGLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params);\nGLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\nGLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\nGLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\nGLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);\ntypedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);\ntypedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);\ntypedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);\ntypedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);\n#endif\n\n#ifndef GL_EXT_misc_attribute\n#define GL_EXT_misc_attribute 1\n#endif\n\n#ifndef GL_SGIS_generate_mipmap\n#define GL_SGIS_generate_mipmap 1\n#endif\n\n#ifndef GL_SGIX_clipmap\n#define GL_SGIX_clipmap 1\n#endif\n\n#ifndef GL_SGIX_shadow\n#define GL_SGIX_shadow 1\n#endif\n\n#ifndef GL_SGIS_texture_edge_clamp\n#define GL_SGIS_texture_edge_clamp 1\n#endif\n\n#ifndef GL_SGIS_texture_border_clamp\n#define GL_SGIS_texture_border_clamp 1\n#endif\n\n#ifndef GL_EXT_blend_minmax\n#define GL_EXT_blend_minmax 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendEquationEXT (GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);\n#endif\n\n#ifndef GL_EXT_blend_subtract\n#define GL_EXT_blend_subtract 1\n#endif\n\n#ifndef GL_EXT_blend_logic_op\n#define GL_EXT_blend_logic_op 1\n#endif\n\n#ifndef GL_SGIX_interlace\n#define GL_SGIX_interlace 1\n#endif\n\n#ifndef GL_SGIX_pixel_tiles\n#define GL_SGIX_pixel_tiles 1\n#endif\n\n#ifndef GL_SGIX_texture_select\n#define GL_SGIX_texture_select 1\n#endif\n\n#ifndef GL_SGIX_sprite\n#define GL_SGIX_sprite 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param);\nGLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param);\nGLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);\n#endif\n\n#ifndef GL_SGIX_texture_multi_buffer\n#define GL_SGIX_texture_multi_buffer 1\n#endif\n\n#ifndef GL_EXT_point_parameters\n#define GL_EXT_point_parameters 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param);\nGLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);\n#endif\n\n#ifndef GL_SGIS_point_parameters\n#define GL_SGIS_point_parameters 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param);\nGLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);\n#endif\n\n#ifndef GL_SGIX_instruments\n#define GL_SGIX_instruments 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLint APIENTRY glGetInstrumentsSGIX (void);\nGLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer);\nGLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p);\nGLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker);\nGLAPI void APIENTRY glStartInstrumentsSGIX (void);\nGLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);\ntypedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);\ntypedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);\ntypedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);\ntypedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);\ntypedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);\n#endif\n\n#ifndef GL_SGIX_texture_scale_bias\n#define GL_SGIX_texture_scale_bias 1\n#endif\n\n#ifndef GL_SGIX_framezoom\n#define GL_SGIX_framezoom 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFrameZoomSGIX (GLint factor);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);\n#endif\n\n#ifndef GL_SGIX_tag_sample_buffer\n#define GL_SGIX_tag_sample_buffer 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTagSampleBufferSGIX (void);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);\n#endif\n\n#ifndef GL_SGIX_polynomial_ffd\n#define GL_SGIX_polynomial_ffd 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);\nGLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);\nGLAPI void APIENTRY glDeformSGIX (GLbitfield mask);\nGLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);\ntypedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);\ntypedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);\ntypedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);\n#endif\n\n#ifndef GL_SGIX_reference_plane\n#define GL_SGIX_reference_plane 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);\n#endif\n\n#ifndef GL_SGIX_flush_raster\n#define GL_SGIX_flush_raster 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFlushRasterSGIX (void);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);\n#endif\n\n#ifndef GL_SGIX_depth_texture\n#define GL_SGIX_depth_texture 1\n#endif\n\n#ifndef GL_SGIS_fog_function\n#define GL_SGIS_fog_function 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points);\nGLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);\ntypedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);\n#endif\n\n#ifndef GL_SGIX_fog_offset\n#define GL_SGIX_fog_offset 1\n#endif\n\n#ifndef GL_HP_image_transform\n#define GL_HP_image_transform 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param);\nGLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);\n#endif\n\n#ifndef GL_HP_convolution_border_modes\n#define GL_HP_convolution_border_modes 1\n#endif\n\n#ifndef GL_SGIX_texture_add_env\n#define GL_SGIX_texture_add_env 1\n#endif\n\n#ifndef GL_EXT_color_subtable\n#define GL_EXT_color_subtable 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);\nGLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);\ntypedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);\n#endif\n\n#ifndef GL_PGI_vertex_hints\n#define GL_PGI_vertex_hints 1\n#endif\n\n#ifndef GL_PGI_misc_hints\n#define GL_PGI_misc_hints 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glHintPGI (GLenum target, GLint mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);\n#endif\n\n#ifndef GL_EXT_paletted_texture\n#define GL_EXT_paletted_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);\nGLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data);\nGLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);\n#endif\n\n#ifndef GL_EXT_clip_volume_hint\n#define GL_EXT_clip_volume_hint 1\n#endif\n\n#ifndef GL_SGIX_list_priority\n#define GL_SGIX_list_priority 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params);\nGLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param);\nGLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);\n#endif\n\n#ifndef GL_SGIX_ir_instrument1\n#define GL_SGIX_ir_instrument1 1\n#endif\n\n#ifndef GL_SGIX_calligraphic_fragment\n#define GL_SGIX_calligraphic_fragment 1\n#endif\n\n#ifndef GL_SGIX_texture_lod_bias\n#define GL_SGIX_texture_lod_bias 1\n#endif\n\n#ifndef GL_SGIX_shadow_ambient\n#define GL_SGIX_shadow_ambient 1\n#endif\n\n#ifndef GL_EXT_index_texture\n#define GL_EXT_index_texture 1\n#endif\n\n#ifndef GL_EXT_index_material\n#define GL_EXT_index_material 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);\n#endif\n\n#ifndef GL_EXT_index_func\n#define GL_EXT_index_func 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);\n#endif\n\n#ifndef GL_EXT_index_array_formats\n#define GL_EXT_index_array_formats 1\n#endif\n\n#ifndef GL_EXT_compiled_vertex_array\n#define GL_EXT_compiled_vertex_array 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count);\nGLAPI void APIENTRY glUnlockArraysEXT (void);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);\ntypedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);\n#endif\n\n#ifndef GL_EXT_cull_vertex\n#define GL_EXT_cull_vertex 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params);\nGLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);\ntypedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);\n#endif\n\n#ifndef GL_SGIX_ycrcb\n#define GL_SGIX_ycrcb 1\n#endif\n\n#ifndef GL_SGIX_fragment_lighting\n#define GL_SGIX_fragment_lighting 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode);\nGLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param);\nGLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param);\nGLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param);\nGLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params);\nGLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param);\nGLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params);\nGLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);\ntypedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);\n#endif\n\n#ifndef GL_IBM_rasterpos_clip\n#define GL_IBM_rasterpos_clip 1\n#endif\n\n#ifndef GL_HP_texture_lighting\n#define GL_HP_texture_lighting 1\n#endif\n\n#ifndef GL_EXT_draw_range_elements\n#define GL_EXT_draw_range_elements 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);\n#endif\n\n#ifndef GL_WIN_phong_shading\n#define GL_WIN_phong_shading 1\n#endif\n\n#ifndef GL_WIN_specular_fog\n#define GL_WIN_specular_fog 1\n#endif\n\n#ifndef GL_EXT_light_texture\n#define GL_EXT_light_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glApplyTextureEXT (GLenum mode);\nGLAPI void APIENTRY glTextureLightEXT (GLenum pname);\nGLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);\ntypedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);\ntypedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);\n#endif\n\n#ifndef GL_SGIX_blend_alpha_minmax\n#define GL_SGIX_blend_alpha_minmax 1\n#endif\n\n#ifndef GL_EXT_bgra\n#define GL_EXT_bgra 1\n#endif\n\n#ifndef GL_SGIX_async\n#define GL_SGIX_async 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker);\nGLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp);\nGLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp);\nGLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range);\nGLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range);\nGLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);\ntypedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);\ntypedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);\ntypedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);\ntypedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);\ntypedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);\n#endif\n\n#ifndef GL_SGIX_async_pixel\n#define GL_SGIX_async_pixel 1\n#endif\n\n#ifndef GL_SGIX_async_histogram\n#define GL_SGIX_async_histogram 1\n#endif\n\n#ifndef GL_INTEL_parallel_arrays\n#define GL_INTEL_parallel_arrays 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);\nGLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer);\nGLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);\nGLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);\ntypedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);\ntypedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);\ntypedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);\n#endif\n\n#ifndef GL_HP_occlusion_test\n#define GL_HP_occlusion_test 1\n#endif\n\n#ifndef GL_EXT_pixel_transform\n#define GL_EXT_pixel_transform 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param);\nGLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);\n#endif\n\n#ifndef GL_EXT_pixel_transform_color_table\n#define GL_EXT_pixel_transform_color_table 1\n#endif\n\n#ifndef GL_EXT_shared_texture_palette\n#define GL_EXT_shared_texture_palette 1\n#endif\n\n#ifndef GL_EXT_separate_specular_color\n#define GL_EXT_separate_specular_color 1\n#endif\n\n#ifndef GL_EXT_secondary_color\n#define GL_EXT_secondary_color 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue);\nGLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v);\nGLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue);\nGLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v);\nGLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue);\nGLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v);\nGLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue);\nGLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v);\nGLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);\nGLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);\nGLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);\nGLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);\nGLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);\nGLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);\nGLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);\nGLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);\nGLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif\n\n#ifndef GL_EXT_texture_perturb_normal\n#define GL_EXT_texture_perturb_normal 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTextureNormalEXT (GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);\n#endif\n\n#ifndef GL_EXT_multi_draw_arrays\n#define GL_EXT_multi_draw_arrays 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);\nGLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);\ntypedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);\n#endif\n\n#ifndef GL_EXT_fog_coord\n#define GL_EXT_fog_coord 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFogCoordfEXT (GLfloat coord);\nGLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord);\nGLAPI void APIENTRY glFogCoorddEXT (GLdouble coord);\nGLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord);\nGLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);\ntypedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);\ntypedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);\ntypedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);\ntypedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif\n\n#ifndef GL_REND_screen_coordinates\n#define GL_REND_screen_coordinates 1\n#endif\n\n#ifndef GL_EXT_coordinate_frame\n#define GL_EXT_coordinate_frame 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz);\nGLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v);\nGLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz);\nGLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v);\nGLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz);\nGLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v);\nGLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz);\nGLAPI void APIENTRY glTangent3ivEXT (const GLint *v);\nGLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz);\nGLAPI void APIENTRY glTangent3svEXT (const GLshort *v);\nGLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz);\nGLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v);\nGLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz);\nGLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v);\nGLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz);\nGLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v);\nGLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz);\nGLAPI void APIENTRY glBinormal3ivEXT (const GLint *v);\nGLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz);\nGLAPI void APIENTRY glBinormal3svEXT (const GLshort *v);\nGLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);\ntypedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);\ntypedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);\ntypedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);\ntypedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);\ntypedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);\ntypedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);\ntypedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);\ntypedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);\ntypedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);\ntypedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);\ntypedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);\ntypedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);\ntypedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);\ntypedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif\n\n#ifndef GL_EXT_texture_env_combine\n#define GL_EXT_texture_env_combine 1\n#endif\n\n#ifndef GL_APPLE_specular_vector\n#define GL_APPLE_specular_vector 1\n#endif\n\n#ifndef GL_APPLE_transform_hint\n#define GL_APPLE_transform_hint 1\n#endif\n\n#ifndef GL_SGIX_fog_scale\n#define GL_SGIX_fog_scale 1\n#endif\n\n#ifndef GL_SUNX_constant_data\n#define GL_SUNX_constant_data 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFinishTextureSUNX (void);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);\n#endif\n\n#ifndef GL_SUN_global_alpha\n#define GL_SUN_global_alpha 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor);\nGLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor);\nGLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor);\nGLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor);\nGLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor);\nGLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor);\nGLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor);\nGLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);\ntypedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);\ntypedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);\ntypedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);\ntypedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);\ntypedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);\ntypedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);\ntypedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);\n#endif\n\n#ifndef GL_SUN_triangle_list\n#define GL_SUN_triangle_list 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code);\nGLAPI void APIENTRY glReplacementCodeusSUN (GLushort code);\nGLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code);\nGLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code);\nGLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code);\nGLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code);\nGLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);\n#endif\n\n#ifndef GL_SUN_vertex\n#define GL_SUN_vertex 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);\nGLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v);\nGLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v);\nGLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v);\nGLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v);\nGLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v);\nGLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v);\nGLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v);\nGLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v);\nGLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v);\nGLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v);\nGLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\nGLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\nGLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v);\nGLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v);\nGLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v);\nGLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v);\nGLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\nGLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v);\nGLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);\nGLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);\ntypedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\n#endif\n\n#ifndef GL_EXT_blend_func_separate\n#define GL_EXT_blend_func_separate 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\n#endif\n\n#ifndef GL_INGR_blend_func_separate\n#define GL_INGR_blend_func_separate 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\n#endif\n\n#ifndef GL_INGR_color_clamp\n#define GL_INGR_color_clamp 1\n#endif\n\n#ifndef GL_INGR_interlace_read\n#define GL_INGR_interlace_read 1\n#endif\n\n#ifndef GL_EXT_stencil_wrap\n#define GL_EXT_stencil_wrap 1\n#endif\n\n#ifndef GL_EXT_422_pixels\n#define GL_EXT_422_pixels 1\n#endif\n\n#ifndef GL_NV_texgen_reflection\n#define GL_NV_texgen_reflection 1\n#endif\n\n#ifndef GL_SUN_convolution_border_modes\n#define GL_SUN_convolution_border_modes 1\n#endif\n\n#ifndef GL_EXT_texture_env_add\n#define GL_EXT_texture_env_add 1\n#endif\n\n#ifndef GL_EXT_texture_lod_bias\n#define GL_EXT_texture_lod_bias 1\n#endif\n\n#ifndef GL_EXT_texture_filter_anisotropic\n#define GL_EXT_texture_filter_anisotropic 1\n#endif\n\n#ifndef GL_EXT_vertex_weighting\n#define GL_EXT_vertex_weighting 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight);\nGLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight);\nGLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);\ntypedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);\ntypedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\n#endif\n\n#ifndef GL_NV_light_max_exponent\n#define GL_NV_light_max_exponent 1\n#endif\n\n#ifndef GL_NV_vertex_array_range\n#define GL_NV_vertex_array_range 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFlushVertexArrayRangeNV (void);\nGLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);\n#endif\n\n#ifndef GL_NV_register_combiners\n#define GL_NV_register_combiners 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param);\nGLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params);\nGLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param);\nGLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);\nGLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);\nGLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);\nGLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);\ntypedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);\ntypedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);\ntypedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_NV_fog_distance\n#define GL_NV_fog_distance 1\n#endif\n\n#ifndef GL_NV_texgen_emboss\n#define GL_NV_texgen_emboss 1\n#endif\n\n#ifndef GL_NV_blend_square\n#define GL_NV_blend_square 1\n#endif\n\n#ifndef GL_NV_texture_env_combine4\n#define GL_NV_texture_env_combine4 1\n#endif\n\n#ifndef GL_MESA_resize_buffers\n#define GL_MESA_resize_buffers 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glResizeBuffersMESA (void);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);\n#endif\n\n#ifndef GL_MESA_window_pos\n#define GL_MESA_window_pos 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y);\nGLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v);\nGLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y);\nGLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v);\nGLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y);\nGLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v);\nGLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y);\nGLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v);\nGLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v);\nGLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v);\nGLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z);\nGLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v);\nGLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z);\nGLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v);\nGLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v);\nGLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v);\nGLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w);\nGLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v);\nGLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w);\nGLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);\ntypedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);\ntypedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);\ntypedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);\ntypedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);\n#endif\n\n#ifndef GL_IBM_cull_vertex\n#define GL_IBM_cull_vertex 1\n#endif\n\n#ifndef GL_IBM_multimode_draw_arrays\n#define GL_IBM_multimode_draw_arrays 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);\nGLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);\ntypedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);\n#endif\n\n#ifndef GL_IBM_vertex_array_lists\n#define GL_IBM_vertex_array_lists 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\nGLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\nGLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride);\nGLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\nGLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\nGLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\nGLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\nGLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\ntypedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);\ntypedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\ntypedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\ntypedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\ntypedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\ntypedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);\n#endif\n\n#ifndef GL_SGIX_subsample\n#define GL_SGIX_subsample 1\n#endif\n\n#ifndef GL_SGIX_ycrcba\n#define GL_SGIX_ycrcba 1\n#endif\n\n#ifndef GL_SGIX_ycrcb_subsample\n#define GL_SGIX_ycrcb_subsample 1\n#endif\n\n#ifndef GL_SGIX_depth_pass_instrument\n#define GL_SGIX_depth_pass_instrument 1\n#endif\n\n#ifndef GL_3DFX_texture_compression_FXT1\n#define GL_3DFX_texture_compression_FXT1 1\n#endif\n\n#ifndef GL_3DFX_multisample\n#define GL_3DFX_multisample 1\n#endif\n\n#ifndef GL_3DFX_tbuffer\n#define GL_3DFX_tbuffer 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTbufferMask3DFX (GLuint mask);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);\n#endif\n\n#ifndef GL_EXT_multisample\n#define GL_EXT_multisample 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert);\nGLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);\ntypedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);\n#endif\n\n#ifndef GL_SGIX_vertex_preclip\n#define GL_SGIX_vertex_preclip 1\n#endif\n\n#ifndef GL_SGIX_convolution_accuracy\n#define GL_SGIX_convolution_accuracy 1\n#endif\n\n#ifndef GL_SGIX_resample\n#define GL_SGIX_resample 1\n#endif\n\n#ifndef GL_SGIS_point_line_texgen\n#define GL_SGIS_point_line_texgen 1\n#endif\n\n#ifndef GL_SGIS_texture_color_mask\n#define GL_SGIS_texture_color_mask 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);\n#endif\n\n#ifndef GL_SGIX_igloo_interface\n#define GL_SGIX_igloo_interface 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);\n#endif\n\n#ifndef GL_EXT_texture_env_dot3\n#define GL_EXT_texture_env_dot3 1\n#endif\n\n#ifndef GL_ATI_texture_mirror_once\n#define GL_ATI_texture_mirror_once 1\n#endif\n\n#ifndef GL_NV_fence\n#define GL_NV_fence 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);\nGLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);\nGLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence);\nGLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence);\nGLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);\nGLAPI void APIENTRY glFinishFenceNV (GLuint fence);\nGLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);\ntypedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);\ntypedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);\ntypedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);\ntypedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);\ntypedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);\n#endif\n\n#ifndef GL_NV_evaluators\n#define GL_NV_evaluators 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);\nGLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);\nGLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);\ntypedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);\ntypedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);\n#endif\n\n#ifndef GL_NV_packed_depth_stencil\n#define GL_NV_packed_depth_stencil 1\n#endif\n\n#ifndef GL_NV_register_combiners2\n#define GL_NV_register_combiners2 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);\n#endif\n\n#ifndef GL_NV_texture_compression_vtc\n#define GL_NV_texture_compression_vtc 1\n#endif\n\n#ifndef GL_NV_texture_rectangle\n#define GL_NV_texture_rectangle 1\n#endif\n\n#ifndef GL_NV_texture_shader\n#define GL_NV_texture_shader 1\n#endif\n\n#ifndef GL_NV_texture_shader2\n#define GL_NV_texture_shader2 1\n#endif\n\n#ifndef GL_NV_vertex_array_range2\n#define GL_NV_vertex_array_range2 1\n#endif\n\n#ifndef GL_NV_vertex_program\n#define GL_NV_vertex_program 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences);\nGLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id);\nGLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs);\nGLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params);\nGLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs);\nGLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params);\nGLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program);\nGLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params);\nGLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer);\nGLAPI GLboolean APIENTRY glIsProgramNV (GLuint id);\nGLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program);\nGLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v);\nGLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v);\nGLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);\nGLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);\nGLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x);\nGLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x);\nGLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x);\nGLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y);\nGLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y);\nGLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y);\nGLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z);\nGLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\nGLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\nGLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v);\nGLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v);\nGLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v);\nGLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v);\nGLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v);\nGLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v);\nGLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);\ntypedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);\ntypedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);\ntypedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);\ntypedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);\ntypedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);\ntypedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);\ntypedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);\n#endif\n\n#ifndef GL_SGIX_texture_coordinate_clamp\n#define GL_SGIX_texture_coordinate_clamp 1\n#endif\n\n#ifndef GL_SGIX_scalebias_hint\n#define GL_SGIX_scalebias_hint 1\n#endif\n\n#ifndef GL_OML_interlace\n#define GL_OML_interlace 1\n#endif\n\n#ifndef GL_OML_subsample\n#define GL_OML_subsample 1\n#endif\n\n#ifndef GL_OML_resample\n#define GL_OML_resample 1\n#endif\n\n#ifndef GL_NV_copy_depth_to_color\n#define GL_NV_copy_depth_to_color 1\n#endif\n\n#ifndef GL_ATI_envmap_bumpmap\n#define GL_ATI_envmap_bumpmap 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param);\nGLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param);\nGLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param);\nGLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);\ntypedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);\ntypedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);\ntypedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);\n#endif\n\n#ifndef GL_ATI_fragment_shader\n#define GL_ATI_fragment_shader 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range);\nGLAPI void APIENTRY glBindFragmentShaderATI (GLuint id);\nGLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id);\nGLAPI void APIENTRY glBeginFragmentShaderATI (void);\nGLAPI void APIENTRY glEndFragmentShaderATI (void);\nGLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle);\nGLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle);\nGLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);\nGLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);\nGLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);\nGLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);\nGLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);\nGLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);\nGLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);\ntypedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);\ntypedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);\ntypedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);\ntypedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);\ntypedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);\ntypedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);\ntypedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);\ntypedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);\ntypedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);\ntypedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);\ntypedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);\n#endif\n\n#ifndef GL_ATI_pn_triangles\n#define GL_ATI_pn_triangles 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param);\nGLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);\n#endif\n\n#ifndef GL_ATI_vertex_array_object\n#define GL_ATI_vertex_array_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage);\nGLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer);\nGLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);\nGLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params);\nGLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer);\nGLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);\nGLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params);\nGLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);\nGLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);\ntypedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);\ntypedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);\ntypedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);\ntypedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);\ntypedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);\ntypedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_EXT_vertex_shader\n#define GL_EXT_vertex_shader 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBeginVertexShaderEXT (void);\nGLAPI void APIENTRY glEndVertexShaderEXT (void);\nGLAPI void APIENTRY glBindVertexShaderEXT (GLuint id);\nGLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range);\nGLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id);\nGLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1);\nGLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2);\nGLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);\nGLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);\nGLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);\nGLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num);\nGLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num);\nGLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);\nGLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr);\nGLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr);\nGLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr);\nGLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr);\nGLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr);\nGLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr);\nGLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr);\nGLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr);\nGLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr);\nGLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr);\nGLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);\nGLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id);\nGLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id);\nGLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value);\nGLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value);\nGLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value);\nGLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value);\nGLAPI GLuint APIENTRY glBindParameterEXT (GLenum value);\nGLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap);\nGLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);\nGLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data);\nGLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);\nGLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data);\nGLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);\nGLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data);\nGLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);\nGLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);\nGLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data);\nGLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);\ntypedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);\ntypedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);\ntypedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);\ntypedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);\ntypedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);\ntypedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);\ntypedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);\ntypedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);\ntypedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);\ntypedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);\ntypedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);\ntypedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);\ntypedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);\ntypedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);\ntypedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);\ntypedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);\ntypedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);\ntypedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);\ntypedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);\ntypedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);\ntypedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);\ntypedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);\ntypedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);\ntypedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);\ntypedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);\ntypedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);\ntypedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);\ntypedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);\ntypedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);\ntypedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);\ntypedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);\ntypedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);\ntypedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);\ntypedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);\ntypedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);\ntypedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);\ntypedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);\ntypedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);\ntypedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);\n#endif\n\n#ifndef GL_ATI_vertex_streams\n#define GL_ATI_vertex_streams 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x);\nGLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords);\nGLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x);\nGLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords);\nGLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x);\nGLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords);\nGLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x);\nGLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords);\nGLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y);\nGLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords);\nGLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y);\nGLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords);\nGLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y);\nGLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords);\nGLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y);\nGLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords);\nGLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z);\nGLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords);\nGLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z);\nGLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords);\nGLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords);\nGLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords);\nGLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);\nGLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords);\nGLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w);\nGLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords);\nGLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords);\nGLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords);\nGLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);\nGLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords);\nGLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz);\nGLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords);\nGLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz);\nGLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords);\nGLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);\nGLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords);\nGLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);\nGLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords);\nGLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream);\nGLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param);\nGLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);\ntypedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);\ntypedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);\ntypedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);\n#endif\n\n#ifndef GL_ATI_element_array\n#define GL_ATI_element_array 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer);\nGLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count);\nGLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);\ntypedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);\n#endif\n\n#ifndef GL_SUN_mesh_array\n#define GL_SUN_mesh_array 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);\n#endif\n\n#ifndef GL_SUN_slice_accum\n#define GL_SUN_slice_accum 1\n#endif\n\n#ifndef GL_NV_multisample_filter_hint\n#define GL_NV_multisample_filter_hint 1\n#endif\n\n#ifndef GL_NV_depth_clamp\n#define GL_NV_depth_clamp 1\n#endif\n\n#ifndef GL_NV_occlusion_query\n#define GL_NV_occlusion_query 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids);\nGLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids);\nGLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id);\nGLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id);\nGLAPI void APIENTRY glEndOcclusionQueryNV (void);\nGLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);\ntypedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);\ntypedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);\ntypedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);\n#endif\n\n#ifndef GL_NV_point_sprite\n#define GL_NV_point_sprite 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param);\nGLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);\n#endif\n\n#ifndef GL_NV_texture_shader3\n#define GL_NV_texture_shader3 1\n#endif\n\n#ifndef GL_NV_vertex_program1_1\n#define GL_NV_vertex_program1_1 1\n#endif\n\n#ifndef GL_EXT_shadow_funcs\n#define GL_EXT_shadow_funcs 1\n#endif\n\n#ifndef GL_EXT_stencil_two_side\n#define GL_EXT_stencil_two_side 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);\n#endif\n\n#ifndef GL_ATI_text_fragment_shader\n#define GL_ATI_text_fragment_shader 1\n#endif\n\n#ifndef GL_APPLE_client_storage\n#define GL_APPLE_client_storage 1\n#endif\n\n#ifndef GL_APPLE_element_array\n#define GL_APPLE_element_array 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer);\nGLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count);\nGLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);\nGLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);\nGLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);\ntypedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);\ntypedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);\ntypedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);\n#endif\n\n#ifndef GL_APPLE_fence\n#define GL_APPLE_fence 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences);\nGLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences);\nGLAPI void APIENTRY glSetFenceAPPLE (GLuint fence);\nGLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence);\nGLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence);\nGLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence);\nGLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name);\nGLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);\ntypedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);\ntypedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);\ntypedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);\ntypedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);\ntypedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);\ntypedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);\ntypedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);\n#endif\n\n#ifndef GL_APPLE_vertex_array_object\n#define GL_APPLE_vertex_array_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array);\nGLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays);\nGLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays);\nGLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);\ntypedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);\ntypedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);\ntypedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);\n#endif\n\n#ifndef GL_APPLE_vertex_array_range\n#define GL_APPLE_vertex_array_range 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);\nGLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);\nGLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);\n#endif\n\n#ifndef GL_APPLE_ycbcr_422\n#define GL_APPLE_ycbcr_422 1\n#endif\n\n#ifndef GL_S3_s3tc\n#define GL_S3_s3tc 1\n#endif\n\n#ifndef GL_ATI_draw_buffers\n#define GL_ATI_draw_buffers 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);\n#endif\n\n#ifndef GL_ATI_pixel_format_float\n#define GL_ATI_pixel_format_float 1\n/* This is really a WGL extension, but defines some associated GL enums.\n * ATI does not export \"GL_ATI_pixel_format_float\" in the GL_EXTENSIONS string.\n */\n#endif\n\n#ifndef GL_ATI_texture_env_combine3\n#define GL_ATI_texture_env_combine3 1\n#endif\n\n#ifndef GL_ATI_texture_float\n#define GL_ATI_texture_float 1\n#endif\n\n#ifndef GL_NV_float_buffer\n#define GL_NV_float_buffer 1\n#endif\n\n#ifndef GL_NV_fragment_program\n#define GL_NV_fragment_program 1\n/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);\nGLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);\nGLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);\nGLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);\ntypedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);\n#endif\n\n#ifndef GL_NV_half_float\n#define GL_NV_half_float 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y);\nGLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z);\nGLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);\nGLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);\nGLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);\nGLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);\nGLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s);\nGLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t);\nGLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r);\nGLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);\nGLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s);\nGLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v);\nGLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t);\nGLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v);\nGLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);\nGLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v);\nGLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);\nGLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v);\nGLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);\nGLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);\nGLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);\nGLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);\nGLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);\nGLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);\nGLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x);\nGLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v);\nGLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y);\nGLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v);\nGLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);\nGLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v);\nGLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);\nGLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v);\nGLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v);\nGLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v);\nGLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v);\nGLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);\ntypedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);\ntypedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);\ntypedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);\ntypedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);\ntypedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);\ntypedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);\ntypedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);\ntypedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);\ntypedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);\ntypedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);\ntypedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);\ntypedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);\n#endif\n\n#ifndef GL_NV_pixel_data_range\n#define GL_NV_pixel_data_range 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const GLvoid *pointer);\nGLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);\n#endif\n\n#ifndef GL_NV_primitive_restart\n#define GL_NV_primitive_restart 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPrimitiveRestartNV (void);\nGLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);\ntypedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);\n#endif\n\n#ifndef GL_NV_texture_expand_normal\n#define GL_NV_texture_expand_normal 1\n#endif\n\n#ifndef GL_NV_vertex_program2\n#define GL_NV_vertex_program2 1\n#endif\n\n#ifndef GL_ATI_map_object_buffer\n#define GL_ATI_map_object_buffer 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer);\nGLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);\ntypedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);\n#endif\n\n#ifndef GL_ATI_separate_stencil\n#define GL_ATI_separate_stencil 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);\nGLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);\ntypedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);\n#endif\n\n#ifndef GL_ATI_vertex_attrib_array_object\n#define GL_ATI_vertex_attrib_array_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);\nGLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_OES_read_format\n#define GL_OES_read_format 1\n#endif\n\n#ifndef GL_EXT_depth_bounds_test\n#define GL_EXT_depth_bounds_test 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);\n#endif\n\n#ifndef GL_EXT_texture_mirror_clamp\n#define GL_EXT_texture_mirror_clamp 1\n#endif\n\n#ifndef GL_EXT_blend_equation_separate\n#define GL_EXT_blend_equation_separate 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);\n#endif\n\n#ifndef GL_MESA_pack_invert\n#define GL_MESA_pack_invert 1\n#endif\n\n#ifndef GL_MESA_ycbcr_texture\n#define GL_MESA_ycbcr_texture 1\n#endif\n\n#ifndef GL_EXT_pixel_buffer_object\n#define GL_EXT_pixel_buffer_object 1\n#endif\n\n#ifndef GL_NV_fragment_program_option\n#define GL_NV_fragment_program_option 1\n#endif\n\n#ifndef GL_NV_fragment_program2\n#define GL_NV_fragment_program2 1\n#endif\n\n#ifndef GL_NV_vertex_program2_option\n#define GL_NV_vertex_program2_option 1\n#endif\n\n#ifndef GL_NV_vertex_program3\n#define GL_NV_vertex_program3 1\n#endif\n\n#ifndef GL_EXT_framebuffer_object\n#define GL_EXT_framebuffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer);\nGLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer);\nGLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers);\nGLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers);\nGLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params);\nGLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer);\nGLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer);\nGLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers);\nGLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers);\nGLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target);\nGLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\nGLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\nGLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);\nGLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\nGLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGenerateMipmapEXT (GLenum target);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);\ntypedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);\ntypedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);\ntypedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);\ntypedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);\ntypedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);\ntypedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);\n#endif\n\n#ifndef GL_GREMEDY_string_marker\n#define GL_GREMEDY_string_marker 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);\n#endif\n\n#ifndef GL_EXT_packed_depth_stencil\n#define GL_EXT_packed_depth_stencil 1\n#endif\n\n#ifndef GL_EXT_stencil_clear_tag\n#define GL_EXT_stencil_clear_tag 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);\n#endif\n\n#ifndef GL_EXT_texture_sRGB\n#define GL_EXT_texture_sRGB 1\n#endif\n\n#ifndef GL_EXT_framebuffer_blit\n#define GL_EXT_framebuffer_blit 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\n#endif\n\n#ifndef GL_EXT_framebuffer_multisample\n#define GL_EXT_framebuffer_multisample 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\n#endif\n\n#ifndef GL_MESAX_texture_stack\n#define GL_MESAX_texture_stack 1\n#endif\n\n#ifndef GL_EXT_timer_query\n#define GL_EXT_timer_query 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params);\nGLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);\ntypedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);\n#endif\n\n#ifndef GL_EXT_gpu_program_parameters\n#define GL_EXT_gpu_program_parameters 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);\nGLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);\n#endif\n\n#ifndef GL_APPLE_flush_buffer_range\n#define GL_APPLE_flush_buffer_range 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param);\nGLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);\n#endif\n\n#ifndef GL_NV_gpu_program4\n#define GL_NV_gpu_program4 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\nGLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);\nGLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);\nGLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\nGLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);\nGLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);\nGLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\nGLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);\nGLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);\nGLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\nGLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);\nGLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);\nGLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);\nGLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);\nGLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);\nGLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);\n#endif\n\n#ifndef GL_NV_geometry_program4\n#define GL_NV_geometry_program4 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);\nGLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);\nGLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);\nGLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);\n#endif\n\n#ifndef GL_EXT_geometry_shader4\n#define GL_EXT_geometry_shader4 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);\n#endif\n\n#ifndef GL_NV_vertex_program4\n#define GL_NV_vertex_program4 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x);\nGLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y);\nGLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z);\nGLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w);\nGLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x);\nGLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y);\nGLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z);\nGLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\nGLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v);\nGLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v);\nGLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v);\nGLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v);\nGLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v);\nGLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v);\nGLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);\n#endif\n\n#ifndef GL_EXT_gpu_shader4\n#define GL_EXT_gpu_shader4 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);\nGLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);\nGLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);\nGLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);\nGLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);\nGLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);\nGLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\nGLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);\ntypedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);\ntypedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);\ntypedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);\ntypedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);\ntypedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);\ntypedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\ntypedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);\n#endif\n\n#ifndef GL_EXT_draw_instanced\n#define GL_EXT_draw_instanced 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);\nGLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);\ntypedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);\n#endif\n\n#ifndef GL_EXT_packed_float\n#define GL_EXT_packed_float 1\n#endif\n\n#ifndef GL_EXT_texture_array\n#define GL_EXT_texture_array 1\n#endif\n\n#ifndef GL_EXT_texture_buffer_object\n#define GL_EXT_texture_buffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);\n#endif\n\n#ifndef GL_EXT_texture_compression_latc\n#define GL_EXT_texture_compression_latc 1\n#endif\n\n#ifndef GL_EXT_texture_compression_rgtc\n#define GL_EXT_texture_compression_rgtc 1\n#endif\n\n#ifndef GL_EXT_texture_shared_exponent\n#define GL_EXT_texture_shared_exponent 1\n#endif\n\n#ifndef GL_NV_depth_buffer_float\n#define GL_NV_depth_buffer_float 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);\nGLAPI void APIENTRY glClearDepthdNV (GLdouble depth);\nGLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);\ntypedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);\ntypedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);\n#endif\n\n#ifndef GL_NV_fragment_program4\n#define GL_NV_fragment_program4 1\n#endif\n\n#ifndef GL_NV_framebuffer_multisample_coverage\n#define GL_NV_framebuffer_multisample_coverage 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);\n#endif\n\n#ifndef GL_EXT_framebuffer_sRGB\n#define GL_EXT_framebuffer_sRGB 1\n#endif\n\n#ifndef GL_NV_geometry_shader4\n#define GL_NV_geometry_shader4 1\n#endif\n\n#ifndef GL_NV_parameter_buffer_object\n#define GL_NV_parameter_buffer_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);\nGLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);\nGLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);\n#endif\n\n#ifndef GL_EXT_draw_buffers2\n#define GL_EXT_draw_buffers2 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);\nGLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data);\nGLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data);\nGLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index);\nGLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index);\nGLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);\ntypedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);\ntypedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);\ntypedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);\ntypedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);\ntypedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);\n#endif\n\n#ifndef GL_NV_transform_feedback\n#define GL_NV_transform_feedback 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);\nGLAPI void APIENTRY glEndTransformFeedbackNV (void);\nGLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);\nGLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\nGLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);\nGLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);\nGLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);\nGLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);\nGLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);\nGLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);\nGLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);\nGLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);\ntypedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);\ntypedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);\ntypedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\ntypedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);\ntypedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);\ntypedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);\ntypedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);\ntypedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);\ntypedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);\ntypedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);\ntypedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);\n#endif\n\n#ifndef GL_EXT_bindable_uniform\n#define GL_EXT_bindable_uniform 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);\nGLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);\nGLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);\ntypedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);\ntypedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);\n#endif\n\n#ifndef GL_EXT_texture_integer\n#define GL_EXT_texture_integer 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);\nGLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);\nGLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);\nGLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);\ntypedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);\ntypedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);\ntypedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);\n#endif\n\n#ifndef GL_GREMEDY_frame_terminator\n#define GL_GREMEDY_frame_terminator 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glFrameTerminatorGREMEDY (void);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);\n#endif\n\n#ifndef GL_NV_conditional_render\n#define GL_NV_conditional_render 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);\nGLAPI void APIENTRY glEndConditionalRenderNV (void);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);\ntypedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);\n#endif\n\n#ifndef GL_NV_present_video\n#define GL_NV_present_video 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);\nGLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);\nGLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params);\nGLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params);\nGLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);\ntypedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);\ntypedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);\ntypedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);\ntypedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);\n#endif\n\n#ifndef GL_EXT_transform_feedback\n#define GL_EXT_transform_feedback 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode);\nGLAPI void APIENTRY glEndTransformFeedbackEXT (void);\nGLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\nGLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset);\nGLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer);\nGLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);\nGLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);\ntypedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);\ntypedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\ntypedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);\ntypedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);\ntypedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);\ntypedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);\n#endif\n\n#ifndef GL_EXT_direct_state_access\n#define GL_EXT_direct_state_access 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask);\nGLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask);\nGLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);\nGLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);\nGLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);\nGLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);\nGLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode);\nGLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);\nGLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);\nGLAPI void APIENTRY glMatrixPopEXT (GLenum mode);\nGLAPI void APIENTRY glMatrixPushEXT (GLenum mode);\nGLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);\nGLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);\nGLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);\nGLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);\nGLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param);\nGLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\nGLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\nGLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\nGLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);\nGLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);\nGLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);\nGLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\nGLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\nGLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\nGLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);\nGLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);\nGLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture);\nGLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index);\nGLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index);\nGLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);\nGLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);\nGLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);\nGLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);\nGLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param);\nGLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);\nGLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data);\nGLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data);\nGLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data);\nGLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img);\nGLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);\nGLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img);\nGLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);\nGLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params);\nGLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params);\nGLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params);\nGLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params);\nGLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string);\nGLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);\nGLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\nGLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params);\nGLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);\nGLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\nGLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params);\nGLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);\nGLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params);\nGLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params);\nGLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params);\nGLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params);\nGLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);\nGLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params);\nGLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);\nGLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);\nGLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\nGLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\nGLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);\nGLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);\nGLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);\nGLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\nGLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);\nGLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\nGLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);\nGLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);\nGLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);\nGLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\nGLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);\nGLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);\nGLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);\nGLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access);\nGLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer);\nGLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);\nGLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length);\nGLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);\nGLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params);\nGLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);\nGLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);\nGLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);\nGLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params);\nGLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target);\nGLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\nGLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\nGLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);\nGLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\nGLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target);\nGLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target);\nGLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode);\nGLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs);\nGLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode);\nGLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);\nGLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);\nGLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);\nGLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);\nGLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);\nGLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer);\nGLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer);\nGLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x);\nGLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y);\nGLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\nGLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);\ntypedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);\ntypedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);\ntypedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);\ntypedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);\ntypedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);\ntypedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);\ntypedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);\ntypedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);\ntypedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);\ntypedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);\ntypedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);\ntypedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);\ntypedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);\ntypedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);\ntypedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\ntypedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\ntypedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\ntypedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\ntypedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\ntypedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\ntypedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);\ntypedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);\ntypedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);\ntypedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);\ntypedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);\ntypedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);\ntypedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);\ntypedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data);\ntypedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data);\ntypedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);\ntypedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params);\ntypedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params);\ntypedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params);\ntypedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params);\ntypedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);\ntypedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);\ntypedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);\ntypedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);\ntypedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);\ntypedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);\ntypedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);\ntypedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);\ntypedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);\ntypedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);\ntypedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);\ntypedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params);\ntypedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);\ntypedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);\ntypedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);\ntypedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);\ntypedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);\ntypedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);\ntypedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);\ntypedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);\ntypedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);\n#endif\n\n#ifndef GL_EXT_vertex_array_bgra\n#define GL_EXT_vertex_array_bgra 1\n#endif\n\n#ifndef GL_EXT_texture_swizzle\n#define GL_EXT_texture_swizzle 1\n#endif\n\n#ifndef GL_NV_explicit_multisample\n#define GL_NV_explicit_multisample 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val);\nGLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask);\nGLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val);\ntypedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);\ntypedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);\n#endif\n\n#ifndef GL_NV_transform_feedback2\n#define GL_NV_transform_feedback2 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id);\nGLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids);\nGLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids);\nGLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id);\nGLAPI void APIENTRY glPauseTransformFeedbackNV (void);\nGLAPI void APIENTRY glResumeTransformFeedbackNV (void);\nGLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);\ntypedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids);\ntypedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids);\ntypedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);\ntypedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);\ntypedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);\ntypedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);\n#endif\n\n#ifndef GL_ATI_meminfo\n#define GL_ATI_meminfo 1\n#endif\n\n#ifndef GL_AMD_performance_monitor\n#define GL_AMD_performance_monitor 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);\nGLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);\nGLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);\nGLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);\nGLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);\nGLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);\nGLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);\nGLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);\nGLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor);\nGLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor);\nGLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);\ntypedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);\ntypedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);\ntypedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);\ntypedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);\ntypedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);\ntypedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);\ntypedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);\ntypedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);\ntypedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);\ntypedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);\n#endif\n\n#ifndef GL_AMD_texture_texture4\n#define GL_AMD_texture_texture4 1\n#endif\n\n#ifndef GL_AMD_vertex_shader_tesselator\n#define GL_AMD_vertex_shader_tesselator 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor);\nGLAPI void APIENTRY glTessellationModeAMD (GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);\ntypedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);\n#endif\n\n#ifndef GL_EXT_provoking_vertex\n#define GL_EXT_provoking_vertex 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProvokingVertexEXT (GLenum mode);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);\n#endif\n\n#ifndef GL_EXT_texture_snorm\n#define GL_EXT_texture_snorm 1\n#endif\n\n#ifndef GL_AMD_draw_buffers_blend\n#define GL_AMD_draw_buffers_blend 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst);\nGLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\nGLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode);\nGLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);\ntypedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);\ntypedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\n#endif\n\n#ifndef GL_APPLE_texture_range\n#define GL_APPLE_texture_range 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer);\nGLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params);\n#endif\n\n#ifndef GL_APPLE_float_pixels\n#define GL_APPLE_float_pixels 1\n#endif\n\n#ifndef GL_APPLE_vertex_program_evaluators\n#define GL_APPLE_vertex_program_evaluators 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname);\nGLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname);\nGLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname);\nGLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);\nGLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);\nGLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);\nGLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);\ntypedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);\ntypedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);\ntypedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);\ntypedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);\ntypedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);\ntypedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);\n#endif\n\n#ifndef GL_APPLE_aux_depth_stencil\n#define GL_APPLE_aux_depth_stencil 1\n#endif\n\n#ifndef GL_APPLE_object_purgeable\n#define GL_APPLE_object_purgeable 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);\nGLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);\nGLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);\ntypedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);\ntypedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params);\n#endif\n\n#ifndef GL_APPLE_row_bytes\n#define GL_APPLE_row_bytes 1\n#endif\n\n#ifndef GL_APPLE_rgb_422\n#define GL_APPLE_rgb_422 1\n#endif\n\n#ifndef GL_NV_video_capture\n#define GL_NV_video_capture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot);\nGLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);\nGLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);\nGLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot);\nGLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);\nGLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);\nGLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);\nGLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);\nGLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);\nGLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);\nGLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);\ntypedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);\ntypedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);\ntypedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);\ntypedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);\ntypedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);\ntypedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);\ntypedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);\ntypedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);\ntypedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);\ntypedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);\n#endif\n\n#ifndef GL_NV_copy_image\n#define GL_NV_copy_image 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n#endif\n\n#ifndef GL_EXT_separate_shader_objects\n#define GL_EXT_separate_shader_objects 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);\nGLAPI void APIENTRY glActiveProgramEXT (GLuint program);\nGLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);\ntypedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);\ntypedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);\n#endif\n\n#ifndef GL_NV_parameter_buffer_object2\n#define GL_NV_parameter_buffer_object2 1\n#endif\n\n#ifndef GL_NV_shader_buffer_load\n#define GL_NV_shader_buffer_load 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access);\nGLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target);\nGLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target);\nGLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access);\nGLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer);\nGLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer);\nGLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params);\nGLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params);\nGLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);\nGLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);\nGLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);\nGLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);\nGLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);\nGLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);\ntypedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);\ntypedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);\ntypedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);\ntypedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);\ntypedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);\ntypedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);\ntypedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);\ntypedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);\ntypedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);\ntypedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);\ntypedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\n#endif\n\n#ifndef GL_NV_vertex_buffer_unified_memory\n#define GL_NV_vertex_buffer_unified_memory 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);\nGLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride);\nGLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride);\nGLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride);\nGLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride);\nGLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride);\nGLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride);\nGLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride);\nGLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride);\nGLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);\nGLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);\nGLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);\ntypedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);\ntypedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);\ntypedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);\ntypedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);\ntypedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);\ntypedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);\ntypedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);\ntypedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);\ntypedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);\n#endif\n\n#ifndef GL_NV_texture_barrier\n#define GL_NV_texture_barrier 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTextureBarrierNV (void);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);\n#endif\n\n#ifndef GL_AMD_shader_stencil_export\n#define GL_AMD_shader_stencil_export 1\n#endif\n\n#ifndef GL_AMD_seamless_cubemap_per_texture\n#define GL_AMD_seamless_cubemap_per_texture 1\n#endif\n\n#ifndef GL_AMD_conservative_depth\n#define GL_AMD_conservative_depth 1\n#endif\n\n#ifndef GL_EXT_shader_image_load_store\n#define GL_EXT_shader_image_load_store 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);\nGLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);\ntypedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);\n#endif\n\n#ifndef GL_EXT_vertex_attrib_64bit\n#define GL_EXT_vertex_attrib_64bit 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x);\nGLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y);\nGLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v);\nGLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params);\nGLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params);\ntypedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);\n#endif\n\n#ifndef GL_NV_gpu_program5\n#define GL_NV_gpu_program5 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params);\nGLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params);\ntypedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param);\n#endif\n\n#ifndef GL_NV_gpu_shader5\n#define GL_NV_gpu_shader5 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);\nGLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);\nGLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);\nGLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\nGLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);\nGLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);\nGLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);\nGLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);\nGLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);\nGLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);\nGLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\nGLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\nGLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);\nGLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);\nGLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);\nGLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);\nGLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);\nGLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);\nGLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);\nGLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);\nGLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\nGLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);\nGLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);\nGLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);\nGLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);\nGLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);\nGLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);\nGLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\nGLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\nGLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\nGLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\nGLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\nGLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);\ntypedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);\ntypedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);\ntypedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\ntypedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);\ntypedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);\ntypedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);\ntypedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\ntypedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\ntypedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);\ntypedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);\ntypedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);\ntypedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);\ntypedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);\n#endif\n\n#ifndef GL_NV_shader_buffer_store\n#define GL_NV_shader_buffer_store 1\n#endif\n\n#ifndef GL_NV_tessellation_program5\n#define GL_NV_tessellation_program5 1\n#endif\n\n#ifndef GL_NV_vertex_attrib_integer_64bit\n#define GL_NV_vertex_attrib_integer_64bit 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x);\nGLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y);\nGLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);\nGLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\nGLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v);\nGLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v);\nGLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v);\nGLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v);\nGLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x);\nGLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y);\nGLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\nGLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\nGLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v);\nGLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v);\nGLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v);\nGLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v);\nGLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params);\nGLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params);\nGLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params);\ntypedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params);\ntypedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);\n#endif\n\n#ifndef GL_NV_multisample_coverage\n#define GL_NV_multisample_coverage 1\n#endif\n\n#ifndef GL_AMD_name_gen_delete\n#define GL_AMD_name_gen_delete 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names);\nGLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names);\nGLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names);\ntypedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names);\ntypedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);\n#endif\n\n#ifndef GL_AMD_debug_output\n#define GL_AMD_debug_output 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);\nGLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);\nGLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam);\nGLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);\ntypedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam);\ntypedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);\n#endif\n\n#ifndef GL_NV_vdpau_interop\n#define GL_NV_vdpau_interop 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress);\nGLAPI void APIENTRY glVDPAUFiniNV (void);\nGLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);\nGLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);\nGLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);\nGLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);\nGLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);\nGLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);\nGLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);\nGLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress);\ntypedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);\ntypedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);\ntypedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);\ntypedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);\ntypedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);\ntypedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);\ntypedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);\ntypedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);\ntypedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);\n#endif\n\n#ifndef GL_AMD_transform_feedback3_lines_triangles\n#define GL_AMD_transform_feedback3_lines_triangles 1\n#endif\n\n#ifndef GL_AMD_depth_clamp_separate\n#define GL_AMD_depth_clamp_separate 1\n#endif\n\n#ifndef GL_EXT_texture_sRGB_decode\n#define GL_EXT_texture_sRGB_decode 1\n#endif\n\n#ifndef GL_NV_texture_multisample\n#define GL_NV_texture_multisample 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\nGLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\nGLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\nGLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\nGLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\nGLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\ntypedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\ntypedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\ntypedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\ntypedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\ntypedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\n#endif\n\n#ifndef GL_AMD_blend_minmax_factor\n#define GL_AMD_blend_minmax_factor 1\n#endif\n\n#ifndef GL_AMD_sample_positions\n#define GL_AMD_sample_positions 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);\n#endif\n\n#ifndef GL_EXT_x11_sync_object\n#define GL_EXT_x11_sync_object 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);\n#endif\n\n#ifndef GL_AMD_multi_draw_indirect\n#define GL_AMD_multi_draw_indirect 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);\nGLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);\ntypedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);\n#endif\n\n#ifndef GL_EXT_framebuffer_multisample_blit_scaled\n#define GL_EXT_framebuffer_multisample_blit_scaled 1\n#endif\n\n#ifndef GL_NV_path_rendering\n#define GL_NV_path_rendering 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLuint APIENTRY glGenPathsNV (GLsizei range);\nGLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range);\nGLAPI GLboolean APIENTRY glIsPathNV (GLuint path);\nGLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords);\nGLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords);\nGLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords);\nGLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords);\nGLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString);\nGLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);\nGLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);\nGLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);\nGLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath);\nGLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);\nGLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);\nGLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value);\nGLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value);\nGLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value);\nGLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value);\nGLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray);\nGLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask);\nGLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units);\nGLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask);\nGLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask);\nGLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);\nGLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);\nGLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func);\nGLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);\nGLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);\nGLAPI void APIENTRY glPathFogGenNV (GLenum genMode);\nGLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode);\nGLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode);\nGLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);\nGLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);\nGLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value);\nGLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value);\nGLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands);\nGLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords);\nGLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray);\nGLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);\nGLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);\nGLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);\nGLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value);\nGLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value);\nGLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value);\nGLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value);\nGLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y);\nGLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y);\nGLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments);\nGLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range);\ntypedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);\ntypedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path);\ntypedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords);\ntypedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords);\ntypedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords);\ntypedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords);\ntypedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString);\ntypedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);\ntypedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);\ntypedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);\ntypedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);\ntypedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);\ntypedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);\ntypedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value);\ntypedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);\ntypedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value);\ntypedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);\ntypedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray);\ntypedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);\ntypedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units);\ntypedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);\ntypedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);\ntypedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);\ntypedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);\ntypedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func);\ntypedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);\ntypedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);\ntypedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode);\ntypedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);\ntypedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode);\ntypedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);\ntypedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);\ntypedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value);\ntypedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value);\ntypedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands);\ntypedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords);\ntypedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray);\ntypedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);\ntypedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);\ntypedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);\ntypedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value);\ntypedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value);\ntypedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value);\ntypedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value);\ntypedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);\ntypedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);\ntypedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);\ntypedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);\n#endif\n\n#ifndef GL_AMD_pinned_memory\n#define GL_AMD_pinned_memory 1\n#endif\n\n#ifndef GL_AMD_stencil_operation_extended\n#define GL_AMD_stencil_operation_extended 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value);\n#endif\n\n#ifndef GL_AMD_vertex_shader_viewport_index\n#define GL_AMD_vertex_shader_viewport_index 1\n#endif\n\n#ifndef GL_AMD_vertex_shader_layer\n#define GL_AMD_vertex_shader_layer 1\n#endif\n\n#ifndef GL_NV_bindless_texture\n#define GL_NV_bindless_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture);\nGLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler);\nGLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle);\nGLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle);\nGLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);\nGLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access);\nGLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle);\nGLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value);\nGLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value);\nGLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value);\nGLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values);\nGLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle);\nGLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture);\ntypedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler);\ntypedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);\ntypedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle);\ntypedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);\ntypedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access);\ntypedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle);\ntypedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value);\ntypedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value);\ntypedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);\ntypedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);\ntypedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle);\n#endif\n\n#ifndef GL_NV_shader_atomic_float\n#define GL_NV_shader_atomic_float 1\n#endif\n\n#ifndef GL_AMD_query_buffer_object\n#define GL_AMD_query_buffer_object 1\n#endif\n\n#ifndef GL_AMD_sparse_texture\n#define GL_AMD_sparse_texture 1\n#ifdef GL_GLEXT_PROTOTYPES\nGLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);\nGLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);\n#endif /* GL_GLEXT_PROTOTYPES */\ntypedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);\ntypedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);\n#endif\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "tests/3rdparty/glfw/deps/GL/glxext.h",
    "content": "#ifndef __glxext_h_\n#define __glxext_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n** Copyright (c) 2007-2012 The Khronos Group Inc.\n** \n** Permission is hereby granted, free of charge, to any person obtaining a\n** copy of this software and/or associated documentation files (the\n** \"Materials\"), to deal in the Materials without restriction, including\n** without limitation the rights to use, copy, modify, merge, publish,\n** distribute, sublicense, and/or sell copies of the Materials, and to\n** permit persons to whom the Materials are furnished to do so, subject to\n** the following conditions:\n** \n** The above copyright notice and this permission notice shall be included\n** in all copies or substantial portions of the Materials.\n** \n** THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n*/\n\n/* Function declaration macros - to move into glplatform.h */\n\n#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)\n#define WIN32_LEAN_AND_MEAN 1\n#include <windows.h>\n#endif\n\n#ifndef APIENTRY\n#define APIENTRY\n#endif\n#ifndef APIENTRYP\n#define APIENTRYP APIENTRY *\n#endif\n#ifndef GLAPI\n#define GLAPI extern\n#endif\n\n/*************************************************************/\n\n/* Header file version number, required by OpenGL ABI for Linux */\n/* glxext.h last updated 2012/02/29 */\n/* Current version at http://www.opengl.org/registry/ */\n#define GLX_GLXEXT_VERSION 33\n\n#ifndef GLX_VERSION_1_3\n#define GLX_WINDOW_BIT                     0x00000001\n#define GLX_PIXMAP_BIT                     0x00000002\n#define GLX_PBUFFER_BIT                    0x00000004\n#define GLX_RGBA_BIT                       0x00000001\n#define GLX_COLOR_INDEX_BIT                0x00000002\n#define GLX_PBUFFER_CLOBBER_MASK           0x08000000\n#define GLX_FRONT_LEFT_BUFFER_BIT          0x00000001\n#define GLX_FRONT_RIGHT_BUFFER_BIT         0x00000002\n#define GLX_BACK_LEFT_BUFFER_BIT           0x00000004\n#define GLX_BACK_RIGHT_BUFFER_BIT          0x00000008\n#define GLX_AUX_BUFFERS_BIT                0x00000010\n#define GLX_DEPTH_BUFFER_BIT               0x00000020\n#define GLX_STENCIL_BUFFER_BIT             0x00000040\n#define GLX_ACCUM_BUFFER_BIT               0x00000080\n#define GLX_CONFIG_CAVEAT                  0x20\n#define GLX_X_VISUAL_TYPE                  0x22\n#define GLX_TRANSPARENT_TYPE               0x23\n#define GLX_TRANSPARENT_INDEX_VALUE        0x24\n#define GLX_TRANSPARENT_RED_VALUE          0x25\n#define GLX_TRANSPARENT_GREEN_VALUE        0x26\n#define GLX_TRANSPARENT_BLUE_VALUE         0x27\n#define GLX_TRANSPARENT_ALPHA_VALUE        0x28\n#define GLX_DONT_CARE                      0xFFFFFFFF\n#define GLX_NONE                           0x8000\n#define GLX_SLOW_CONFIG                    0x8001\n#define GLX_TRUE_COLOR                     0x8002\n#define GLX_DIRECT_COLOR                   0x8003\n#define GLX_PSEUDO_COLOR                   0x8004\n#define GLX_STATIC_COLOR                   0x8005\n#define GLX_GRAY_SCALE                     0x8006\n#define GLX_STATIC_GRAY                    0x8007\n#define GLX_TRANSPARENT_RGB                0x8008\n#define GLX_TRANSPARENT_INDEX              0x8009\n#define GLX_VISUAL_ID                      0x800B\n#define GLX_SCREEN                         0x800C\n#define GLX_NON_CONFORMANT_CONFIG          0x800D\n#define GLX_DRAWABLE_TYPE                  0x8010\n#define GLX_RENDER_TYPE                    0x8011\n#define GLX_X_RENDERABLE                   0x8012\n#define GLX_FBCONFIG_ID                    0x8013\n#define GLX_RGBA_TYPE                      0x8014\n#define GLX_COLOR_INDEX_TYPE               0x8015\n#define GLX_MAX_PBUFFER_WIDTH              0x8016\n#define GLX_MAX_PBUFFER_HEIGHT             0x8017\n#define GLX_MAX_PBUFFER_PIXELS             0x8018\n#define GLX_PRESERVED_CONTENTS             0x801B\n#define GLX_LARGEST_PBUFFER                0x801C\n#define GLX_WIDTH                          0x801D\n#define GLX_HEIGHT                         0x801E\n#define GLX_EVENT_MASK                     0x801F\n#define GLX_DAMAGED                        0x8020\n#define GLX_SAVED                          0x8021\n#define GLX_WINDOW                         0x8022\n#define GLX_PBUFFER                        0x8023\n#define GLX_PBUFFER_HEIGHT                 0x8040\n#define GLX_PBUFFER_WIDTH                  0x8041\n#endif\n\n#ifndef GLX_VERSION_1_4\n#define GLX_SAMPLE_BUFFERS                 100000\n#define GLX_SAMPLES                        100001\n#endif\n\n#ifndef GLX_ARB_get_proc_address\n#endif\n\n#ifndef GLX_ARB_multisample\n#define GLX_SAMPLE_BUFFERS_ARB             100000\n#define GLX_SAMPLES_ARB                    100001\n#endif\n\n#ifndef GLX_ARB_vertex_buffer_object\n#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095\n#endif\n\n#ifndef GLX_ARB_fbconfig_float\n#define GLX_RGBA_FLOAT_TYPE_ARB            0x20B9\n#define GLX_RGBA_FLOAT_BIT_ARB             0x00000004\n#endif\n\n#ifndef GLX_ARB_framebuffer_sRGB\n#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB   0x20B2\n#endif\n\n#ifndef GLX_ARB_create_context\n#define GLX_CONTEXT_DEBUG_BIT_ARB          0x00000001\n#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002\n#define GLX_CONTEXT_MAJOR_VERSION_ARB      0x2091\n#define GLX_CONTEXT_MINOR_VERSION_ARB      0x2092\n#define GLX_CONTEXT_FLAGS_ARB              0x2094\n#endif\n\n#ifndef GLX_ARB_create_context_profile\n#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB   0x00000001\n#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002\n#define GLX_CONTEXT_PROFILE_MASK_ARB       0x9126\n#endif\n\n#ifndef GLX_ARB_create_context_robustness\n#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB  0x00000004\n#define GLX_LOSE_CONTEXT_ON_RESET_ARB      0x8252\n#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256\n#define GLX_NO_RESET_NOTIFICATION_ARB      0x8261\n#endif\n\n#ifndef GLX_SGIS_multisample\n#define GLX_SAMPLE_BUFFERS_SGIS            100000\n#define GLX_SAMPLES_SGIS                   100001\n#endif\n\n#ifndef GLX_EXT_visual_info\n#define GLX_X_VISUAL_TYPE_EXT              0x22\n#define GLX_TRANSPARENT_TYPE_EXT           0x23\n#define GLX_TRANSPARENT_INDEX_VALUE_EXT    0x24\n#define GLX_TRANSPARENT_RED_VALUE_EXT      0x25\n#define GLX_TRANSPARENT_GREEN_VALUE_EXT    0x26\n#define GLX_TRANSPARENT_BLUE_VALUE_EXT     0x27\n#define GLX_TRANSPARENT_ALPHA_VALUE_EXT    0x28\n#define GLX_NONE_EXT                       0x8000\n#define GLX_TRUE_COLOR_EXT                 0x8002\n#define GLX_DIRECT_COLOR_EXT               0x8003\n#define GLX_PSEUDO_COLOR_EXT               0x8004\n#define GLX_STATIC_COLOR_EXT               0x8005\n#define GLX_GRAY_SCALE_EXT                 0x8006\n#define GLX_STATIC_GRAY_EXT                0x8007\n#define GLX_TRANSPARENT_RGB_EXT            0x8008\n#define GLX_TRANSPARENT_INDEX_EXT          0x8009\n#endif\n\n#ifndef GLX_SGI_swap_control\n#endif\n\n#ifndef GLX_SGI_video_sync\n#endif\n\n#ifndef GLX_SGI_make_current_read\n#endif\n\n#ifndef GLX_SGIX_video_source\n#endif\n\n#ifndef GLX_EXT_visual_rating\n#define GLX_VISUAL_CAVEAT_EXT              0x20\n#define GLX_SLOW_VISUAL_EXT                0x8001\n#define GLX_NON_CONFORMANT_VISUAL_EXT      0x800D\n/* reuse GLX_NONE_EXT */\n#endif\n\n#ifndef GLX_EXT_import_context\n#define GLX_SHARE_CONTEXT_EXT              0x800A\n#define GLX_VISUAL_ID_EXT                  0x800B\n#define GLX_SCREEN_EXT                     0x800C\n#endif\n\n#ifndef GLX_SGIX_fbconfig\n#define GLX_WINDOW_BIT_SGIX                0x00000001\n#define GLX_PIXMAP_BIT_SGIX                0x00000002\n#define GLX_RGBA_BIT_SGIX                  0x00000001\n#define GLX_COLOR_INDEX_BIT_SGIX           0x00000002\n#define GLX_DRAWABLE_TYPE_SGIX             0x8010\n#define GLX_RENDER_TYPE_SGIX               0x8011\n#define GLX_X_RENDERABLE_SGIX              0x8012\n#define GLX_FBCONFIG_ID_SGIX               0x8013\n#define GLX_RGBA_TYPE_SGIX                 0x8014\n#define GLX_COLOR_INDEX_TYPE_SGIX          0x8015\n/* reuse GLX_SCREEN_EXT */\n#endif\n\n#ifndef GLX_SGIX_pbuffer\n#define GLX_PBUFFER_BIT_SGIX               0x00000004\n#define GLX_BUFFER_CLOBBER_MASK_SGIX       0x08000000\n#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX     0x00000001\n#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX    0x00000002\n#define GLX_BACK_LEFT_BUFFER_BIT_SGIX      0x00000004\n#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX     0x00000008\n#define GLX_AUX_BUFFERS_BIT_SGIX           0x00000010\n#define GLX_DEPTH_BUFFER_BIT_SGIX          0x00000020\n#define GLX_STENCIL_BUFFER_BIT_SGIX        0x00000040\n#define GLX_ACCUM_BUFFER_BIT_SGIX          0x00000080\n#define GLX_SAMPLE_BUFFERS_BIT_SGIX        0x00000100\n#define GLX_MAX_PBUFFER_WIDTH_SGIX         0x8016\n#define GLX_MAX_PBUFFER_HEIGHT_SGIX        0x8017\n#define GLX_MAX_PBUFFER_PIXELS_SGIX        0x8018\n#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX     0x8019\n#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX    0x801A\n#define GLX_PRESERVED_CONTENTS_SGIX        0x801B\n#define GLX_LARGEST_PBUFFER_SGIX           0x801C\n#define GLX_WIDTH_SGIX                     0x801D\n#define GLX_HEIGHT_SGIX                    0x801E\n#define GLX_EVENT_MASK_SGIX                0x801F\n#define GLX_DAMAGED_SGIX                   0x8020\n#define GLX_SAVED_SGIX                     0x8021\n#define GLX_WINDOW_SGIX                    0x8022\n#define GLX_PBUFFER_SGIX                   0x8023\n#endif\n\n#ifndef GLX_SGI_cushion\n#endif\n\n#ifndef GLX_SGIX_video_resize\n#define GLX_SYNC_FRAME_SGIX                0x00000000\n#define GLX_SYNC_SWAP_SGIX                 0x00000001\n#endif\n\n#ifndef GLX_SGIX_dmbuffer\n#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX     0x8024\n#endif\n\n#ifndef GLX_SGIX_swap_group\n#endif\n\n#ifndef GLX_SGIX_swap_barrier\n#endif\n\n#ifndef GLX_SGIS_blended_overlay\n#define GLX_BLENDED_RGBA_SGIS              0x8025\n#endif\n\n#ifndef GLX_SGIS_shared_multisample\n#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026\n#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027\n#endif\n\n#ifndef GLX_SUN_get_transparent_index\n#endif\n\n#ifndef GLX_3DFX_multisample\n#define GLX_SAMPLE_BUFFERS_3DFX            0x8050\n#define GLX_SAMPLES_3DFX                   0x8051\n#endif\n\n#ifndef GLX_MESA_copy_sub_buffer\n#endif\n\n#ifndef GLX_MESA_pixmap_colormap\n#endif\n\n#ifndef GLX_MESA_release_buffers\n#endif\n\n#ifndef GLX_MESA_set_3dfx_mode\n#define GLX_3DFX_WINDOW_MODE_MESA          0x1\n#define GLX_3DFX_FULLSCREEN_MODE_MESA      0x2\n#endif\n\n#ifndef GLX_SGIX_visual_select_group\n#define GLX_VISUAL_SELECT_GROUP_SGIX       0x8028\n#endif\n\n#ifndef GLX_OML_swap_method\n#define GLX_SWAP_METHOD_OML                0x8060\n#define GLX_SWAP_EXCHANGE_OML              0x8061\n#define GLX_SWAP_COPY_OML                  0x8062\n#define GLX_SWAP_UNDEFINED_OML             0x8063\n#endif\n\n#ifndef GLX_OML_sync_control\n#endif\n\n#ifndef GLX_NV_float_buffer\n#define GLX_FLOAT_COMPONENTS_NV            0x20B0\n#endif\n\n#ifndef GLX_SGIX_hyperpipe\n#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80\n#define GLX_BAD_HYPERPIPE_CONFIG_SGIX      91\n#define GLX_BAD_HYPERPIPE_SGIX             92\n#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX    0x00000001\n#define GLX_HYPERPIPE_RENDER_PIPE_SGIX     0x00000002\n#define GLX_PIPE_RECT_SGIX                 0x00000001\n#define GLX_PIPE_RECT_LIMITS_SGIX          0x00000002\n#define GLX_HYPERPIPE_STEREO_SGIX          0x00000003\n#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX   0x00000004\n#define GLX_HYPERPIPE_ID_SGIX              0x8030\n#endif\n\n#ifndef GLX_MESA_agp_offset\n#endif\n\n#ifndef GLX_EXT_fbconfig_packed_float\n#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT   0x20B1\n#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT    0x00000008\n#endif\n\n#ifndef GLX_EXT_framebuffer_sRGB\n#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT   0x20B2\n#endif\n\n#ifndef GLX_EXT_texture_from_pixmap\n#define GLX_TEXTURE_1D_BIT_EXT             0x00000001\n#define GLX_TEXTURE_2D_BIT_EXT             0x00000002\n#define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004\n#define GLX_BIND_TO_TEXTURE_RGB_EXT        0x20D0\n#define GLX_BIND_TO_TEXTURE_RGBA_EXT       0x20D1\n#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT     0x20D2\n#define GLX_BIND_TO_TEXTURE_TARGETS_EXT    0x20D3\n#define GLX_Y_INVERTED_EXT                 0x20D4\n#define GLX_TEXTURE_FORMAT_EXT             0x20D5\n#define GLX_TEXTURE_TARGET_EXT             0x20D6\n#define GLX_MIPMAP_TEXTURE_EXT             0x20D7\n#define GLX_TEXTURE_FORMAT_NONE_EXT        0x20D8\n#define GLX_TEXTURE_FORMAT_RGB_EXT         0x20D9\n#define GLX_TEXTURE_FORMAT_RGBA_EXT        0x20DA\n#define GLX_TEXTURE_1D_EXT                 0x20DB\n#define GLX_TEXTURE_2D_EXT                 0x20DC\n#define GLX_TEXTURE_RECTANGLE_EXT          0x20DD\n#define GLX_FRONT_LEFT_EXT                 0x20DE\n#define GLX_FRONT_RIGHT_EXT                0x20DF\n#define GLX_BACK_LEFT_EXT                  0x20E0\n#define GLX_BACK_RIGHT_EXT                 0x20E1\n#define GLX_FRONT_EXT                      GLX_FRONT_LEFT_EXT\n#define GLX_BACK_EXT                       GLX_BACK_LEFT_EXT\n#define GLX_AUX0_EXT                       0x20E2\n#define GLX_AUX1_EXT                       0x20E3\n#define GLX_AUX2_EXT                       0x20E4\n#define GLX_AUX3_EXT                       0x20E5\n#define GLX_AUX4_EXT                       0x20E6\n#define GLX_AUX5_EXT                       0x20E7\n#define GLX_AUX6_EXT                       0x20E8\n#define GLX_AUX7_EXT                       0x20E9\n#define GLX_AUX8_EXT                       0x20EA\n#define GLX_AUX9_EXT                       0x20EB\n#endif\n\n#ifndef GLX_NV_present_video\n#define GLX_NUM_VIDEO_SLOTS_NV             0x20F0\n#endif\n\n#ifndef GLX_NV_video_out\n#define GLX_VIDEO_OUT_COLOR_NV             0x20C3\n#define GLX_VIDEO_OUT_ALPHA_NV             0x20C4\n#define GLX_VIDEO_OUT_DEPTH_NV             0x20C5\n#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV   0x20C6\n#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV   0x20C7\n#define GLX_VIDEO_OUT_FRAME_NV             0x20C8\n#define GLX_VIDEO_OUT_FIELD_1_NV           0x20C9\n#define GLX_VIDEO_OUT_FIELD_2_NV           0x20CA\n#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB\n#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC\n#endif\n\n#ifndef GLX_NV_swap_group\n#endif\n\n#ifndef GLX_NV_video_capture\n#define GLX_DEVICE_ID_NV                   0x20CD\n#define GLX_UNIQUE_ID_NV                   0x20CE\n#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV     0x20CF\n#endif\n\n#ifndef GLX_EXT_swap_control\n#define GLX_SWAP_INTERVAL_EXT              0x20F1\n#define GLX_MAX_SWAP_INTERVAL_EXT          0x20F2\n#endif\n\n#ifndef GLX_NV_copy_image\n#endif\n\n#ifndef GLX_INTEL_swap_event\n#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000\n#define GLX_EXCHANGE_COMPLETE_INTEL        0x8180\n#define GLX_COPY_COMPLETE_INTEL            0x8181\n#define GLX_FLIP_COMPLETE_INTEL            0x8182\n#endif\n\n#ifndef GLX_NV_multisample_coverage\n#define GLX_COVERAGE_SAMPLES_NV            100001\n#define GLX_COLOR_SAMPLES_NV               0x20B3\n#endif\n\n#ifndef GLX_AMD_gpu_association\n#define GLX_GPU_VENDOR_AMD                 0x1F00\n#define GLX_GPU_RENDERER_STRING_AMD        0x1F01\n#define GLX_GPU_OPENGL_VERSION_STRING_AMD  0x1F02\n#define GLX_GPU_FASTEST_TARGET_GPUS_AMD    0x21A2\n#define GLX_GPU_RAM_AMD                    0x21A3\n#define GLX_GPU_CLOCK_AMD                  0x21A4\n#define GLX_GPU_NUM_PIPES_AMD              0x21A5\n#define GLX_GPU_NUM_SIMD_AMD               0x21A6\n#define GLX_GPU_NUM_RB_AMD                 0x21A7\n#define GLX_GPU_NUM_SPI_AMD                0x21A8\n#endif\n\n#ifndef GLX_EXT_create_context_es2_profile\n#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT    0x00000004\n#endif\n\n#ifndef GLX_EXT_swap_control_tear\n#define GLX_LATE_SWAPS_TEAR_EXT            0x20F3\n#endif\n\n#ifndef GLX_EXT_buffer_age\n#define GLX_BACK_BUFFER_AGE_EXT            0x20F4\n#endif\n\n\n/*************************************************************/\n\n#ifndef GLX_ARB_get_proc_address\ntypedef void (*__GLXextFuncPtr)(void);\n#endif\n\n#ifndef GLX_SGIX_video_source\ntypedef XID GLXVideoSourceSGIX;\n#endif\n\n#ifndef GLX_SGIX_fbconfig\ntypedef XID GLXFBConfigIDSGIX;\ntypedef struct __GLXFBConfigRec *GLXFBConfigSGIX;\n#endif\n\n#ifndef GLX_SGIX_pbuffer\ntypedef XID GLXPbufferSGIX;\ntypedef struct {\n    int type;\n    unsigned long serial;\t  /* # of last request processed by server */\n    Bool send_event;\t\t  /* true if this came for SendEvent request */\n    Display *display;\t\t  /* display the event was read from */\n    GLXDrawable drawable;\t  /* i.d. of Drawable */\n    int event_type;\t\t  /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */\n    int draw_type;\t\t  /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */\n    unsigned int mask;\t  /* mask indicating which buffers are affected*/\n    int x, y;\n    int width, height;\n    int count;\t\t  /* if nonzero, at least this many more */\n} GLXBufferClobberEventSGIX;\n#endif\n\n#ifndef GLX_NV_video_output\ntypedef unsigned int GLXVideoDeviceNV;\n#endif\n\n#ifndef GLX_NV_video_capture\ntypedef XID GLXVideoCaptureDeviceNV;\n#endif\n\n#ifndef GLEXT_64_TYPES_DEFINED\n/* This code block is duplicated in glext.h, so must be protected */\n#define GLEXT_64_TYPES_DEFINED\n/* Define int32_t, int64_t, and uint64_t types for UST/MSC */\n/* (as used in the GLX_OML_sync_control extension). */\n#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n#include <inttypes.h>\n#elif defined(__sun__) || defined(__digital__)\n#include <inttypes.h>\n#if defined(__STDC__)\n#if defined(__arch64__) || defined(_LP64)\ntypedef long int int64_t;\ntypedef unsigned long int uint64_t;\n#else\ntypedef long long int int64_t;\ntypedef unsigned long long int uint64_t;\n#endif /* __arch64__ */\n#endif /* __STDC__ */\n#elif defined( __VMS ) || defined(__sgi)\n#include <inttypes.h>\n#elif defined(__SCO__) || defined(__USLC__)\n#include <stdint.h>\n#elif defined(__UNIXOS2__) || defined(__SOL64__)\ntypedef long int int32_t;\ntypedef long long int int64_t;\ntypedef unsigned long long int uint64_t;\n#elif defined(_WIN32) && defined(__GNUC__)\n#include <stdint.h>\n#elif defined(_WIN32)\ntypedef __int32 int32_t;\ntypedef __int64 int64_t;\ntypedef unsigned __int64 uint64_t;\n#else\n#include <inttypes.h>     /* Fallback option */\n#endif\n#endif\n\n#ifndef GLX_VERSION_1_3\n#define GLX_VERSION_1_3 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern GLXFBConfig * glXGetFBConfigs (Display *dpy, int screen, int *nelements);\nextern GLXFBConfig * glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements);\nextern int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value);\nextern XVisualInfo * glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config);\nextern GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);\nextern void glXDestroyWindow (Display *dpy, GLXWindow win);\nextern GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);\nextern void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap);\nextern GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list);\nextern void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf);\nextern void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);\nextern GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);\nextern Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);\nextern GLXDrawable glXGetCurrentReadDrawable (void);\nextern Display * glXGetCurrentDisplay (void);\nextern int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value);\nextern void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask);\nextern void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);\ntypedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);\ntypedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);\ntypedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);\ntypedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);\ntypedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);\ntypedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);\ntypedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);\ntypedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);\ntypedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);\ntypedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);\ntypedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);\ntypedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);\ntypedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);\ntypedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);\ntypedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);\ntypedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);\ntypedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);\n#endif\n\n#ifndef GLX_VERSION_1_4\n#define GLX_VERSION_1_4 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);\n#endif\n\n#ifndef GLX_ARB_get_proc_address\n#define GLX_ARB_get_proc_address 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);\n#endif\n\n#ifndef GLX_ARB_multisample\n#define GLX_ARB_multisample 1\n#endif\n\n#ifndef GLX_ARB_fbconfig_float\n#define GLX_ARB_fbconfig_float 1\n#endif\n\n#ifndef GLX_ARB_framebuffer_sRGB\n#define GLX_ARB_framebuffer_sRGB 1\n#endif\n\n#ifndef GLX_ARB_create_context\n#define GLX_ARB_create_context 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);\n#endif\n\n#ifndef GLX_ARB_create_context_profile\n#define GLX_ARB_create_context_profile 1\n#endif\n\n#ifndef GLX_ARB_create_context_robustness\n#define GLX_ARB_create_context_robustness 1\n#endif\n\n#ifndef GLX_SGIS_multisample\n#define GLX_SGIS_multisample 1\n#endif\n\n#ifndef GLX_EXT_visual_info\n#define GLX_EXT_visual_info 1\n#endif\n\n#ifndef GLX_SGI_swap_control\n#define GLX_SGI_swap_control 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern int glXSwapIntervalSGI (int interval);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);\n#endif\n\n#ifndef GLX_SGI_video_sync\n#define GLX_SGI_video_sync 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern int glXGetVideoSyncSGI (unsigned int *count);\nextern int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);\ntypedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);\n#endif\n\n#ifndef GLX_SGI_make_current_read\n#define GLX_SGI_make_current_read 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);\nextern GLXDrawable glXGetCurrentReadDrawableSGI (void);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);\ntypedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);\n#endif\n\n#ifndef GLX_SGIX_video_source\n#define GLX_SGIX_video_source 1\n#ifdef _VL_H\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);\nextern void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);\ntypedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);\n#endif /* _VL_H */\n#endif\n\n#ifndef GLX_EXT_visual_rating\n#define GLX_EXT_visual_rating 1\n#endif\n\n#ifndef GLX_EXT_import_context\n#define GLX_EXT_import_context 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern Display * glXGetCurrentDisplayEXT (void);\nextern int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value);\nextern GLXContextID glXGetContextIDEXT (const GLXContext context);\nextern GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);\nextern void glXFreeContextEXT (Display *dpy, GLXContext context);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);\ntypedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);\ntypedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);\ntypedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);\ntypedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);\n#endif\n\n#ifndef GLX_SGIX_fbconfig\n#define GLX_SGIX_fbconfig 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);\nextern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements);\nextern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);\nextern GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);\nextern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config);\nextern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);\ntypedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);\ntypedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);\ntypedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);\ntypedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);\ntypedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);\n#endif\n\n#ifndef GLX_SGIX_pbuffer\n#define GLX_SGIX_pbuffer 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);\nextern void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf);\nextern int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);\nextern void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask);\nextern void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);\ntypedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);\ntypedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);\ntypedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);\ntypedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);\n#endif\n\n#ifndef GLX_SGI_cushion\n#define GLX_SGI_cushion 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern void glXCushionSGI (Display *dpy, Window window, float cushion);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);\n#endif\n\n#ifndef GLX_SGIX_video_resize\n#define GLX_SGIX_video_resize 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window);\nextern int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h);\nextern int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);\nextern int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);\nextern int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);\ntypedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);\ntypedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);\ntypedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);\ntypedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);\n#endif\n\n#ifndef GLX_SGIX_dmbuffer\n#define GLX_SGIX_dmbuffer 1\n#ifdef _DM_BUFFER_H_\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);\n#endif /* _DM_BUFFER_H_ */\n#endif\n\n#ifndef GLX_SGIX_swap_group\n#define GLX_SGIX_swap_group 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);\n#endif\n\n#ifndef GLX_SGIX_swap_barrier\n#define GLX_SGIX_swap_barrier 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier);\nextern Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);\ntypedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);\n#endif\n\n#ifndef GLX_SUN_get_transparent_index\n#define GLX_SUN_get_transparent_index 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);\n#endif\n\n#ifndef GLX_MESA_copy_sub_buffer\n#define GLX_MESA_copy_sub_buffer 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);\n#endif\n\n#ifndef GLX_MESA_pixmap_colormap\n#define GLX_MESA_pixmap_colormap 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);\n#endif\n\n#ifndef GLX_MESA_release_buffers\n#define GLX_MESA_release_buffers 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);\n#endif\n\n#ifndef GLX_MESA_set_3dfx_mode\n#define GLX_MESA_set_3dfx_mode 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern Bool glXSet3DfxModeMESA (int mode);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);\n#endif\n\n#ifndef GLX_SGIX_visual_select_group\n#define GLX_SGIX_visual_select_group 1\n#endif\n\n#ifndef GLX_OML_swap_method\n#define GLX_OML_swap_method 1\n#endif\n\n#ifndef GLX_OML_sync_control\n#define GLX_OML_sync_control 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);\nextern Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);\nextern int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);\nextern Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);\nextern Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);\ntypedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);\ntypedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);\ntypedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);\ntypedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);\n#endif\n\n#ifndef GLX_NV_float_buffer\n#define GLX_NV_float_buffer 1\n#endif\n\n#ifndef GLX_SGIX_hyperpipe\n#define GLX_SGIX_hyperpipe 1\n\ntypedef struct {\n    char    pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];\n    int     networkId;\n} GLXHyperpipeNetworkSGIX;\n\ntypedef struct {\n    char    pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];\n    int     channel;\n    unsigned int\n      participationType;\n    int     timeSlice;\n} GLXHyperpipeConfigSGIX;\n\ntypedef struct {\n    char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];\n    int srcXOrigin, srcYOrigin, srcWidth, srcHeight;\n    int destXOrigin, destYOrigin, destWidth, destHeight;\n} GLXPipeRect;\n\ntypedef struct {\n    char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];\n    int XOrigin, YOrigin, maxHeight, maxWidth;\n} GLXPipeRectLimits;\n\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes);\nextern int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);\nextern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes);\nextern int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId);\nextern int glXBindHyperpipeSGIX (Display *dpy, int hpId);\nextern int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);\nextern int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList);\nextern int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);\ntypedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);\ntypedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);\ntypedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);\ntypedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);\ntypedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);\ntypedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);\ntypedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);\n#endif\n\n#ifndef GLX_MESA_agp_offset\n#define GLX_MESA_agp_offset 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern unsigned int glXGetAGPOffsetMESA (const void *pointer);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);\n#endif\n\n#ifndef GLX_EXT_fbconfig_packed_float\n#define GLX_EXT_fbconfig_packed_float 1\n#endif\n\n#ifndef GLX_EXT_framebuffer_sRGB\n#define GLX_EXT_framebuffer_sRGB 1\n#endif\n\n#ifndef GLX_EXT_texture_from_pixmap\n#define GLX_EXT_texture_from_pixmap 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);\nextern void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);\ntypedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);\n#endif\n\n#ifndef GLX_NV_present_video\n#define GLX_NV_present_video 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern unsigned int * glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements);\nextern int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef unsigned int * ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);\ntypedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);\n#endif\n\n#ifndef GLX_NV_video_output\n#define GLX_NV_video_output 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);\nextern int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);\nextern int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);\nextern int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);\nextern int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);\nextern int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);\ntypedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);\ntypedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);\ntypedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);\ntypedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);\ntypedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);\n#endif\n\n#ifndef GLX_NV_swap_group\n#define GLX_NV_swap_group 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group);\nextern Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier);\nextern Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);\nextern Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);\nextern Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count);\nextern Bool glXResetFrameCountNV (Display *dpy, int screen);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);\ntypedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);\ntypedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);\ntypedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);\ntypedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);\ntypedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);\n#endif\n\n#ifndef GLX_NV_video_capture\n#define GLX_NV_video_capture 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);\nextern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements);\nextern void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);\nextern int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);\nextern void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);\ntypedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);\ntypedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);\ntypedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);\ntypedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);\n#endif\n\n#ifndef GLX_EXT_swap_control\n#define GLX_EXT_swap_control 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern void glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);\n#endif\n\n#ifndef GLX_NV_copy_image\n#define GLX_NV_copy_image 1\n#ifdef GLX_GLXEXT_PROTOTYPES\nextern void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n#endif /* GLX_GLXEXT_PROTOTYPES */\ntypedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n#endif\n\n#ifndef GLX_INTEL_swap_event\n#define GLX_INTEL_swap_event 1\n#endif\n\n#ifndef GLX_NV_multisample_coverage\n#define GLX_NV_multisample_coverage 1\n#endif\n\n#ifndef GLX_EXT_swap_control_tear\n#define GLX_EXT_swap_control_tear 1\n#endif\n\n#ifndef GLX_EXT_buffer_age\n#define GLX_EXT_buffer_age 1\n#endif\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "tests/3rdparty/glfw/deps/GL/wglext.h",
    "content": "#ifndef __wglext_h_\n#define __wglext_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n** Copyright (c) 2007-2012 The Khronos Group Inc.\n** \n** Permission is hereby granted, free of charge, to any person obtaining a\n** copy of this software and/or associated documentation files (the\n** \"Materials\"), to deal in the Materials without restriction, including\n** without limitation the rights to use, copy, modify, merge, publish,\n** distribute, sublicense, and/or sell copies of the Materials, and to\n** permit persons to whom the Materials are furnished to do so, subject to\n** the following conditions:\n** \n** The above copyright notice and this permission notice shall be included\n** in all copies or substantial portions of the Materials.\n** \n** THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n*/\n\n/* Function declaration macros - to move into glplatform.h */\n\n#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)\n#define WIN32_LEAN_AND_MEAN 1\n#include <windows.h>\n#endif\n\n#ifndef APIENTRY\n#define APIENTRY\n#endif\n#ifndef APIENTRYP\n#define APIENTRYP APIENTRY *\n#endif\n#ifndef GLAPI\n#define GLAPI extern\n#endif\n\n/*************************************************************/\n\n/* Header file version number */\n/* wglext.h last updated 2012/01/04 */\n/* Current version at http://www.opengl.org/registry/ */\n#define WGL_WGLEXT_VERSION 24\n\n#ifndef WGL_ARB_buffer_region\n#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001\n#define WGL_BACK_COLOR_BUFFER_BIT_ARB  0x00000002\n#define WGL_DEPTH_BUFFER_BIT_ARB       0x00000004\n#define WGL_STENCIL_BUFFER_BIT_ARB     0x00000008\n#endif\n\n#ifndef WGL_ARB_multisample\n#define WGL_SAMPLE_BUFFERS_ARB         0x2041\n#define WGL_SAMPLES_ARB                0x2042\n#endif\n\n#ifndef WGL_ARB_extensions_string\n#endif\n\n#ifndef WGL_ARB_pixel_format\n#define WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000\n#define WGL_DRAW_TO_WINDOW_ARB         0x2001\n#define WGL_DRAW_TO_BITMAP_ARB         0x2002\n#define WGL_ACCELERATION_ARB           0x2003\n#define WGL_NEED_PALETTE_ARB           0x2004\n#define WGL_NEED_SYSTEM_PALETTE_ARB    0x2005\n#define WGL_SWAP_LAYER_BUFFERS_ARB     0x2006\n#define WGL_SWAP_METHOD_ARB            0x2007\n#define WGL_NUMBER_OVERLAYS_ARB        0x2008\n#define WGL_NUMBER_UNDERLAYS_ARB       0x2009\n#define WGL_TRANSPARENT_ARB            0x200A\n#define WGL_TRANSPARENT_RED_VALUE_ARB  0x2037\n#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038\n#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039\n#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A\n#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B\n#define WGL_SHARE_DEPTH_ARB            0x200C\n#define WGL_SHARE_STENCIL_ARB          0x200D\n#define WGL_SHARE_ACCUM_ARB            0x200E\n#define WGL_SUPPORT_GDI_ARB            0x200F\n#define WGL_SUPPORT_OPENGL_ARB         0x2010\n#define WGL_DOUBLE_BUFFER_ARB          0x2011\n#define WGL_STEREO_ARB                 0x2012\n#define WGL_PIXEL_TYPE_ARB             0x2013\n#define WGL_COLOR_BITS_ARB             0x2014\n#define WGL_RED_BITS_ARB               0x2015\n#define WGL_RED_SHIFT_ARB              0x2016\n#define WGL_GREEN_BITS_ARB             0x2017\n#define WGL_GREEN_SHIFT_ARB            0x2018\n#define WGL_BLUE_BITS_ARB              0x2019\n#define WGL_BLUE_SHIFT_ARB             0x201A\n#define WGL_ALPHA_BITS_ARB             0x201B\n#define WGL_ALPHA_SHIFT_ARB            0x201C\n#define WGL_ACCUM_BITS_ARB             0x201D\n#define WGL_ACCUM_RED_BITS_ARB         0x201E\n#define WGL_ACCUM_GREEN_BITS_ARB       0x201F\n#define WGL_ACCUM_BLUE_BITS_ARB        0x2020\n#define WGL_ACCUM_ALPHA_BITS_ARB       0x2021\n#define WGL_DEPTH_BITS_ARB             0x2022\n#define WGL_STENCIL_BITS_ARB           0x2023\n#define WGL_AUX_BUFFERS_ARB            0x2024\n#define WGL_NO_ACCELERATION_ARB        0x2025\n#define WGL_GENERIC_ACCELERATION_ARB   0x2026\n#define WGL_FULL_ACCELERATION_ARB      0x2027\n#define WGL_SWAP_EXCHANGE_ARB          0x2028\n#define WGL_SWAP_COPY_ARB              0x2029\n#define WGL_SWAP_UNDEFINED_ARB         0x202A\n#define WGL_TYPE_RGBA_ARB              0x202B\n#define WGL_TYPE_COLORINDEX_ARB        0x202C\n#endif\n\n#ifndef WGL_ARB_make_current_read\n#define ERROR_INVALID_PIXEL_TYPE_ARB   0x2043\n#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054\n#endif\n\n#ifndef WGL_ARB_pbuffer\n#define WGL_DRAW_TO_PBUFFER_ARB        0x202D\n#define WGL_MAX_PBUFFER_PIXELS_ARB     0x202E\n#define WGL_MAX_PBUFFER_WIDTH_ARB      0x202F\n#define WGL_MAX_PBUFFER_HEIGHT_ARB     0x2030\n#define WGL_PBUFFER_LARGEST_ARB        0x2033\n#define WGL_PBUFFER_WIDTH_ARB          0x2034\n#define WGL_PBUFFER_HEIGHT_ARB         0x2035\n#define WGL_PBUFFER_LOST_ARB           0x2036\n#endif\n\n#ifndef WGL_ARB_render_texture\n#define WGL_BIND_TO_TEXTURE_RGB_ARB    0x2070\n#define WGL_BIND_TO_TEXTURE_RGBA_ARB   0x2071\n#define WGL_TEXTURE_FORMAT_ARB         0x2072\n#define WGL_TEXTURE_TARGET_ARB         0x2073\n#define WGL_MIPMAP_TEXTURE_ARB         0x2074\n#define WGL_TEXTURE_RGB_ARB            0x2075\n#define WGL_TEXTURE_RGBA_ARB           0x2076\n#define WGL_NO_TEXTURE_ARB             0x2077\n#define WGL_TEXTURE_CUBE_MAP_ARB       0x2078\n#define WGL_TEXTURE_1D_ARB             0x2079\n#define WGL_TEXTURE_2D_ARB             0x207A\n#define WGL_MIPMAP_LEVEL_ARB           0x207B\n#define WGL_CUBE_MAP_FACE_ARB          0x207C\n#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D\n#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E\n#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F\n#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080\n#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081\n#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082\n#define WGL_FRONT_LEFT_ARB             0x2083\n#define WGL_FRONT_RIGHT_ARB            0x2084\n#define WGL_BACK_LEFT_ARB              0x2085\n#define WGL_BACK_RIGHT_ARB             0x2086\n#define WGL_AUX0_ARB                   0x2087\n#define WGL_AUX1_ARB                   0x2088\n#define WGL_AUX2_ARB                   0x2089\n#define WGL_AUX3_ARB                   0x208A\n#define WGL_AUX4_ARB                   0x208B\n#define WGL_AUX5_ARB                   0x208C\n#define WGL_AUX6_ARB                   0x208D\n#define WGL_AUX7_ARB                   0x208E\n#define WGL_AUX8_ARB                   0x208F\n#define WGL_AUX9_ARB                   0x2090\n#endif\n\n#ifndef WGL_ARB_pixel_format_float\n#define WGL_TYPE_RGBA_FLOAT_ARB        0x21A0\n#endif\n\n#ifndef WGL_ARB_framebuffer_sRGB\n#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9\n#endif\n\n#ifndef WGL_ARB_create_context\n#define WGL_CONTEXT_DEBUG_BIT_ARB      0x00000001\n#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002\n#define WGL_CONTEXT_MAJOR_VERSION_ARB  0x2091\n#define WGL_CONTEXT_MINOR_VERSION_ARB  0x2092\n#define WGL_CONTEXT_LAYER_PLANE_ARB    0x2093\n#define WGL_CONTEXT_FLAGS_ARB          0x2094\n#define ERROR_INVALID_VERSION_ARB      0x2095\n#endif\n\n#ifndef WGL_ARB_create_context_profile\n#define WGL_CONTEXT_PROFILE_MASK_ARB   0x9126\n#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001\n#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002\n#define ERROR_INVALID_PROFILE_ARB      0x2096\n#endif\n\n#ifndef WGL_ARB_create_context_robustness\n#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004\n#define WGL_LOSE_CONTEXT_ON_RESET_ARB  0x8252\n#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256\n#define WGL_NO_RESET_NOTIFICATION_ARB  0x8261\n#endif\n\n#ifndef WGL_EXT_make_current_read\n#define ERROR_INVALID_PIXEL_TYPE_EXT   0x2043\n#endif\n\n#ifndef WGL_EXT_pixel_format\n#define WGL_NUMBER_PIXEL_FORMATS_EXT   0x2000\n#define WGL_DRAW_TO_WINDOW_EXT         0x2001\n#define WGL_DRAW_TO_BITMAP_EXT         0x2002\n#define WGL_ACCELERATION_EXT           0x2003\n#define WGL_NEED_PALETTE_EXT           0x2004\n#define WGL_NEED_SYSTEM_PALETTE_EXT    0x2005\n#define WGL_SWAP_LAYER_BUFFERS_EXT     0x2006\n#define WGL_SWAP_METHOD_EXT            0x2007\n#define WGL_NUMBER_OVERLAYS_EXT        0x2008\n#define WGL_NUMBER_UNDERLAYS_EXT       0x2009\n#define WGL_TRANSPARENT_EXT            0x200A\n#define WGL_TRANSPARENT_VALUE_EXT      0x200B\n#define WGL_SHARE_DEPTH_EXT            0x200C\n#define WGL_SHARE_STENCIL_EXT          0x200D\n#define WGL_SHARE_ACCUM_EXT            0x200E\n#define WGL_SUPPORT_GDI_EXT            0x200F\n#define WGL_SUPPORT_OPENGL_EXT         0x2010\n#define WGL_DOUBLE_BUFFER_EXT          0x2011\n#define WGL_STEREO_EXT                 0x2012\n#define WGL_PIXEL_TYPE_EXT             0x2013\n#define WGL_COLOR_BITS_EXT             0x2014\n#define WGL_RED_BITS_EXT               0x2015\n#define WGL_RED_SHIFT_EXT              0x2016\n#define WGL_GREEN_BITS_EXT             0x2017\n#define WGL_GREEN_SHIFT_EXT            0x2018\n#define WGL_BLUE_BITS_EXT              0x2019\n#define WGL_BLUE_SHIFT_EXT             0x201A\n#define WGL_ALPHA_BITS_EXT             0x201B\n#define WGL_ALPHA_SHIFT_EXT            0x201C\n#define WGL_ACCUM_BITS_EXT             0x201D\n#define WGL_ACCUM_RED_BITS_EXT         0x201E\n#define WGL_ACCUM_GREEN_BITS_EXT       0x201F\n#define WGL_ACCUM_BLUE_BITS_EXT        0x2020\n#define WGL_ACCUM_ALPHA_BITS_EXT       0x2021\n#define WGL_DEPTH_BITS_EXT             0x2022\n#define WGL_STENCIL_BITS_EXT           0x2023\n#define WGL_AUX_BUFFERS_EXT            0x2024\n#define WGL_NO_ACCELERATION_EXT        0x2025\n#define WGL_GENERIC_ACCELERATION_EXT   0x2026\n#define WGL_FULL_ACCELERATION_EXT      0x2027\n#define WGL_SWAP_EXCHANGE_EXT          0x2028\n#define WGL_SWAP_COPY_EXT              0x2029\n#define WGL_SWAP_UNDEFINED_EXT         0x202A\n#define WGL_TYPE_RGBA_EXT              0x202B\n#define WGL_TYPE_COLORINDEX_EXT        0x202C\n#endif\n\n#ifndef WGL_EXT_pbuffer\n#define WGL_DRAW_TO_PBUFFER_EXT        0x202D\n#define WGL_MAX_PBUFFER_PIXELS_EXT     0x202E\n#define WGL_MAX_PBUFFER_WIDTH_EXT      0x202F\n#define WGL_MAX_PBUFFER_HEIGHT_EXT     0x2030\n#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT  0x2031\n#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032\n#define WGL_PBUFFER_LARGEST_EXT        0x2033\n#define WGL_PBUFFER_WIDTH_EXT          0x2034\n#define WGL_PBUFFER_HEIGHT_EXT         0x2035\n#endif\n\n#ifndef WGL_EXT_depth_float\n#define WGL_DEPTH_FLOAT_EXT            0x2040\n#endif\n\n#ifndef WGL_3DFX_multisample\n#define WGL_SAMPLE_BUFFERS_3DFX        0x2060\n#define WGL_SAMPLES_3DFX               0x2061\n#endif\n\n#ifndef WGL_EXT_multisample\n#define WGL_SAMPLE_BUFFERS_EXT         0x2041\n#define WGL_SAMPLES_EXT                0x2042\n#endif\n\n#ifndef WGL_I3D_digital_video_control\n#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050\n#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051\n#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052\n#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053\n#endif\n\n#ifndef WGL_I3D_gamma\n#define WGL_GAMMA_TABLE_SIZE_I3D       0x204E\n#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D  0x204F\n#endif\n\n#ifndef WGL_I3D_genlock\n#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044\n#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045\n#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046\n#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047\n#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048\n#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049\n#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A\n#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B\n#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C\n#endif\n\n#ifndef WGL_I3D_image_buffer\n#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001\n#define WGL_IMAGE_BUFFER_LOCK_I3D      0x00000002\n#endif\n\n#ifndef WGL_I3D_swap_frame_lock\n#endif\n\n#ifndef WGL_NV_render_depth_texture\n#define WGL_BIND_TO_TEXTURE_DEPTH_NV   0x20A3\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4\n#define WGL_DEPTH_TEXTURE_FORMAT_NV    0x20A5\n#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6\n#define WGL_DEPTH_COMPONENT_NV         0x20A7\n#endif\n\n#ifndef WGL_NV_render_texture_rectangle\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1\n#define WGL_TEXTURE_RECTANGLE_NV       0x20A2\n#endif\n\n#ifndef WGL_ATI_pixel_format_float\n#define WGL_TYPE_RGBA_FLOAT_ATI        0x21A0\n#endif\n\n#ifndef WGL_NV_float_buffer\n#define WGL_FLOAT_COMPONENTS_NV        0x20B0\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4\n#define WGL_TEXTURE_FLOAT_R_NV         0x20B5\n#define WGL_TEXTURE_FLOAT_RG_NV        0x20B6\n#define WGL_TEXTURE_FLOAT_RGB_NV       0x20B7\n#define WGL_TEXTURE_FLOAT_RGBA_NV      0x20B8\n#endif\n\n#ifndef WGL_3DL_stereo_control\n#define WGL_STEREO_EMITTER_ENABLE_3DL  0x2055\n#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056\n#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057\n#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058\n#endif\n\n#ifndef WGL_EXT_pixel_format_packed_float\n#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8\n#endif\n\n#ifndef WGL_EXT_framebuffer_sRGB\n#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9\n#endif\n\n#ifndef WGL_NV_present_video\n#define WGL_NUM_VIDEO_SLOTS_NV         0x20F0\n#endif\n\n#ifndef WGL_NV_video_out\n#define WGL_BIND_TO_VIDEO_RGB_NV       0x20C0\n#define WGL_BIND_TO_VIDEO_RGBA_NV      0x20C1\n#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2\n#define WGL_VIDEO_OUT_COLOR_NV         0x20C3\n#define WGL_VIDEO_OUT_ALPHA_NV         0x20C4\n#define WGL_VIDEO_OUT_DEPTH_NV         0x20C5\n#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6\n#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7\n#define WGL_VIDEO_OUT_FRAME            0x20C8\n#define WGL_VIDEO_OUT_FIELD_1          0x20C9\n#define WGL_VIDEO_OUT_FIELD_2          0x20CA\n#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB\n#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC\n#endif\n\n#ifndef WGL_NV_swap_group\n#endif\n\n#ifndef WGL_NV_gpu_affinity\n#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0\n#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1\n#endif\n\n#ifndef WGL_AMD_gpu_association\n#define WGL_GPU_VENDOR_AMD             0x1F00\n#define WGL_GPU_RENDERER_STRING_AMD    0x1F01\n#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02\n#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2\n#define WGL_GPU_RAM_AMD                0x21A3\n#define WGL_GPU_CLOCK_AMD              0x21A4\n#define WGL_GPU_NUM_PIPES_AMD          0x21A5\n#define WGL_GPU_NUM_SIMD_AMD           0x21A6\n#define WGL_GPU_NUM_RB_AMD             0x21A7\n#define WGL_GPU_NUM_SPI_AMD            0x21A8\n#endif\n\n#ifndef WGL_NV_video_capture\n#define WGL_UNIQUE_ID_NV               0x20CE\n#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF\n#endif\n\n#ifndef WGL_NV_copy_image\n#endif\n\n#ifndef WGL_NV_multisample_coverage\n#define WGL_COVERAGE_SAMPLES_NV        0x2042\n#define WGL_COLOR_SAMPLES_NV           0x20B9\n#endif\n\n#ifndef WGL_EXT_create_context_es2_profile\n#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004\n#endif\n\n#ifndef WGL_NV_DX_interop\n#define WGL_ACCESS_READ_ONLY_NV        0x00000000\n#define WGL_ACCESS_READ_WRITE_NV       0x00000001\n#define WGL_ACCESS_WRITE_DISCARD_NV    0x00000002\n#endif\n\n#ifndef WGL_NV_DX_interop2\n#endif\n\n#ifndef WGL_EXT_swap_control_tear\n#endif\n\n\n/*************************************************************/\n\n#ifndef WGL_ARB_pbuffer\nDECLARE_HANDLE(HPBUFFERARB);\n#endif\n#ifndef WGL_EXT_pbuffer\nDECLARE_HANDLE(HPBUFFEREXT);\n#endif\n#ifndef WGL_NV_present_video\nDECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);\n#endif\n#ifndef WGL_NV_video_output\nDECLARE_HANDLE(HPVIDEODEV);\n#endif\n#ifndef WGL_NV_gpu_affinity\nDECLARE_HANDLE(HPGPUNV);\nDECLARE_HANDLE(HGPUNV);\n\ntypedef struct _GPU_DEVICE {\n    DWORD  cb;\n    CHAR   DeviceName[32];\n    CHAR   DeviceString[128];\n    DWORD  Flags;\n    RECT   rcVirtualScreen;\n} GPU_DEVICE, *PGPU_DEVICE;\n#endif\n#ifndef WGL_NV_video_capture\nDECLARE_HANDLE(HVIDEOINPUTDEVICENV);\n#endif\n\n#ifndef WGL_ARB_buffer_region\n#define WGL_ARB_buffer_region 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);\nextern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);\nextern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);\nextern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);\ntypedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);\ntypedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);\ntypedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);\n#endif\n\n#ifndef WGL_ARB_multisample\n#define WGL_ARB_multisample 1\n#endif\n\n#ifndef WGL_ARB_extensions_string\n#define WGL_ARB_extensions_string 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);\n#endif\n\n#ifndef WGL_ARB_pixel_format\n#define WGL_ARB_pixel_format 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);\nextern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);\nextern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);\ntypedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);\ntypedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);\n#endif\n\n#ifndef WGL_ARB_make_current_read\n#define WGL_ARB_make_current_read 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);\nextern HDC WINAPI wglGetCurrentReadDCARB (void);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);\ntypedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);\n#endif\n\n#ifndef WGL_ARB_pbuffer\n#define WGL_ARB_pbuffer 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);\nextern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);\nextern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);\nextern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);\nextern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);\ntypedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);\ntypedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);\ntypedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);\ntypedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);\n#endif\n\n#ifndef WGL_ARB_render_texture\n#define WGL_ARB_render_texture 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);\nextern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);\nextern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);\ntypedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);\ntypedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);\n#endif\n\n#ifndef WGL_ARB_pixel_format_float\n#define WGL_ARB_pixel_format_float 1\n#endif\n\n#ifndef WGL_ARB_framebuffer_sRGB\n#define WGL_ARB_framebuffer_sRGB 1\n#endif\n\n#ifndef WGL_ARB_create_context\n#define WGL_ARB_create_context 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);\n#endif\n\n#ifndef WGL_ARB_create_context_profile\n#define WGL_ARB_create_context_profile 1\n#endif\n\n#ifndef WGL_ARB_create_context_robustness\n#define WGL_ARB_create_context_robustness 1\n#endif\n\n#ifndef WGL_EXT_display_color_table\n#define WGL_EXT_display_color_table 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);\nextern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);\nextern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);\nextern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);\ntypedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);\ntypedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);\ntypedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);\n#endif\n\n#ifndef WGL_EXT_extensions_string\n#define WGL_EXT_extensions_string 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern const char * WINAPI wglGetExtensionsStringEXT (void);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);\n#endif\n\n#ifndef WGL_EXT_make_current_read\n#define WGL_EXT_make_current_read 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);\nextern HDC WINAPI wglGetCurrentReadDCEXT (void);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);\ntypedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);\n#endif\n\n#ifndef WGL_EXT_pbuffer\n#define WGL_EXT_pbuffer 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);\nextern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);\nextern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);\nextern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);\nextern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);\ntypedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);\ntypedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);\ntypedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);\ntypedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);\n#endif\n\n#ifndef WGL_EXT_pixel_format\n#define WGL_EXT_pixel_format 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);\nextern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);\nextern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);\ntypedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);\ntypedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);\n#endif\n\n#ifndef WGL_EXT_swap_control\n#define WGL_EXT_swap_control 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglSwapIntervalEXT (int interval);\nextern int WINAPI wglGetSwapIntervalEXT (void);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);\ntypedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);\n#endif\n\n#ifndef WGL_EXT_depth_float\n#define WGL_EXT_depth_float 1\n#endif\n\n#ifndef WGL_NV_vertex_array_range\n#define WGL_NV_vertex_array_range 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);\nextern void WINAPI wglFreeMemoryNV (void *pointer);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);\ntypedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);\n#endif\n\n#ifndef WGL_3DFX_multisample\n#define WGL_3DFX_multisample 1\n#endif\n\n#ifndef WGL_EXT_multisample\n#define WGL_EXT_multisample 1\n#endif\n\n#ifndef WGL_OML_sync_control\n#define WGL_OML_sync_control 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);\nextern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);\nextern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);\nextern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);\nextern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);\nextern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);\ntypedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);\ntypedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);\ntypedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);\ntypedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);\ntypedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);\n#endif\n\n#ifndef WGL_I3D_digital_video_control\n#define WGL_I3D_digital_video_control 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);\nextern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);\ntypedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);\n#endif\n\n#ifndef WGL_I3D_gamma\n#define WGL_I3D_gamma 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);\nextern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);\nextern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);\nextern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);\ntypedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);\ntypedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);\ntypedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);\n#endif\n\n#ifndef WGL_I3D_genlock\n#define WGL_I3D_genlock 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);\nextern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);\nextern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);\nextern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);\nextern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);\nextern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);\nextern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);\nextern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);\nextern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);\nextern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);\nextern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);\nextern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);\ntypedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);\ntypedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);\ntypedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);\ntypedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);\ntypedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);\ntypedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);\ntypedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);\ntypedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);\ntypedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);\ntypedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);\ntypedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);\n#endif\n\n#ifndef WGL_I3D_image_buffer\n#define WGL_I3D_image_buffer 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);\nextern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);\nextern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);\nextern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);\ntypedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);\ntypedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);\ntypedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);\n#endif\n\n#ifndef WGL_I3D_swap_frame_lock\n#define WGL_I3D_swap_frame_lock 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglEnableFrameLockI3D (void);\nextern BOOL WINAPI wglDisableFrameLockI3D (void);\nextern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);\nextern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);\ntypedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);\ntypedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);\ntypedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);\n#endif\n\n#ifndef WGL_I3D_swap_frame_usage\n#define WGL_I3D_swap_frame_usage 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);\nextern BOOL WINAPI wglBeginFrameTrackingI3D (void);\nextern BOOL WINAPI wglEndFrameTrackingI3D (void);\nextern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);\ntypedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);\ntypedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);\ntypedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);\n#endif\n\n#ifndef WGL_ATI_pixel_format_float\n#define WGL_ATI_pixel_format_float 1\n#endif\n\n#ifndef WGL_NV_float_buffer\n#define WGL_NV_float_buffer 1\n#endif\n\n#ifndef WGL_3DL_stereo_control\n#define WGL_3DL_stereo_control 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);\n#endif\n\n#ifndef WGL_EXT_pixel_format_packed_float\n#define WGL_EXT_pixel_format_packed_float 1\n#endif\n\n#ifndef WGL_EXT_framebuffer_sRGB\n#define WGL_EXT_framebuffer_sRGB 1\n#endif\n\n#ifndef WGL_NV_present_video\n#define WGL_NV_present_video 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);\nextern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);\nextern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);\ntypedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);\ntypedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);\n#endif\n\n#ifndef WGL_NV_video_output\n#define WGL_NV_video_output 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);\nextern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);\nextern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);\nextern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);\nextern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);\nextern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);\ntypedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);\ntypedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);\ntypedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);\ntypedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);\ntypedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);\n#endif\n\n#ifndef WGL_NV_swap_group\n#define WGL_NV_swap_group 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);\nextern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);\nextern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);\nextern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);\nextern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);\nextern BOOL WINAPI wglResetFrameCountNV (HDC hDC);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);\ntypedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);\ntypedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);\ntypedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);\ntypedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);\ntypedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);\n#endif\n\n#ifndef WGL_NV_gpu_affinity\n#define WGL_NV_gpu_affinity 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);\nextern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);\nextern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);\nextern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);\nextern BOOL WINAPI wglDeleteDCNV (HDC hdc);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);\ntypedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);\ntypedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);\ntypedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);\ntypedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);\n#endif\n\n#ifndef WGL_AMD_gpu_association\n#define WGL_AMD_gpu_association 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);\nextern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);\nextern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);\nextern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);\nextern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);\nextern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);\nextern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);\nextern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);\nextern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);\ntypedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);\ntypedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);\ntypedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);\ntypedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);\ntypedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);\ntypedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);\ntypedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);\ntypedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\n#endif\n\n#ifndef WGL_NV_video_capture\n#define WGL_NV_video_capture 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);\nextern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);\nextern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);\nextern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);\nextern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);\ntypedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);\ntypedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);\ntypedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);\ntypedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);\n#endif\n\n#ifndef WGL_NV_copy_image\n#define WGL_NV_copy_image 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n#endif\n\n#ifndef WGL_NV_multisample_coverage\n#define WGL_NV_multisample_coverage 1\n#endif\n\n#ifndef WGL_NV_DX_interop\n#define WGL_NV_DX_interop 1\n#ifdef WGL_WGLEXT_PROTOTYPES\nextern BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);\nextern HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);\nextern BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);\nextern HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);\nextern BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);\nextern BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);\nextern BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);\nextern BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);\n#endif /* WGL_WGLEXT_PROTOTYPES */\ntypedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);\ntypedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);\ntypedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);\ntypedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);\ntypedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);\ntypedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);\ntypedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);\ntypedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);\n#endif\n\n#ifndef WGL_NV_DX_interop2\n#define WGL_NV_DX_interop2 1\n#endif\n\n#ifndef WGL_EXT_swap_control_tear\n#define WGL_EXT_swap_control_tear 1\n#endif\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "tests/3rdparty/glfw/deps/getopt.c",
    "content": "/*****************************************************************************\n* getopt.c - competent and free getopt library.\n* $Header: /cvsroot/freegetopt/freegetopt/getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $\n*\n* Copyright (c)2002-2003 Mark K. Kim\n* All rights reserved.\n* \n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions\n* are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*\n*   * Redistributions in binary form must reproduce the above copyright\n*     notice, this list of conditions and the following disclaimer in\n*     the documentation and/or other materials provided with the\n*     distribution.\n*\n*   * Neither the original author of this software nor the names of its\n*     contributors may be used to endorse or promote products derived\n*     from this software without specific prior written permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n* DAMAGE.\n*/\n#ifndef _CRT_SECURE_NO_WARNINGS\n#define _CRT_SECURE_NO_WARNINGS\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"getopt.h\"\n\n/* 2013-01-06 Camilla Berglund <elmindreda@elmindreda.org>\n * \n * Only define _CRT_SECURE_NO_WARNINGS if not already defined.\n */\n/* 2012-08-12 Lambert Clara <lambert.clara@yahoo.fr>\n * \n * Constify third argument of getopt.\n */\n/* 2011-07-27 Camilla Berglund <elmindreda@elmindreda.org>\n * \n * Added _CRT_SECURE_NO_WARNINGS macro.\n */\n/* 2009-10-12 Camilla Berglund <elmindreda@elmindreda.org>\n *\n * Removed unused global static variable 'ID'.\n */\n\nchar* optarg = NULL;\nint optind = 0;\nint opterr = 1;\nint optopt = '?';\n\n\nstatic char** prev_argv = NULL;        /* Keep a copy of argv and argc to */\nstatic int prev_argc = 0;              /*    tell if getopt params change */\nstatic int argv_index = 0;             /* Option we're checking */\nstatic int argv_index2 = 0;            /* Option argument we're checking */\nstatic int opt_offset = 0;             /* Index into compounded \"-option\" */\nstatic int dashdash = 0;               /* True if \"--\" option reached */\nstatic int nonopt = 0;                 /* How many nonopts we've found */\n\nstatic void increment_index()\n{\n\t/* Move onto the next option */\n\tif(argv_index < argv_index2)\n\t{\n\t\twhile(prev_argv[++argv_index] && prev_argv[argv_index][0] != '-'\n\t\t\t\t&& argv_index < argv_index2+1);\n\t}\n\telse argv_index++;\n\topt_offset = 1;\n}\n\n\n/*\n* Permutes argv[] so that the argument currently being processed is moved\n* to the end.\n*/\nstatic int permute_argv_once()\n{\n\t/* Movability check */\n\tif(argv_index + nonopt >= prev_argc) return 1;\n\t/* Move the current option to the end, bring the others to front */\n\telse\n\t{\n\t\tchar* tmp = prev_argv[argv_index];\n\n\t\t/* Move the data */\n\t\tmemmove(&prev_argv[argv_index], &prev_argv[argv_index+1],\n\t\t\t\tsizeof(char**) * (prev_argc - argv_index - 1));\n\t\tprev_argv[prev_argc - 1] = tmp;\n\n\t\tnonopt++;\n\t\treturn 0;\n\t}\n}\n\n\nint getopt(int argc, char** argv, const char* optstr)\n{\n\tint c = 0;\n\n\t/* If we have new argv, reinitialize */\n\tif(prev_argv != argv || prev_argc != argc)\n\t{\n\t\t/* Initialize variables */\n\t\tprev_argv = argv;\n\t\tprev_argc = argc;\n\t\targv_index = 1;\n\t\targv_index2 = 1;\n\t\topt_offset = 1;\n\t\tdashdash = 0;\n\t\tnonopt = 0;\n\t}\n\n\t/* Jump point in case we want to ignore the current argv_index */\n\tgetopt_top:\n\n\t/* Misc. initializations */\n\toptarg = NULL;\n\n\t/* Dash-dash check */\n\tif(argv[argv_index] && !strcmp(argv[argv_index], \"--\"))\n\t{\n\t\tdashdash = 1;\n\t\tincrement_index();\n\t}\n\n\t/* If we're at the end of argv, that's it. */\n\tif(argv[argv_index] == NULL)\n\t{\n\t\tc = -1;\n\t}\n\t/* Are we looking at a string? Single dash is also a string */\n\telse if(dashdash || argv[argv_index][0] != '-' || !strcmp(argv[argv_index], \"-\"))\n\t{\n\t\t/* If we want a string... */\n\t\tif(optstr[0] == '-')\n\t\t{\n\t\t\tc = 1;\n\t\t\toptarg = argv[argv_index];\n\t\t\tincrement_index();\n\t\t}\n\t\t/* If we really don't want it (we're in POSIX mode), we're done */\n\t\telse if(optstr[0] == '+' || getenv(\"POSIXLY_CORRECT\"))\n\t\t{\n\t\t\tc = -1;\n\n\t\t\t/* Everything else is a non-opt argument */\n\t\t\tnonopt = argc - argv_index;\n\t\t}\n\t\t/* If we mildly don't want it, then move it back */\n\t\telse\n\t\t{\n\t\t\tif(!permute_argv_once()) goto getopt_top;\n\t\t\telse c = -1;\n\t\t}\n\t}\n\t/* Otherwise we're looking at an option */\n\telse\n\t{\n\t\tchar* opt_ptr = NULL;\n\n\t\t/* Grab the option */\n\t\tc = argv[argv_index][opt_offset++];\n\n\t\t/* Is the option in the optstr? */\n\t\tif(optstr[0] == '-') opt_ptr = strchr(optstr+1, c);\n\t\telse opt_ptr = strchr(optstr, c);\n\t\t/* Invalid argument */\n\t\tif(!opt_ptr)\n\t\t{\n\t\t\tif(opterr)\n\t\t\t{\n\t\t\t\tfprintf(stderr, \"%s: invalid option -- %c\\n\", argv[0], c);\n\t\t\t}\n\n\t\t\toptopt = c;\n\t\t\tc = '?';\n\n\t\t\t/* Move onto the next option */\n\t\t\tincrement_index();\n\t\t}\n\t\t/* Option takes argument */\n\t\telse if(opt_ptr[1] == ':')\n\t\t{\n\t\t\t/* ie, -oARGUMENT, -xxxoARGUMENT, etc. */\n\t\t\tif(argv[argv_index][opt_offset] != '\\0')\n\t\t\t{\n\t\t\t\toptarg = &argv[argv_index][opt_offset];\n\t\t\t\tincrement_index();\n\t\t\t}\n\t\t\t/* ie, -o ARGUMENT (only if it's a required argument) */\n\t\t\telse if(opt_ptr[2] != ':')\n\t\t\t{\n\t\t\t\t/* One of those \"you're not expected to understand this\" moment */\n\t\t\t\tif(argv_index2 < argv_index) argv_index2 = argv_index;\n\t\t\t\twhile(argv[++argv_index2] && argv[argv_index2][0] == '-');\n\t\t\t\toptarg = argv[argv_index2];\n\n\t\t\t\t/* Don't cross into the non-option argument list */\n\t\t\t\tif(argv_index2 + nonopt >= prev_argc) optarg = NULL;\n\n\t\t\t\t/* Move onto the next option */\n\t\t\t\tincrement_index();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* Move onto the next option */\n\t\t\t\tincrement_index();\n\t\t\t}\n\n\t\t\t/* In case we got no argument for an option with required argument */\n\t\t\tif(optarg == NULL && opt_ptr[2] != ':')\n\t\t\t{\n\t\t\t\toptopt = c;\n\t\t\t\tc = '?';\n\n\t\t\t\tif(opterr)\n\t\t\t\t{\n\t\t\t\t\tfprintf(stderr,\"%s: option requires an argument -- %c\\n\",\n\t\t\t\t\t\t\targv[0], optopt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* Option does not take argument */\n\t\telse\n\t\t{\n\t\t\t/* Next argv_index */\n\t\t\tif(argv[argv_index][opt_offset] == '\\0')\n\t\t\t{\n\t\t\t\tincrement_index();\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Calculate optind */\n\tif(c == -1)\n\t{\n\t\toptind = argc - nonopt;\n\t}\n\telse\n\t{\n\t\toptind = argv_index;\n\t}\n\n\treturn c;\n}\n\n\n/* vim:ts=3\n*/\n"
  },
  {
    "path": "tests/3rdparty/glfw/deps/getopt.h",
    "content": "/*****************************************************************************\n* getopt.h - competent and free getopt library.\n* $Header: /cvsroot/freegetopt/freegetopt/getopt.h,v 1.2 2003/10/26 03:10:20 vindaci Exp $\n*\n* Copyright (c)2002-2003 Mark K. Kim\n* All rights reserved.\n* \n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions\n* are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*\n*   * Redistributions in binary form must reproduce the above copyright\n*     notice, this list of conditions and the following disclaimer in\n*     the documentation and/or other materials provided with the\n*     distribution.\n*\n*   * Neither the original author of this software nor the names of its\n*     contributors may be used to endorse or promote products derived\n*     from this software without specific prior written permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n* DAMAGE.\n*/\n#ifndef GETOPT_H_\n#define GETOPT_H_\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\nextern char* optarg;\nextern int optind;\nextern int opterr;\nextern int optopt;\n\nint getopt(int argc, char** argv, const char* optstr);\n\n\n#ifdef __cplusplus\n}\n#endif\n\n\n#endif /* GETOPT_H_ */\n\n\n/* vim:ts=3\n*/\n"
  },
  {
    "path": "tests/3rdparty/glfw/deps/tinycthread.c",
    "content": "/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-\nCopyright (c) 2012 Marcus Geelnard\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would be\n    appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not be\n    misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n*/\n\n/* 2013-01-06 Camilla Berglund <elmindreda@elmindreda.org>\n * \n * Added casts from time_t to DWORD to avoid warnings on VC++.\n */\n\n#include \"tinycthread.h\"\n#include <stdlib.h>\n\n/* Platform specific includes */\n#if defined(_TTHREAD_POSIX_)\n  #include <signal.h>\n  #include <sched.h>\n  #include <unistd.h>\n  #include <sys/time.h>\n  #include <errno.h>\n#elif defined(_TTHREAD_WIN32_)\n  #include <process.h>\n  #include <sys/timeb.h>\n#endif\n\n/* Standard, good-to-have defines */\n#ifndef NULL\n  #define NULL (void*)0\n#endif\n#ifndef TRUE\n  #define TRUE 1\n#endif\n#ifndef FALSE\n  #define FALSE 0\n#endif\n\nint mtx_init(mtx_t *mtx, int type)\n{\n#if defined(_TTHREAD_WIN32_)\n  mtx->mAlreadyLocked = FALSE;\n  mtx->mRecursive = type & mtx_recursive;\n  InitializeCriticalSection(&mtx->mHandle);\n  return thrd_success;\n#else\n  int ret;\n  pthread_mutexattr_t attr;\n  pthread_mutexattr_init(&attr);\n  if (type & mtx_recursive)\n  {\n    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);\n  }\n  ret = pthread_mutex_init(mtx, &attr);\n  pthread_mutexattr_destroy(&attr);\n  return ret == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nvoid mtx_destroy(mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  DeleteCriticalSection(&mtx->mHandle);\n#else\n  pthread_mutex_destroy(mtx);\n#endif\n}\n\nint mtx_lock(mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  EnterCriticalSection(&mtx->mHandle);\n  if (!mtx->mRecursive)\n  {\n    while(mtx->mAlreadyLocked) Sleep(1000); /* Simulate deadlock... */\n    mtx->mAlreadyLocked = TRUE;\n  }\n  return thrd_success;\n#else\n  return pthread_mutex_lock(mtx) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nint mtx_timedlock(mtx_t *mtx, const struct timespec *ts)\n{\n  /* FIXME! */\n  (void)mtx;\n  (void)ts;\n  return thrd_error;\n}\n\nint mtx_trylock(mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  int ret = TryEnterCriticalSection(&mtx->mHandle) ? thrd_success : thrd_busy;\n  if ((!mtx->mRecursive) && (ret == thrd_success) && mtx->mAlreadyLocked)\n  {\n    LeaveCriticalSection(&mtx->mHandle);\n    ret = thrd_busy;\n  }\n  return ret;\n#else\n  return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;\n#endif\n}\n\nint mtx_unlock(mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  mtx->mAlreadyLocked = FALSE;\n  LeaveCriticalSection(&mtx->mHandle);\n  return thrd_success;\n#else\n  return pthread_mutex_unlock(mtx) == 0 ? thrd_success : thrd_error;;\n#endif\n}\n\n#if defined(_TTHREAD_WIN32_)\n#define _CONDITION_EVENT_ONE 0\n#define _CONDITION_EVENT_ALL 1\n#endif\n\nint cnd_init(cnd_t *cond)\n{\n#if defined(_TTHREAD_WIN32_)\n  cond->mWaitersCount = 0;\n\n  /* Init critical section */\n  InitializeCriticalSection(&cond->mWaitersCountLock);\n\n  /* Init events */\n  cond->mEvents[_CONDITION_EVENT_ONE] = CreateEvent(NULL, FALSE, FALSE, NULL);\n  if (cond->mEvents[_CONDITION_EVENT_ONE] == NULL)\n  {\n    cond->mEvents[_CONDITION_EVENT_ALL] = NULL;\n    return thrd_error;\n  }\n  cond->mEvents[_CONDITION_EVENT_ALL] = CreateEvent(NULL, TRUE, FALSE, NULL);\n  if (cond->mEvents[_CONDITION_EVENT_ALL] == NULL)\n  {\n    CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);\n    cond->mEvents[_CONDITION_EVENT_ONE] = NULL;\n    return thrd_error;\n  }\n\n  return thrd_success;\n#else\n  return pthread_cond_init(cond, NULL) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nvoid cnd_destroy(cnd_t *cond)\n{\n#if defined(_TTHREAD_WIN32_)\n  if (cond->mEvents[_CONDITION_EVENT_ONE] != NULL)\n  {\n    CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);\n  }\n  if (cond->mEvents[_CONDITION_EVENT_ALL] != NULL)\n  {\n    CloseHandle(cond->mEvents[_CONDITION_EVENT_ALL]);\n  }\n  DeleteCriticalSection(&cond->mWaitersCountLock);\n#else\n  pthread_cond_destroy(cond);\n#endif\n}\n\nint cnd_signal(cnd_t *cond)\n{\n#if defined(_TTHREAD_WIN32_)\n  int haveWaiters;\n\n  /* Are there any waiters? */\n  EnterCriticalSection(&cond->mWaitersCountLock);\n  haveWaiters = (cond->mWaitersCount > 0);\n  LeaveCriticalSection(&cond->mWaitersCountLock);\n\n  /* If we have any waiting threads, send them a signal */\n  if(haveWaiters)\n  {\n    if (SetEvent(cond->mEvents[_CONDITION_EVENT_ONE]) == 0)\n    {\n      return thrd_error;\n    }\n  }\n\n  return thrd_success;\n#else\n  return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nint cnd_broadcast(cnd_t *cond)\n{\n#if defined(_TTHREAD_WIN32_)\n  int haveWaiters;\n\n  /* Are there any waiters? */\n  EnterCriticalSection(&cond->mWaitersCountLock);\n  haveWaiters = (cond->mWaitersCount > 0);\n  LeaveCriticalSection(&cond->mWaitersCountLock);\n\n  /* If we have any waiting threads, send them a signal */\n  if(haveWaiters)\n  {\n    if (SetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)\n    {\n      return thrd_error;\n    }\n  }\n\n  return thrd_success;\n#else\n  return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\n#if defined(_TTHREAD_WIN32_)\nstatic int _cnd_timedwait_win32(cnd_t *cond, mtx_t *mtx, DWORD timeout)\n{\n  int result, lastWaiter;\n\n  /* Increment number of waiters */\n  EnterCriticalSection(&cond->mWaitersCountLock);\n  ++ cond->mWaitersCount;\n  LeaveCriticalSection(&cond->mWaitersCountLock);\n\n  /* Release the mutex while waiting for the condition (will decrease\n     the number of waiters when done)... */\n  mtx_unlock(mtx);\n\n  /* Wait for either event to become signaled due to cnd_signal() or\n     cnd_broadcast() being called */\n  result = WaitForMultipleObjects(2, cond->mEvents, FALSE, timeout);\n  if (result == WAIT_TIMEOUT)\n  {\n    return thrd_timeout;\n  }\n  else if (result == (int)WAIT_FAILED)\n  {\n    return thrd_error;\n  }\n\n  /* Check if we are the last waiter */\n  EnterCriticalSection(&cond->mWaitersCountLock);\n  -- cond->mWaitersCount;\n  lastWaiter = (result == (WAIT_OBJECT_0 + _CONDITION_EVENT_ALL)) &&\n               (cond->mWaitersCount == 0);\n  LeaveCriticalSection(&cond->mWaitersCountLock);\n\n  /* If we are the last waiter to be notified to stop waiting, reset the event */\n  if (lastWaiter)\n  {\n    if (ResetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)\n    {\n      return thrd_error;\n    }\n  }\n\n  /* Re-acquire the mutex */\n  mtx_lock(mtx);\n\n  return thrd_success;\n}\n#endif\n\nint cnd_wait(cnd_t *cond, mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  return _cnd_timedwait_win32(cond, mtx, INFINITE);\n#else\n  return pthread_cond_wait(cond, mtx) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nint cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts)\n{\n#if defined(_TTHREAD_WIN32_)\n  struct timespec now;\n  if (clock_gettime(TIME_UTC, &now) == 0)\n  {\n    DWORD delta = (DWORD) ((ts->tv_sec - now.tv_sec) * 1000 +\n                           (ts->tv_nsec - now.tv_nsec + 500000) / 1000000);\n    return _cnd_timedwait_win32(cond, mtx, delta);\n  }\n  else\n    return thrd_error;\n#else\n  int ret;\n  ret = pthread_cond_timedwait(cond, mtx, ts);\n  if (ret == ETIMEDOUT)\n  {\n    return thrd_timeout;\n  }\n  return ret == 0 ? thrd_success : thrd_error;\n#endif\n}\n\n\n/** Information to pass to the new thread (what to run). */\ntypedef struct {\n  thrd_start_t mFunction; /**< Pointer to the function to be executed. */\n  void * mArg;            /**< Function argument for the thread function. */\n} _thread_start_info;\n\n/* Thread wrapper function. */\n#if defined(_TTHREAD_WIN32_)\nstatic unsigned WINAPI _thrd_wrapper_function(void * aArg)\n#elif defined(_TTHREAD_POSIX_)\nstatic void * _thrd_wrapper_function(void * aArg)\n#endif\n{\n  thrd_start_t fun;\n  void *arg;\n  int  res;\n#if defined(_TTHREAD_POSIX_)\n  void *pres;\n#endif\n\n  /* Get thread startup information */\n  _thread_start_info *ti = (_thread_start_info *) aArg;\n  fun = ti->mFunction;\n  arg = ti->mArg;\n\n  /* The thread is responsible for freeing the startup information */\n  free((void *)ti);\n\n  /* Call the actual client thread function */\n  res = fun(arg);\n\n#if defined(_TTHREAD_WIN32_)\n  return res;\n#else\n  pres = malloc(sizeof(int));\n  if (pres != NULL)\n  {\n    *(int*)pres = res;\n  }\n  return pres;\n#endif\n}\n\nint thrd_create(thrd_t *thr, thrd_start_t func, void *arg)\n{\n  /* Fill out the thread startup information (passed to the thread wrapper,\n     which will eventually free it) */\n  _thread_start_info* ti = (_thread_start_info*)malloc(sizeof(_thread_start_info));\n  if (ti == NULL)\n  {\n    return thrd_nomem;\n  }\n  ti->mFunction = func;\n  ti->mArg = arg;\n\n  /* Create the thread */\n#if defined(_TTHREAD_WIN32_)\n  *thr = (HANDLE)_beginthreadex(NULL, 0, _thrd_wrapper_function, (void *)ti, 0, NULL);\n#elif defined(_TTHREAD_POSIX_)\n  if(pthread_create(thr, NULL, _thrd_wrapper_function, (void *)ti) != 0)\n  {\n    *thr = 0;\n  }\n#endif\n\n  /* Did we fail to create the thread? */\n  if(!*thr)\n  {\n    free(ti);\n    return thrd_error;\n  }\n\n  return thrd_success;\n}\n\nthrd_t thrd_current(void)\n{\n#if defined(_TTHREAD_WIN32_)\n  return GetCurrentThread();\n#else\n  return pthread_self();\n#endif\n}\n\nint thrd_detach(thrd_t thr)\n{\n  /* FIXME! */\n  (void)thr;\n  return thrd_error;\n}\n\nint thrd_equal(thrd_t thr0, thrd_t thr1)\n{\n#if defined(_TTHREAD_WIN32_)\n  return thr0 == thr1;\n#else\n  return pthread_equal(thr0, thr1);\n#endif\n}\n\nvoid thrd_exit(int res)\n{\n#if defined(_TTHREAD_WIN32_)\n  ExitThread(res);\n#else\n  void *pres = malloc(sizeof(int));\n  if (pres != NULL)\n  {\n    *(int*)pres = res;\n  }\n  pthread_exit(pres);\n#endif\n}\n\nint thrd_join(thrd_t thr, int *res)\n{\n#if defined(_TTHREAD_WIN32_)\n  if (WaitForSingleObject(thr, INFINITE) == WAIT_FAILED)\n  {\n    return thrd_error;\n  }\n  if (res != NULL)\n  {\n    DWORD dwRes;\n    GetExitCodeThread(thr, &dwRes);\n    *res = dwRes;\n  }\n#elif defined(_TTHREAD_POSIX_)\n  void *pres;\n  int ires = 0;\n  if (pthread_join(thr, &pres) != 0)\n  {\n    return thrd_error;\n  }\n  if (pres != NULL)\n  {\n    ires = *(int*)pres;\n    free(pres);\n  }\n  if (res != NULL)\n  {\n    *res = ires;\n  }\n#endif\n  return thrd_success;\n}\n\nint thrd_sleep(const struct timespec *time_point, struct timespec *remaining)\n{\n  struct timespec now;\n#if defined(_TTHREAD_WIN32_)\n  DWORD delta;\n#else\n  long delta;\n#endif\n\n  /* Get the current time */\n  if (clock_gettime(TIME_UTC, &now) != 0)\n    return -2;  // FIXME: Some specific error code?\n\n#if defined(_TTHREAD_WIN32_)\n  /* Delta in milliseconds */\n  delta = (DWORD) ((time_point->tv_sec - now.tv_sec) * 1000 +\n                   (time_point->tv_nsec - now.tv_nsec + 500000) / 1000000);\n  if (delta > 0)\n  {\n    Sleep(delta);\n  }\n#else\n  /* Delta in microseconds */\n  delta = (time_point->tv_sec - now.tv_sec) * 1000000L +\n          (time_point->tv_nsec - now.tv_nsec + 500L) / 1000L;\n\n  /* On some systems, the usleep argument must be < 1000000 */\n  while (delta > 999999L)\n  {\n    usleep(999999);\n    delta -= 999999L;\n  }\n  if (delta > 0L)\n  {\n    usleep((useconds_t)delta);\n  }\n#endif\n\n  /* We don't support waking up prematurely (yet) */\n  if (remaining)\n  {\n    remaining->tv_sec = 0;\n    remaining->tv_nsec = 0;\n  }\n  return 0;\n}\n\nvoid thrd_yield(void)\n{\n#if defined(_TTHREAD_WIN32_)\n  Sleep(0);\n#else\n  sched_yield();\n#endif\n}\n\nint tss_create(tss_t *key, tss_dtor_t dtor)\n{\n#if defined(_TTHREAD_WIN32_)\n  /* FIXME: The destructor function is not supported yet... */\n  if (dtor != NULL)\n  {\n    return thrd_error;\n  }\n  *key = TlsAlloc();\n  if (*key == TLS_OUT_OF_INDEXES)\n  {\n    return thrd_error;\n  }\n#else\n  if (pthread_key_create(key, dtor) != 0)\n  {\n    return thrd_error;\n  }\n#endif\n  return thrd_success;\n}\n\nvoid tss_delete(tss_t key)\n{\n#if defined(_TTHREAD_WIN32_)\n  TlsFree(key);\n#else\n  pthread_key_delete(key);\n#endif\n}\n\nvoid *tss_get(tss_t key)\n{\n#if defined(_TTHREAD_WIN32_)\n  return TlsGetValue(key);\n#else\n  return pthread_getspecific(key);\n#endif\n}\n\nint tss_set(tss_t key, void *val)\n{\n#if defined(_TTHREAD_WIN32_)\n  if (TlsSetValue(key, val) == 0)\n  {\n    return thrd_error;\n  }\n#else\n  if (pthread_setspecific(key, val) != 0)\n  {\n    return thrd_error;\n  }\n#endif\n  return thrd_success;\n}\n\n#if defined(_TTHREAD_EMULATE_CLOCK_GETTIME_)\nint _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts)\n{\n#if defined(_TTHREAD_WIN32_)\n  struct _timeb tb;\n  _ftime(&tb);\n  ts->tv_sec = (time_t)tb.time;\n  ts->tv_nsec = 1000000L * (long)tb.millitm;\n#else\n  struct timeval tv;\n  gettimeofday(&tv, NULL);\n  ts->tv_sec = (time_t)tv.tv_sec;\n  ts->tv_nsec = 1000L * (long)tv.tv_usec;\n#endif\n  return 0;\n}\n#endif // _TTHREAD_EMULATE_CLOCK_GETTIME_\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/deps/tinycthread.h",
    "content": "/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-\nCopyright (c) 2012 Marcus Geelnard\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would be\n    appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not be\n    misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n*/\n\n#ifndef _TINYCTHREAD_H_\n#define _TINYCTHREAD_H_\n\n/**\n* @file\n* @mainpage TinyCThread API Reference\n*\n* @section intro_sec Introduction\n* TinyCThread is a minimal, portable implementation of basic threading\n* classes for C.\n*\n* They closely mimic the functionality and naming of the C11 standard, and\n* should be easily replaceable with the corresponding standard variants.\n*\n* @section port_sec Portability\n* The Win32 variant uses the native Win32 API for implementing the thread\n* classes, while for other systems, the POSIX threads API (pthread) is used.\n*\n* @section misc_sec Miscellaneous\n* The following special keywords are available: #_Thread_local.\n*\n* For more detailed information, browse the different sections of this\n* documentation. A good place to start is:\n* tinycthread.h.\n*/\n\n/* Which platform are we on? */\n#if !defined(_TTHREAD_PLATFORM_DEFINED_)\n  #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)\n    #define _TTHREAD_WIN32_\n  #else\n    #define _TTHREAD_POSIX_\n  #endif\n  #define _TTHREAD_PLATFORM_DEFINED_\n#endif\n\n/* Activate some POSIX functionality (e.g. clock_gettime and recursive mutexes) */\n#if defined(_TTHREAD_POSIX_)\n  #undef _FEATURES_H\n  #if !defined(_GNU_SOURCE)\n    #define _GNU_SOURCE\n  #endif\n  #if !defined(_POSIX_C_SOURCE) || ((_POSIX_C_SOURCE - 0) < 199309L)\n    #undef _POSIX_C_SOURCE\n    #define _POSIX_C_SOURCE 199309L\n  #endif\n  #if !defined(_XOPEN_SOURCE) || ((_XOPEN_SOURCE - 0) < 500)\n    #undef _XOPEN_SOURCE\n    #define _XOPEN_SOURCE 500\n  #endif\n#endif\n\n/* Generic includes */\n#include <time.h>\n\n/* Platform specific includes */\n#if defined(_TTHREAD_POSIX_)\n  #include <pthread.h>\n#elif defined(_TTHREAD_WIN32_)\n  #ifndef WIN32_LEAN_AND_MEAN\n    #define WIN32_LEAN_AND_MEAN\n    #define __UNDEF_LEAN_AND_MEAN\n  #endif\n  #include <windows.h>\n  #ifdef __UNDEF_LEAN_AND_MEAN\n    #undef WIN32_LEAN_AND_MEAN\n    #undef __UNDEF_LEAN_AND_MEAN\n  #endif\n#endif\n\n/* Workaround for missing TIME_UTC: If time.h doesn't provide TIME_UTC,\n   it's quite likely that libc does not support it either. Hence, fall back to\n   the only other supported time specifier: CLOCK_REALTIME (and if that fails,\n   we're probably emulating clock_gettime anyway, so anything goes). */\n#ifndef TIME_UTC\n  #ifdef CLOCK_REALTIME\n    #define TIME_UTC CLOCK_REALTIME\n  #else\n    #define TIME_UTC 0\n  #endif\n#endif\n\n/* Workaround for missing clock_gettime (most Windows compilers, afaik) */\n#if defined(_TTHREAD_WIN32_) || defined(__APPLE_CC__)\n#define _TTHREAD_EMULATE_CLOCK_GETTIME_\n/* Emulate struct timespec */\n#if defined(_TTHREAD_WIN32_)\nstruct _ttherad_timespec {\n  time_t tv_sec;\n  long   tv_nsec;\n};\n#define timespec _ttherad_timespec\n#endif\n\n/* Emulate clockid_t */\ntypedef int _tthread_clockid_t;\n#define clockid_t _tthread_clockid_t\n\n/* Emulate clock_gettime */\nint _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts);\n#define clock_gettime _tthread_clock_gettime\n#endif\n\n\n/** TinyCThread version (major number). */\n#define TINYCTHREAD_VERSION_MAJOR 1\n/** TinyCThread version (minor number). */\n#define TINYCTHREAD_VERSION_MINOR 1\n/** TinyCThread version (full version). */\n#define TINYCTHREAD_VERSION (TINYCTHREAD_VERSION_MAJOR * 100 + TINYCTHREAD_VERSION_MINOR)\n\n/**\n* @def _Thread_local\n* Thread local storage keyword.\n* A variable that is declared with the @c _Thread_local keyword makes the\n* value of the variable local to each thread (known as thread-local storage,\n* or TLS). Example usage:\n* @code\n* // This variable is local to each thread.\n* _Thread_local int variable;\n* @endcode\n* @note The @c _Thread_local keyword is a macro that maps to the corresponding\n* compiler directive (e.g. @c __declspec(thread)).\n* @note This directive is currently not supported on Mac OS X (it will give\n* a compiler error), since compile-time TLS is not supported in the Mac OS X\n* executable format. Also, some older versions of MinGW (before GCC 4.x) do\n* not support this directive.\n* @hideinitializer\n*/\n\n/* FIXME: Check for a PROPER value of __STDC_VERSION__ to know if we have C11 */\n#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201102L)) && !defined(_Thread_local)\n #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)\n  #define _Thread_local __thread\n #else\n  #define _Thread_local __declspec(thread)\n #endif\n#endif\n\n/* Macros */\n#define TSS_DTOR_ITERATIONS 0\n\n/* Function return values */\n#define thrd_error    0 /**< The requested operation failed */\n#define thrd_success  1 /**< The requested operation succeeded */\n#define thrd_timeout  2 /**< The time specified in the call was reached without acquiring the requested resource */\n#define thrd_busy     3 /**< The requested operation failed because a tesource requested by a test and return function is already in use */\n#define thrd_nomem    4 /**< The requested operation failed because it was unable to allocate memory */\n\n/* Mutex types */\n#define mtx_plain     1\n#define mtx_timed     2\n#define mtx_try       4\n#define mtx_recursive 8\n\n/* Mutex */\n#if defined(_TTHREAD_WIN32_)\ntypedef struct {\n  CRITICAL_SECTION mHandle;   /* Critical section handle */\n  int mAlreadyLocked;         /* TRUE if the mutex is already locked */\n  int mRecursive;             /* TRUE if the mutex is recursive */\n} mtx_t;\n#else\ntypedef pthread_mutex_t mtx_t;\n#endif\n\n/** Create a mutex object.\n* @param mtx A mutex object.\n* @param type Bit-mask that must have one of the following six values:\n*   @li @c mtx_plain for a simple non-recursive mutex\n*   @li @c mtx_timed for a non-recursive mutex that supports timeout\n*   @li @c mtx_try for a non-recursive mutex that supports test and return\n*   @li @c mtx_plain | @c mtx_recursive (same as @c mtx_plain, but recursive)\n*   @li @c mtx_timed | @c mtx_recursive (same as @c mtx_timed, but recursive)\n*   @li @c mtx_try | @c mtx_recursive (same as @c mtx_try, but recursive)\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint mtx_init(mtx_t *mtx, int type);\n\n/** Release any resources used by the given mutex.\n* @param mtx A mutex object.\n*/\nvoid mtx_destroy(mtx_t *mtx);\n\n/** Lock the given mutex.\n* Blocks until the given mutex can be locked. If the mutex is non-recursive, and\n* the calling thread already has a lock on the mutex, this call will block\n* forever.\n* @param mtx A mutex object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint mtx_lock(mtx_t *mtx);\n\n/** NOT YET IMPLEMENTED.\n*/\nint mtx_timedlock(mtx_t *mtx, const struct timespec *ts);\n\n/** Try to lock the given mutex.\n* The specified mutex shall support either test and return or timeout. If the\n* mutex is already locked, the function returns without blocking.\n* @param mtx A mutex object.\n* @return @ref thrd_success on success, or @ref thrd_busy if the resource\n* requested is already in use, or @ref thrd_error if the request could not be\n* honored.\n*/\nint mtx_trylock(mtx_t *mtx);\n\n/** Unlock the given mutex.\n* @param mtx A mutex object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint mtx_unlock(mtx_t *mtx);\n\n/* Condition variable */\n#if defined(_TTHREAD_WIN32_)\ntypedef struct {\n  HANDLE mEvents[2];                  /* Signal and broadcast event HANDLEs. */\n  unsigned int mWaitersCount;         /* Count of the number of waiters. */\n  CRITICAL_SECTION mWaitersCountLock; /* Serialize access to mWaitersCount. */\n} cnd_t;\n#else\ntypedef pthread_cond_t cnd_t;\n#endif\n\n/** Create a condition variable object.\n* @param cond A condition variable object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint cnd_init(cnd_t *cond);\n\n/** Release any resources used by the given condition variable.\n* @param cond A condition variable object.\n*/\nvoid cnd_destroy(cnd_t *cond);\n\n/** Signal a condition variable.\n* Unblocks one of the threads that are blocked on the given condition variable\n* at the time of the call. If no threads are blocked on the condition variable\n* at the time of the call, the function does nothing and return success.\n* @param cond A condition variable object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint cnd_signal(cnd_t *cond);\n\n/** Broadcast a condition variable.\n* Unblocks all of the threads that are blocked on the given condition variable\n* at the time of the call. If no threads are blocked on the condition variable\n* at the time of the call, the function does nothing and return success.\n* @param cond A condition variable object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint cnd_broadcast(cnd_t *cond);\n\n/** Wait for a condition variable to become signaled.\n* The function atomically unlocks the given mutex and endeavors to block until\n* the given condition variable is signaled by a call to cnd_signal or to\n* cnd_broadcast. When the calling thread becomes unblocked it locks the mutex\n* before it returns.\n* @param cond A condition variable object.\n* @param mtx A mutex object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint cnd_wait(cnd_t *cond, mtx_t *mtx);\n\n/** Wait for a condition variable to become signaled.\n* The function atomically unlocks the given mutex and endeavors to block until\n* the given condition variable is signaled by a call to cnd_signal or to\n* cnd_broadcast, or until after the specified time. When the calling thread\n* becomes unblocked it locks the mutex before it returns.\n* @param cond A condition variable object.\n* @param mtx A mutex object.\n* @param xt A point in time at which the request will time out (absolute time).\n* @return @ref thrd_success upon success, or @ref thrd_timeout if the time\n* specified in the call was reached without acquiring the requested resource, or\n* @ref thrd_error if the request could not be honored.\n*/\nint cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts);\n\n/* Thread */\n#if defined(_TTHREAD_WIN32_)\ntypedef HANDLE thrd_t;\n#else\ntypedef pthread_t thrd_t;\n#endif\n\n/** Thread start function.\n* Any thread that is started with the @ref thrd_create() function must be\n* started through a function of this type.\n* @param arg The thread argument (the @c arg argument of the corresponding\n*        @ref thrd_create() call).\n* @return The thread return value, which can be obtained by another thread\n* by using the @ref thrd_join() function.\n*/\ntypedef int (*thrd_start_t)(void *arg);\n\n/** Create a new thread.\n* @param thr Identifier of the newly created thread.\n* @param func A function pointer to the function that will be executed in\n*        the new thread.\n* @param arg An argument to the thread function.\n* @return @ref thrd_success on success, or @ref thrd_nomem if no memory could\n* be allocated for the thread requested, or @ref thrd_error if the request\n* could not be honored.\n* @note A thread’s identifier may be reused for a different thread once the\n* original thread has exited and either been detached or joined to another\n* thread.\n*/\nint thrd_create(thrd_t *thr, thrd_start_t func, void *arg);\n\n/** Identify the calling thread.\n* @return The identifier of the calling thread.\n*/\nthrd_t thrd_current(void);\n\n/** NOT YET IMPLEMENTED.\n*/\nint thrd_detach(thrd_t thr);\n\n/** Compare two thread identifiers.\n* The function determines if two thread identifiers refer to the same thread.\n* @return Zero if the two thread identifiers refer to different threads.\n* Otherwise a nonzero value is returned.\n*/\nint thrd_equal(thrd_t thr0, thrd_t thr1);\n\n/** Terminate execution of the calling thread.\n* @param res Result code of the calling thread.\n*/\nvoid thrd_exit(int res);\n\n/** Wait for a thread to terminate.\n* The function joins the given thread with the current thread by blocking\n* until the other thread has terminated.\n* @param thr The thread to join with.\n* @param res If this pointer is not NULL, the function will store the result\n*        code of the given thread in the integer pointed to by @c res.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint thrd_join(thrd_t thr, int *res);\n\n/** Put the calling thread to sleep.\n* Suspend execution of the calling thread.\n* @param time_point A point in time at which the thread will resume (absolute time).\n* @param remaining If non-NULL, this parameter will hold the remaining time until\n*                  time_point upon return. This will typically be zero, but if\n*                  the thread was woken up by a signal that is not ignored before\n*                  time_point was reached @c remaining will hold a positive\n*                  time.\n* @return 0 (zero) on successful sleep, or -1 if an interrupt occurred.\n*/\nint thrd_sleep(const struct timespec *time_point, struct timespec *remaining);\n\n/** Yield execution to another thread.\n* Permit other threads to run, even if the current thread would ordinarily\n* continue to run.\n*/\nvoid thrd_yield(void);\n\n/* Thread local storage */\n#if defined(_TTHREAD_WIN32_)\ntypedef DWORD tss_t;\n#else\ntypedef pthread_key_t tss_t;\n#endif\n\n/** Destructor function for a thread-specific storage.\n* @param val The value of the destructed thread-specific storage.\n*/\ntypedef void (*tss_dtor_t)(void *val);\n\n/** Create a thread-specific storage.\n* @param key The unique key identifier that will be set if the function is\n*        successful.\n* @param dtor Destructor function. This can be NULL.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n* @note The destructor function is not supported under Windows. If @c dtor is\n* not NULL when calling this function under Windows, the function will fail\n* and return @ref thrd_error.\n*/\nint tss_create(tss_t *key, tss_dtor_t dtor);\n\n/** Delete a thread-specific storage.\n* The function releases any resources used by the given thread-specific\n* storage.\n* @param key The key that shall be deleted.\n*/\nvoid tss_delete(tss_t key);\n\n/** Get the value for a thread-specific storage.\n* @param key The thread-specific storage identifier.\n* @return The value for the current thread held in the given thread-specific\n* storage.\n*/\nvoid *tss_get(tss_t key);\n\n/** Set the value for a thread-specific storage.\n* @param key The thread-specific storage identifier.\n* @param val The value of the thread-specific storage to set for the current\n*        thread.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint tss_set(tss_t key, void *val);\n\n\n#endif /* _TINYTHREAD_H_ */\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/include/GLFW/glfw3.h",
    "content": "/*************************************************************************\n * GLFW - An OpenGL library\n * API version: 3.0\n * WWW:         http://www.glfw.org/\n *------------------------------------------------------------------------\n * Copyright (c) 2002-2006 Marcus Geelnard\n * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n *\n * This software is provided 'as-is', without any express or implied\n * warranty. In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would\n *    be appreciated but is not required.\n *\n * 2. Altered source versions must be plainly marked as such, and must not\n *    be misrepresented as being the original software.\n *\n * 3. This notice may not be removed or altered from any source\n *    distribution.\n *\n *************************************************************************/\n\n#ifndef _glfw3_h_\n#define _glfw3_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/*************************************************************************\n * Doxygen documentation\n *************************************************************************/\n\n/*! @defgroup clipboard Clipboard support\n */\n/*! @defgroup context Context handling\n */\n/*! @defgroup error Error handling\n */\n/*! @defgroup gamma Gamma ramp support\n */\n/*! @defgroup init Initialization and version information\n */\n/*! @defgroup input Input handling\n */\n/*! @defgroup monitor Monitor handling\n */\n/*! @defgroup time Time input\n */\n/*! @defgroup window Window handling\n *\n *  This is the reference documentation for the window handling API, including\n *  creation, deletion and event polling.  For more information, see the\n *  [article on window handling](@ref window).\n */\n\n\n/*************************************************************************\n * Global definitions\n *************************************************************************/\n\n/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */\n\n/* Please report any problems that you find with your compiler, which may\n * be solved in this section! There are several compilers that I have not\n * been able to test this file with yet.\n *\n * First: If we are we on Windows, we want a single define for it (_WIN32)\n * (Note: For Cygwin the compiler flag -mwin32 should be used, but to\n * make sure that things run smoothly for Cygwin users, we add __CYGWIN__\n * to the list of \"valid Win32 identifiers\", which removes the need for\n * -mwin32)\n */\n#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))\n #define _WIN32\n#endif /* _WIN32 */\n\n/* In order for extension support to be portable, we need to define an\n * OpenGL function call method. We use the keyword APIENTRY, which is\n * defined for Win32. (Note: Windows also needs this for <GL/gl.h>)\n */\n#ifndef APIENTRY\n #ifdef _WIN32\n  #define APIENTRY __stdcall\n #else\n  #define APIENTRY\n #endif\n#endif /* APIENTRY */\n\n/* The following three defines are here solely to make some Windows-based\n * <GL/gl.h> files happy. Theoretically we could include <windows.h>, but\n * it has the major drawback of severely polluting our namespace.\n */\n\n/* Under Windows, we need WINGDIAPI defined */\n#if !defined(WINGDIAPI) && defined(_WIN32)\n #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)\n  /* Microsoft Visual C++, Borland C++ Builder and Pelles C */\n  #define WINGDIAPI __declspec(dllimport)\n #elif defined(__LCC__)\n  /* LCC-Win32 */\n  #define WINGDIAPI __stdcall\n #else\n  /* Others (e.g. MinGW, Cygwin) */\n  #define WINGDIAPI extern\n #endif\n #define GLFW_WINGDIAPI_DEFINED\n#endif /* WINGDIAPI */\n\n/* Some <GL/glu.h> files also need CALLBACK defined */\n#if !defined(CALLBACK) && defined(_WIN32)\n #if defined(_MSC_VER)\n  /* Microsoft Visual C++ */\n  #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)\n   #define CALLBACK __stdcall\n  #else\n   #define CALLBACK\n  #endif\n #else\n  /* Other Windows compilers */\n  #define CALLBACK __stdcall\n #endif\n #define GLFW_CALLBACK_DEFINED\n#endif /* CALLBACK */\n\n/* Most <GL/glu.h> variants on Windows need wchar_t */\n#if defined(_WIN32)\n #include <stddef.h>\n#endif\n\n\n/* ---------------- GLFW related system specific defines ----------------- */\n\n#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)\n #error \"You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined\"\n#endif\n\n#if defined(_WIN32) && defined(_GLFW_BUILD_DLL)\n\n /* We are building a Win32 DLL */\n #define GLFWAPI __declspec(dllexport)\n\n#elif defined(_WIN32) && defined(GLFW_DLL)\n\n /* We are calling a Win32 DLL */\n #if defined(__LCC__)\n  #define GLFWAPI extern\n #else\n  #define GLFWAPI __declspec(dllimport)\n #endif\n\n#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL)\n\n #define GLFWAPI __attribute__((visibility(\"default\")))\n\n#else\n\n /* We are either building/calling a static lib or we are non-win32 */\n #define GLFWAPI\n\n#endif\n\n/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */\n\n/* Include the chosen client API headers.\n */\n#if defined(__APPLE_CC__)\n  #if defined(GLFW_INCLUDE_GLCOREARB)\n    #include <OpenGL/gl3.h>\n  #elif !defined(GLFW_INCLUDE_NONE)\n    #define GL_GLEXT_LEGACY\n    #include <OpenGL/gl.h>\n  #endif\n  #if defined(GLFW_INCLUDE_GLU)\n    #include <OpenGL/glu.h>\n  #endif\n#else\n  #if defined(GLFW_INCLUDE_GLCOREARB)\n    #include <GL/glcorearb.h>\n  #elif defined(GLFW_INCLUDE_ES1)\n    #include <GLES/gl.h>\n  #elif defined(GLFW_INCLUDE_ES2)\n    #include <GLES2/gl2.h>\n  #elif defined(GLFW_INCLUDE_ES3)\n    #include <GLES3/gl3.h>\n  #elif !defined(GLFW_INCLUDE_NONE)\n    #include <GL/gl.h>\n  #endif\n  #if defined(GLFW_INCLUDE_GLU)\n    #include <GL/glu.h>\n  #endif\n#endif\n\n\n/*************************************************************************\n * GLFW API tokens\n *************************************************************************/\n\n/*! @name GLFW version macros\n *  @{ */\n/*! @brief The major version number of the GLFW library.\n *\n *  This is incremented when the API is changed in non-compatible ways.\n *  @ingroup init\n */\n#define GLFW_VERSION_MAJOR          3\n/*! @brief The minor version number of the GLFW library.\n *\n *  This is incremented when features are added to the API but it remains\n *  backward-compatible.\n *  @ingroup init\n */\n#define GLFW_VERSION_MINOR          0\n/*! @brief The revision number of the GLFW library.\n *\n *  This is incremented when a bug fix release is made that does not contain any\n *  API changes.\n *  @ingroup init\n */\n#define GLFW_VERSION_REVISION       1\n/*! @} */\n\n/*! @name Key and button actions\n *  @{ */\n/*! @brief The key or button was released.\n *  @ingroup input\n */\n#define GLFW_RELEASE                0\n/*! @brief The key or button was pressed.\n *  @ingroup input\n */\n#define GLFW_PRESS                  1\n/*! @brief The key was held down until it repeated.\n *  @ingroup input\n */\n#define GLFW_REPEAT                 2\n/*! @} */\n\n/*! @defgroup keys Keyboard keys\n *\n * These key codes are inspired by the *USB HID Usage Tables v1.12* (p. 53-60),\n * but re-arranged to map to 7-bit ASCII for printable keys (function keys are\n * put in the 256+ range).\n *\n * The naming of the key codes follow these rules:\n *  - The US keyboard layout is used\n *  - Names of printable alpha-numeric characters are used (e.g. \"A\", \"R\",\n *    \"3\", etc.)\n *  - For non-alphanumeric characters, Unicode:ish names are used (e.g.\n *    \"COMMA\", \"LEFT_SQUARE_BRACKET\", etc.). Note that some names do not\n *    correspond to the Unicode standard (usually for brevity)\n *  - Keys that lack a clear US mapping are named \"WORLD_x\"\n *  - For non-printable keys, custom names are used (e.g. \"F4\",\n *    \"BACKSPACE\", etc.)\n *\n *  @ingroup input\n *  @{\n */\n\n/* The unknown key */\n#define GLFW_KEY_UNKNOWN            -1\n\n/* Printable keys */\n#define GLFW_KEY_SPACE              32\n#define GLFW_KEY_APOSTROPHE         39  /* ' */\n#define GLFW_KEY_COMMA              44  /* , */\n#define GLFW_KEY_MINUS              45  /* - */\n#define GLFW_KEY_PERIOD             46  /* . */\n#define GLFW_KEY_SLASH              47  /* / */\n#define GLFW_KEY_0                  48\n#define GLFW_KEY_1                  49\n#define GLFW_KEY_2                  50\n#define GLFW_KEY_3                  51\n#define GLFW_KEY_4                  52\n#define GLFW_KEY_5                  53\n#define GLFW_KEY_6                  54\n#define GLFW_KEY_7                  55\n#define GLFW_KEY_8                  56\n#define GLFW_KEY_9                  57\n#define GLFW_KEY_SEMICOLON          59  /* ; */\n#define GLFW_KEY_EQUAL              61  /* = */\n#define GLFW_KEY_A                  65\n#define GLFW_KEY_B                  66\n#define GLFW_KEY_C                  67\n#define GLFW_KEY_D                  68\n#define GLFW_KEY_E                  69\n#define GLFW_KEY_F                  70\n#define GLFW_KEY_G                  71\n#define GLFW_KEY_H                  72\n#define GLFW_KEY_I                  73\n#define GLFW_KEY_J                  74\n#define GLFW_KEY_K                  75\n#define GLFW_KEY_L                  76\n#define GLFW_KEY_M                  77\n#define GLFW_KEY_N                  78\n#define GLFW_KEY_O                  79\n#define GLFW_KEY_P                  80\n#define GLFW_KEY_Q                  81\n#define GLFW_KEY_R                  82\n#define GLFW_KEY_S                  83\n#define GLFW_KEY_T                  84\n#define GLFW_KEY_U                  85\n#define GLFW_KEY_V                  86\n#define GLFW_KEY_W                  87\n#define GLFW_KEY_X                  88\n#define GLFW_KEY_Y                  89\n#define GLFW_KEY_Z                  90\n#define GLFW_KEY_LEFT_BRACKET       91  /* [ */\n#define GLFW_KEY_BACKSLASH          92  /* \\ */\n#define GLFW_KEY_RIGHT_BRACKET      93  /* ] */\n#define GLFW_KEY_GRAVE_ACCENT       96  /* ` */\n#define GLFW_KEY_WORLD_1            161 /* non-US #1 */\n#define GLFW_KEY_WORLD_2            162 /* non-US #2 */\n\n/* Function keys */\n#define GLFW_KEY_ESCAPE             256\n#define GLFW_KEY_ENTER              257\n#define GLFW_KEY_TAB                258\n#define GLFW_KEY_BACKSPACE          259\n#define GLFW_KEY_INSERT             260\n#define GLFW_KEY_DELETE             261\n#define GLFW_KEY_RIGHT              262\n#define GLFW_KEY_LEFT               263\n#define GLFW_KEY_DOWN               264\n#define GLFW_KEY_UP                 265\n#define GLFW_KEY_PAGE_UP            266\n#define GLFW_KEY_PAGE_DOWN          267\n#define GLFW_KEY_HOME               268\n#define GLFW_KEY_END                269\n#define GLFW_KEY_CAPS_LOCK          280\n#define GLFW_KEY_SCROLL_LOCK        281\n#define GLFW_KEY_NUM_LOCK           282\n#define GLFW_KEY_PRINT_SCREEN       283\n#define GLFW_KEY_PAUSE              284\n#define GLFW_KEY_F1                 290\n#define GLFW_KEY_F2                 291\n#define GLFW_KEY_F3                 292\n#define GLFW_KEY_F4                 293\n#define GLFW_KEY_F5                 294\n#define GLFW_KEY_F6                 295\n#define GLFW_KEY_F7                 296\n#define GLFW_KEY_F8                 297\n#define GLFW_KEY_F9                 298\n#define GLFW_KEY_F10                299\n#define GLFW_KEY_F11                300\n#define GLFW_KEY_F12                301\n#define GLFW_KEY_F13                302\n#define GLFW_KEY_F14                303\n#define GLFW_KEY_F15                304\n#define GLFW_KEY_F16                305\n#define GLFW_KEY_F17                306\n#define GLFW_KEY_F18                307\n#define GLFW_KEY_F19                308\n#define GLFW_KEY_F20                309\n#define GLFW_KEY_F21                310\n#define GLFW_KEY_F22                311\n#define GLFW_KEY_F23                312\n#define GLFW_KEY_F24                313\n#define GLFW_KEY_F25                314\n#define GLFW_KEY_KP_0               320\n#define GLFW_KEY_KP_1               321\n#define GLFW_KEY_KP_2               322\n#define GLFW_KEY_KP_3               323\n#define GLFW_KEY_KP_4               324\n#define GLFW_KEY_KP_5               325\n#define GLFW_KEY_KP_6               326\n#define GLFW_KEY_KP_7               327\n#define GLFW_KEY_KP_8               328\n#define GLFW_KEY_KP_9               329\n#define GLFW_KEY_KP_DECIMAL         330\n#define GLFW_KEY_KP_DIVIDE          331\n#define GLFW_KEY_KP_MULTIPLY        332\n#define GLFW_KEY_KP_SUBTRACT        333\n#define GLFW_KEY_KP_ADD             334\n#define GLFW_KEY_KP_ENTER           335\n#define GLFW_KEY_KP_EQUAL           336\n#define GLFW_KEY_LEFT_SHIFT         340\n#define GLFW_KEY_LEFT_CONTROL       341\n#define GLFW_KEY_LEFT_ALT           342\n#define GLFW_KEY_LEFT_SUPER         343\n#define GLFW_KEY_RIGHT_SHIFT        344\n#define GLFW_KEY_RIGHT_CONTROL      345\n#define GLFW_KEY_RIGHT_ALT          346\n#define GLFW_KEY_RIGHT_SUPER        347\n#define GLFW_KEY_MENU               348\n#define GLFW_KEY_LAST               GLFW_KEY_MENU\n\n/*! @} */\n\n/*! @defgroup mods Modifier key flags\n *  @ingroup input\n *  @{ */\n\n/*! @brief If this bit is set one or more Shift keys were held down.\n */\n#define GLFW_MOD_SHIFT           0x0001\n/*! @brief If this bit is set one or more Control keys were held down.\n */\n#define GLFW_MOD_CONTROL         0x0002\n/*! @brief If this bit is set one or more Alt keys were held down.\n */\n#define GLFW_MOD_ALT             0x0004\n/*! @brief If this bit is set one or more Super keys were held down.\n */\n#define GLFW_MOD_SUPER           0x0008\n\n/*! @} */\n\n/*! @defgroup buttons Mouse buttons\n *  @ingroup input\n *  @{ */\n#define GLFW_MOUSE_BUTTON_1         0\n#define GLFW_MOUSE_BUTTON_2         1\n#define GLFW_MOUSE_BUTTON_3         2\n#define GLFW_MOUSE_BUTTON_4         3\n#define GLFW_MOUSE_BUTTON_5         4\n#define GLFW_MOUSE_BUTTON_6         5\n#define GLFW_MOUSE_BUTTON_7         6\n#define GLFW_MOUSE_BUTTON_8         7\n#define GLFW_MOUSE_BUTTON_LAST      GLFW_MOUSE_BUTTON_8\n#define GLFW_MOUSE_BUTTON_LEFT      GLFW_MOUSE_BUTTON_1\n#define GLFW_MOUSE_BUTTON_RIGHT     GLFW_MOUSE_BUTTON_2\n#define GLFW_MOUSE_BUTTON_MIDDLE    GLFW_MOUSE_BUTTON_3\n/*! @} */\n\n/*! @defgroup joysticks Joysticks\n *  @ingroup input\n *  @{ */\n#define GLFW_JOYSTICK_1             0\n#define GLFW_JOYSTICK_2             1\n#define GLFW_JOYSTICK_3             2\n#define GLFW_JOYSTICK_4             3\n#define GLFW_JOYSTICK_5             4\n#define GLFW_JOYSTICK_6             5\n#define GLFW_JOYSTICK_7             6\n#define GLFW_JOYSTICK_8             7\n#define GLFW_JOYSTICK_9             8\n#define GLFW_JOYSTICK_10            9\n#define GLFW_JOYSTICK_11            10\n#define GLFW_JOYSTICK_12            11\n#define GLFW_JOYSTICK_13            12\n#define GLFW_JOYSTICK_14            13\n#define GLFW_JOYSTICK_15            14\n#define GLFW_JOYSTICK_16            15\n#define GLFW_JOYSTICK_LAST          GLFW_JOYSTICK_16\n/*! @} */\n\n/*! @defgroup errors Error codes\n *  @ingroup error\n *  @{ */\n/*! @brief GLFW has not been initialized.\n */\n#define GLFW_NOT_INITIALIZED        0x00010001\n/*! @brief No context is current for this thread.\n */\n#define GLFW_NO_CURRENT_CONTEXT     0x00010002\n/*! @brief One of the enum parameters for the function was given an invalid\n *  enum.\n */\n#define GLFW_INVALID_ENUM           0x00010003\n/*! @brief One of the parameters for the function was given an invalid value.\n */\n#define GLFW_INVALID_VALUE          0x00010004\n/*! @brief A memory allocation failed.\n */\n#define GLFW_OUT_OF_MEMORY          0x00010005\n/*! @brief GLFW could not find support for the requested client API on the\n *  system.\n */\n#define GLFW_API_UNAVAILABLE        0x00010006\n/*! @brief The requested client API version is not available.\n */\n#define GLFW_VERSION_UNAVAILABLE    0x00010007\n/*! @brief A platform-specific error occurred that does not match any of the\n *  more specific categories.\n */\n#define GLFW_PLATFORM_ERROR         0x00010008\n/*! @brief The clipboard did not contain data in the requested format.\n */\n#define GLFW_FORMAT_UNAVAILABLE     0x00010009\n/*! @} */\n\n#define GLFW_FOCUSED                0x00020001\n#define GLFW_ICONIFIED              0x00020002\n#define GLFW_RESIZABLE              0x00020003\n#define GLFW_VISIBLE                0x00020004\n#define GLFW_DECORATED              0x00020005\n\n#define GLFW_RED_BITS               0x00021001\n#define GLFW_GREEN_BITS             0x00021002\n#define GLFW_BLUE_BITS              0x00021003\n#define GLFW_ALPHA_BITS             0x00021004\n#define GLFW_DEPTH_BITS             0x00021005\n#define GLFW_STENCIL_BITS           0x00021006\n#define GLFW_ACCUM_RED_BITS         0x00021007\n#define GLFW_ACCUM_GREEN_BITS       0x00021008\n#define GLFW_ACCUM_BLUE_BITS        0x00021009\n#define GLFW_ACCUM_ALPHA_BITS       0x0002100A\n#define GLFW_AUX_BUFFERS            0x0002100B\n#define GLFW_STEREO                 0x0002100C\n#define GLFW_SAMPLES                0x0002100D\n#define GLFW_SRGB_CAPABLE           0x0002100E\n#define GLFW_REFRESH_RATE           0x0002100F\n\n#define GLFW_CLIENT_API             0x00022001\n#define GLFW_CONTEXT_VERSION_MAJOR  0x00022002\n#define GLFW_CONTEXT_VERSION_MINOR  0x00022003\n#define GLFW_CONTEXT_REVISION       0x00022004\n#define GLFW_CONTEXT_ROBUSTNESS     0x00022005\n#define GLFW_OPENGL_FORWARD_COMPAT  0x00022006\n#define GLFW_OPENGL_DEBUG_CONTEXT   0x00022007\n#define GLFW_OPENGL_PROFILE         0x00022008\n\n#define GLFW_OPENGL_API             0x00030001\n#define GLFW_OPENGL_ES_API          0x00030002\n\n#define GLFW_NO_ROBUSTNESS                   0\n#define GLFW_NO_RESET_NOTIFICATION  0x00031001\n#define GLFW_LOSE_CONTEXT_ON_RESET  0x00031002\n\n#define GLFW_OPENGL_ANY_PROFILE              0\n#define GLFW_OPENGL_CORE_PROFILE    0x00032001\n#define GLFW_OPENGL_COMPAT_PROFILE  0x00032002\n\n#define GLFW_CURSOR                 0x00033001\n#define GLFW_STICKY_KEYS            0x00033002\n#define GLFW_STICKY_MOUSE_BUTTONS   0x00033003\n\n#define GLFW_CURSOR_NORMAL          0x00034001\n#define GLFW_CURSOR_HIDDEN          0x00034002\n#define GLFW_CURSOR_DISABLED        0x00034003\n\n#define GLFW_CONNECTED              0x00040001\n#define GLFW_DISCONNECTED           0x00040002\n\n\n/*************************************************************************\n * GLFW API types\n *************************************************************************/\n\n/*! @brief Client API function pointer type.\n *\n *  Generic function pointer used for returning client API function pointers\n *  without forcing a cast from a regular pointer.\n *\n *  @ingroup context\n */\ntypedef void (*GLFWglproc)(void);\n\n/*! @brief Opaque monitor object.\n *\n *  Opaque monitor object.\n *\n *  @ingroup monitor\n */\ntypedef struct GLFWmonitor GLFWmonitor;\n\n/*! @brief Opaque window object.\n *\n *  Opaque window object.\n *\n *  @ingroup window\n */\ntypedef struct GLFWwindow GLFWwindow;\n\n/*! @brief The function signature for error callbacks.\n *\n *  This is the function signature for error callback functions.\n *\n *  @param[in] error An [error code](@ref errors).\n *  @param[in] description A UTF-8 encoded string describing the error.\n *\n *  @sa glfwSetErrorCallback\n *\n *  @ingroup error\n */\ntypedef void (* GLFWerrorfun)(int,const char*);\n\n/*! @brief The function signature for window position callbacks.\n *\n *  This is the function signature for window position callback functions.\n *\n *  @param[in] window The window that the user moved.\n *  @param[in] xpos The new x-coordinate, in screen coordinates, of the\n *  upper-left corner of the client area of the window.\n *  @param[in] ypos The new y-coordinate, in screen coordinates, of the\n *  upper-left corner of the client area of the window.\n *\n *  @sa glfwSetWindowPosCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for window resize callbacks.\n *\n *  This is the function signature for window size callback functions.\n *\n *  @param[in] window The window that the user resized.\n *  @param[in] width The new width, in screen coordinates, of the window.\n *  @param[in] height The new height, in screen coordinates, of the window.\n *\n *  @sa glfwSetWindowSizeCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for window close callbacks.\n *\n *  This is the function signature for window close callback functions.\n *\n *  @param[in] window The window that the user attempted to close.\n *\n *  @sa glfwSetWindowCloseCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowclosefun)(GLFWwindow*);\n\n/*! @brief The function signature for window content refresh callbacks.\n *\n *  This is the function signature for window refresh callback functions.\n *\n *  @param[in] window The window whose content needs to be refreshed.\n *\n *  @sa glfwSetWindowRefreshCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowrefreshfun)(GLFWwindow*);\n\n/*! @brief The function signature for window focus/defocus callbacks.\n *\n *  This is the function signature for window focus callback functions.\n *\n *  @param[in] window The window that was focused or defocused.\n *  @param[in] focused `GL_TRUE` if the window was focused, or `GL_FALSE` if\n *  it was defocused.\n *\n *  @sa glfwSetWindowFocusCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for window iconify/restore callbacks.\n *\n *  This is the function signature for window iconify/restore callback\n *  functions.\n *\n *  @param[in] window The window that was iconified or restored.\n *  @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`\n *  if it was restored.\n *\n *  @sa glfwSetWindowIconifyCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for framebuffer resize callbacks.\n *\n *  This is the function signature for framebuffer resize callback\n *  functions.\n *\n *  @param[in] window The window whose framebuffer was resized.\n *  @param[in] width The new width, in pixels, of the framebuffer.\n *  @param[in] height The new height, in pixels, of the framebuffer.\n *\n *  @sa glfwSetFramebufferSizeCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for mouse button callbacks.\n *\n *  This is the function signature for mouse button callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] button The [mouse button](@ref buttons) that was pressed or\n *  released.\n *  @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were\n *  held down.\n *\n *  @sa glfwSetMouseButtonCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int);\n\n/*! @brief The function signature for cursor position callbacks.\n *\n *  This is the function signature for cursor position callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] xpos The new x-coordinate of the cursor.\n *  @param[in] ypos The new y-coordinate of the cursor.\n *\n *  @sa glfwSetCursorPosCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);\n\n/*! @brief The function signature for cursor enter/leave callbacks.\n *\n *  This is the function signature for cursor enter/leave callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] entered `GL_TRUE` if the cursor entered the window's client\n *  area, or `GL_FALSE` if it left it.\n *\n *  @sa glfwSetCursorEnterCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcursorenterfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for scroll callbacks.\n *\n *  This is the function signature for scroll callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] xoffset The scroll offset along the x-axis.\n *  @param[in] yoffset The scroll offset along the y-axis.\n *\n *  @sa glfwSetScrollCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWscrollfun)(GLFWwindow*,double,double);\n\n/*! @brief The function signature for keyboard key callbacks.\n *\n *  This is the function signature for keyboard key callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] key The [keyboard key](@ref keys) that was pressed or released.\n *  @param[in] scancode The system-specific scancode of the key.\n *  @param[in] action @ref GLFW_PRESS, @ref GLFW_RELEASE or @ref GLFW_REPEAT.\n *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were\n *  held down.\n *\n *  @sa glfwSetKeyCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);\n\n/*! @brief The function signature for Unicode character callbacks.\n *\n *  This is the function signature for Unicode character callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] character The Unicode code point of the character.\n *\n *  @sa glfwSetCharCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);\n\n/*! @brief The function signature for monitor configuration callbacks.\n *\n *  This is the function signature for monitor configuration callback functions.\n *\n *  @param[in] monitor The monitor that was connected or disconnected.\n *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.\n *\n *  @sa glfwSetMonitorCallback\n *\n *  @ingroup monitor\n */\ntypedef void (* GLFWmonitorfun)(GLFWmonitor*,int);\n\n/*! @brief Video mode type.\n *\n *  This describes a single video mode.\n *\n *  @ingroup monitor\n */\ntypedef struct\n{\n    /*! The width, in screen coordinates, of the video mode.\n     */\n    int width;\n    /*! The height, in screen coordinates, of the video mode.\n     */\n    int height;\n    /*! The bit depth of the red channel of the video mode.\n     */\n    int redBits;\n    /*! The bit depth of the green channel of the video mode.\n     */\n    int greenBits;\n    /*! The bit depth of the blue channel of the video mode.\n     */\n    int blueBits;\n    /*! The refresh rate, in Hz, of the video mode.\n     */\n    int refreshRate;\n} GLFWvidmode;\n\n/*! @brief Gamma ramp.\n *\n *  This describes the gamma ramp for a monitor.\n *\n *  @sa glfwGetGammaRamp glfwSetGammaRamp\n *\n *  @ingroup gamma\n */\ntypedef struct\n{\n    /*! An array of value describing the response of the red channel.\n     */\n    unsigned short* red;\n    /*! An array of value describing the response of the green channel.\n     */\n    unsigned short* green;\n    /*! An array of value describing the response of the blue channel.\n     */\n    unsigned short* blue;\n    /*! The number of elements in each array.\n     */\n    unsigned int size;\n} GLFWgammaramp;\n\n\n/*************************************************************************\n * GLFW API functions\n *************************************************************************/\n\n/*! @brief Initializes the GLFW library.\n *\n *  This function initializes the GLFW library.  Before most GLFW functions can\n *  be used, GLFW must be initialized, and before a program terminates GLFW\n *  should be terminated in order to free any resources allocated during or\n *  after initialization.\n *\n *  If this function fails, it calls @ref glfwTerminate before returning.  If it\n *  succeeds, you should call @ref glfwTerminate before the program exits.\n *\n *  Additional calls to this function after successful initialization but before\n *  termination will succeed but will do nothing.\n *\n *  @return `GL_TRUE` if successful, or `GL_FALSE` if an error occurred.\n *\n *  @par New in GLFW 3\n *  This function no longer registers @ref glfwTerminate with `atexit`.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may take several seconds to complete on some systems,\n *  while on other systems it may take only a fraction of a second to complete.\n *\n *  @note **Mac OS X:** This function will change the current directory of the\n *  application to the `Contents/Resources` subdirectory of the application's\n *  bundle, if present.\n *\n *  @sa glfwTerminate\n *\n *  @ingroup init\n */\nGLFWAPI int glfwInit(void);\n\n/*! @brief Terminates the GLFW library.\n *\n *  This function destroys all remaining windows, frees any allocated resources\n *  and sets the library to an uninitialized state.  Once this is called, you\n *  must again call @ref glfwInit successfully before you will be able to use\n *  most GLFW functions.\n *\n *  If GLFW has been successfully initialized, this function should be called\n *  before the program exits.  If initialization fails, there is no need to call\n *  this function, as it is called by @ref glfwInit before it returns failure.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @warning No window's context may be current on another thread when this\n *  function is called.\n *\n *  @sa glfwInit\n *\n *  @ingroup init\n */\nGLFWAPI void glfwTerminate(void);\n\n/*! @brief Retrieves the version of the GLFW library.\n *\n *  This function retrieves the major, minor and revision numbers of the GLFW\n *  library.  It is intended for when you are using GLFW as a shared library and\n *  want to ensure that you are using the minimum required version.\n *\n *  @param[out] major Where to store the major version number, or `NULL`.\n *  @param[out] minor Where to store the minor version number, or `NULL`.\n *  @param[out] rev Where to store the revision number, or `NULL`.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @remarks This function may be called from any thread.\n *\n *  @sa glfwGetVersionString\n *\n *  @ingroup init\n */\nGLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);\n\n/*! @brief Returns a string describing the compile-time configuration.\n *\n *  This function returns a static string generated at compile-time according to\n *  which configuration macros were defined.  This is intended for use when\n *  submitting bug reports, to allow developers to see which code paths are\n *  enabled in a binary.\n *\n *  The format of the string is as follows:\n *  - The version of GLFW\n *  - The name of the window system API\n *  - The name of the context creation API\n *  - Any additional options or APIs\n *\n *  For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL\n *  back ends, the version string may look something like this:\n *\n *      3.0.0 Win32 WGL MinGW\n *\n *  @return The GLFW version string.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @remarks This function may be called from any thread.\n *\n *  @sa glfwGetVersion\n *\n *  @ingroup init\n */\nGLFWAPI const char* glfwGetVersionString(void);\n\n/*! @brief Sets the error callback.\n *\n *  This function sets the error callback, which is called with an error code\n *  and a human-readable description each time a GLFW error occurs.\n *\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @note The error callback is called by the thread where the error was\n *  generated.  If you are using GLFW from multiple threads, your error callback\n *  needs to be written accordingly.\n *\n *  @note Because the description string provided to the callback may have been\n *  generated specifically for that error, it is not guaranteed to be valid\n *  after the callback has returned.  If you wish to use it after that, you need\n *  to make your own copy of it before returning.\n *\n *  @ingroup error\n */\nGLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);\n\n/*! @brief Returns the currently connected monitors.\n *\n *  This function returns an array of handles for all currently connected\n *  monitors.\n *\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of monitor handles, or `NULL` if an error occurred.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the monitor configuration\n *  changes.  See @ref glfwSetMonitorCallback to receive notifications of\n *  configuration changes.\n *\n *  @sa glfwGetPrimaryMonitor\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitor** glfwGetMonitors(int* count);\n\n/*! @brief Returns the primary monitor.\n *\n *  This function returns the primary monitor.  This is usually the monitor\n *  where elements like the Windows task bar or the OS X menu bar is located.\n *\n *  @return The primary monitor, or `NULL` if an error occurred.\n *\n *  @sa glfwGetMonitors\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);\n\n/*! @brief Returns the position of the monitor's viewport on the virtual screen.\n *\n *  This function returns the position, in screen coordinates, of the upper-left\n *  corner of the specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.\n *  @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);\n\n/*! @brief Returns the physical size of the monitor.\n *\n *  This function returns the size, in millimetres, of the display area of the\n *  specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] width Where to store the width, in mm, of the monitor's display\n *  area, or `NULL`.\n *  @param[out] height Where to store the height, in mm, of the monitor's\n *  display area, or `NULL`.\n *\n *  @note Some operating systems do not provide accurate information, either\n *  because the monitor's EDID data is incorrect, or because the driver does not\n *  report it accurately.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* height);\n\n/*! @brief Returns the name of the specified monitor.\n *\n *  This function returns a human-readable name, encoded as UTF-8, of the\n *  specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The UTF-8 encoded name of the monitor, or `NULL` if an error\n *  occurred.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @ingroup monitor\n */\nGLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);\n\n/*! @brief Sets the monitor configuration callback.\n *\n *  This function sets the monitor configuration callback, or removes the\n *  currently set callback.  This is called when a monitor is connected to or\n *  disconnected from the system.\n *\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @bug **X11:** This callback is not yet called on monitor configuration\n *  changes.\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);\n\n/*! @brief Returns the available video modes for the specified monitor.\n *\n *  This function returns an array of all video modes supported by the specified\n *  monitor.  The returned array is sorted in ascending order, first by color\n *  bit depth (the sum of all channel depths) and then by resolution area (the\n *  product of width and height).\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] count Where to store the number of video modes in the returned\n *  array.  This is set to zero if an error occurred.\n *  @return An array of video modes, or `NULL` if an error occurred.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until this function is called again\n *  for the specified monitor.\n *\n *  @sa glfwGetVideoMode\n *\n *  @ingroup monitor\n */\nGLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);\n\n/*! @brief Returns the current mode of the specified monitor.\n *\n *  This function returns the current video mode of the specified monitor.  If\n *  you are using a full screen window, the return value will therefore depend\n *  on whether it is focused.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The current mode of the monitor, or `NULL` if an error occurred.\n *\n *  @note The returned struct is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @sa glfwGetVideoModes\n *\n *  @ingroup monitor\n */\nGLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);\n\n/*! @brief Generates a gamma ramp and sets it for the specified monitor.\n *\n *  This function generates a 256-element gamma ramp from the specified exponent\n *  and then calls @ref glfwSetGammaRamp with it.\n *\n *  @param[in] monitor The monitor whose gamma ramp to set.\n *  @param[in] gamma The desired exponent.\n *\n *  @ingroup gamma\n */\nGLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);\n\n/*! @brief Retrieves the current gamma ramp for the specified monitor.\n *\n *  This function retrieves the current gamma ramp of the specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The current gamma ramp, or `NULL` if an error occurred.\n *\n *  @note The value arrays of the returned ramp are allocated and freed by GLFW.\n *  You should not free them yourself.\n *\n *  @ingroup gamma\n */\nGLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);\n\n/*! @brief Sets the current gamma ramp for the specified monitor.\n *\n *  This function sets the current gamma ramp for the specified monitor.\n *\n *  @param[in] monitor The monitor whose gamma ramp to set.\n *  @param[in] ramp The gamma ramp to use.\n *\n *  @note Gamma ramp sizes other than 256 are not supported by all hardware.\n *\n *  @ingroup gamma\n */\nGLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);\n\n/*! @brief Resets all window hints to their default values.\n *\n *  This function resets all window hints to their\n *  [default values](@ref window_hints_values).\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwWindowHint\n *\n *  @ingroup window\n */\nGLFWAPI void glfwDefaultWindowHints(void);\n\n/*! @brief Sets the specified window hint to the desired value.\n *\n *  This function sets hints for the next call to @ref glfwCreateWindow.  The\n *  hints, once set, retain their values until changed by a call to @ref\n *  glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is\n *  terminated with @ref glfwTerminate.\n *\n *  @param[in] target The [window hint](@ref window_hints) to set.\n *  @param[in] hint The new value of the window hint.\n *\n *  @par New in GLFW 3\n *  Hints are no longer reset to their default values on window creation.  To\n *  set default hint values, use @ref glfwDefaultWindowHints.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwDefaultWindowHints\n *\n *  @ingroup window\n */\nGLFWAPI void glfwWindowHint(int target, int hint);\n\n/*! @brief Creates a window and its associated context.\n *\n *  This function creates a window and its associated context.  Most of the\n *  options controlling how the window and its context should be created are\n *  specified through @ref glfwWindowHint.\n *\n *  Successful creation does not change which context is current.  Before you\n *  can use the newly created context, you need to make it current using @ref\n *  glfwMakeContextCurrent.\n *\n *  Note that the created window and context may differ from what you requested,\n *  as not all parameters and hints are\n *  [hard constraints](@ref window_hints_hard).  This includes the size of the\n *  window, especially for full screen windows.  To retrieve the actual\n *  attributes of the created window and context, use queries like @ref\n *  glfwGetWindowAttrib and @ref glfwGetWindowSize.\n *\n *  To create the window at a specific position, make it initially invisible\n *  using the `GLFW_VISIBLE` window hint, set its position and then show it.\n *\n *  If a fullscreen window is active, the screensaver is prohibited from\n *  starting.\n *\n *  @param[in] width The desired width, in screen coordinates, of the window.\n *  This must be greater than zero.\n *  @param[in] height The desired height, in screen coordinates, of the window.\n *  This must be greater than zero.\n *  @param[in] title The initial, UTF-8 encoded window title.\n *  @param[in] monitor The monitor to use for full screen mode, or `NULL` to use\n *  windowed mode.\n *  @param[in] share The window whose context to share resources with, or `NULL`\n *  to not share resources.\n *  @return The handle of the created window, or `NULL` if an error occurred.\n *\n *  @remarks **Windows:** If the executable has an icon resource named\n *  `GLFW_ICON,` it will be set as the icon for the window.  If no such icon is\n *  present, the `IDI_WINLOGO` icon will be used instead.\n *\n *  @remarks **Mac OS X:** The GLFW window has no icon, as it is not a document\n *  window, but the dock icon will be the same as the application bundle's icon.\n *  Also, the first time a window is opened the menu bar is populated with\n *  common commands like Hide, Quit and About.  The (minimal) about dialog uses\n *  information from the application's bundle.  For more information on bundles,\n *  see the Bundle Programming Guide provided by Apple.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwDestroyWindow\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);\n\n/*! @brief Destroys the specified window and its context.\n *\n *  This function destroys the specified window and its context.  On calling\n *  this function, no further callbacks will be called for that window.\n *\n *  @param[in] window The window to destroy.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note If the window's context is current on the main thread, it is\n *  detached before being destroyed.\n *\n *  @warning The window's context must not be current on any other thread.\n *\n *  @sa glfwCreateWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwDestroyWindow(GLFWwindow* window);\n\n/*! @brief Checks the close flag of the specified window.\n *\n *  This function returns the value of the close flag of the specified window.\n *\n *  @param[in] window The window to query.\n *  @return The value of the close flag.\n *\n *  @ingroup window\n */\nGLFWAPI int glfwWindowShouldClose(GLFWwindow* window);\n\n/*! @brief Sets the close flag of the specified window.\n *\n *  This function sets the value of the close flag of the specified window.\n *  This can be used to override the user's attempt to close the window, or\n *  to signal that it should be closed.\n *\n *  @param[in] window The window whose flag to change.\n *  @param[in] value The new value.\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);\n\n/*! @brief Sets the title of the specified window.\n *\n *  This function sets the window title, encoded as UTF-8, of the specified\n *  window.\n *\n *  @param[in] window The window whose title to change.\n *  @param[in] title The UTF-8 encoded window title.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);\n\n/*! @brief Retrieves the position of the client area of the specified window.\n *\n *  This function retrieves the position, in screen coordinates, of the\n *  upper-left corner of the client area of the specified window.\n *\n *  @param[in] window The window to query.\n *  @param[out] xpos Where to store the x-coordinate of the upper-left corner of\n *  the client area, or `NULL`.\n *  @param[out] ypos Where to store the y-coordinate of the upper-left corner of\n *  the client area, or `NULL`.\n *\n *  @sa glfwSetWindowPos\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);\n\n/*! @brief Sets the position of the client area of the specified window.\n *\n *  This function sets the position, in screen coordinates, of the upper-left\n *  corner of the client area of the window.\n *\n *  If the specified window is a full screen window, this function does nothing.\n *\n *  If you wish to set an initial window position you should create a hidden\n *  window (using @ref glfwWindowHint and `GLFW_VISIBLE`), set its position and\n *  then show it.\n *\n *  @param[in] window The window to query.\n *  @param[in] xpos The x-coordinate of the upper-left corner of the client area.\n *  @param[in] ypos The y-coordinate of the upper-left corner of the client area.\n *\n *  @note It is very rarely a good idea to move an already visible window, as it\n *  will confuse and annoy the user.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The window manager may put limits on what positions are allowed.\n *\n *  @bug **X11:** Some window managers ignore the set position of hidden (i.e.\n *  unmapped) windows, instead placing them where it thinks is appropriate once\n *  they are shown.\n *\n *  @sa glfwGetWindowPos\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);\n\n/*! @brief Retrieves the size of the client area of the specified window.\n *\n *  This function retrieves the size, in screen coordinates, of the client area\n *  of the specified window.\n *\n *  @param[in] window The window whose size to retrieve.\n *  @param[out] width Where to store the width, in screen coordinates, of the\n *  client area, or `NULL`.\n *  @param[out] height Where to store the height, in screen coordinates, of the\n *  client area, or `NULL`.\n *\n *  @sa glfwSetWindowSize\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);\n\n/*! @brief Sets the size of the client area of the specified window.\n *\n *  This function sets the size, in screen coordinates, of the client area of\n *  the specified window.\n *\n *  For full screen windows, this function selects and switches to the resolution\n *  closest to the specified size, without affecting the window's context.  As\n *  the context is unaffected, the bit depths of the framebuffer remain\n *  unchanged.\n *\n *  @param[in] window The window to resize.\n *  @param[in] width The desired width of the specified window.\n *  @param[in] height The desired height of the specified window.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The window manager may put limits on what window sizes are allowed.\n *\n *  @sa glfwGetWindowSize\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);\n\n/*! @brief Retrieves the size of the framebuffer of the specified window.\n *\n *  This function retrieves the size, in pixels, of the framebuffer of the\n *  specified window.\n *\n *  @param[in] window The window whose framebuffer to query.\n *  @param[out] width Where to store the width, in pixels, of the framebuffer,\n *  or `NULL`.\n *  @param[out] height Where to store the height, in pixels, of the framebuffer,\n *  or `NULL`.\n *\n *  @sa glfwSetFramebufferSizeCallback\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);\n\n/*! @brief Iconifies the specified window.\n *\n *  This function iconifies/minimizes the specified window, if it was previously\n *  restored.  If it is a full screen window, the original monitor resolution is\n *  restored until the window is restored.  If the window is already iconified,\n *  this function does nothing.\n *\n *  @param[in] window The window to iconify.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwRestoreWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwIconifyWindow(GLFWwindow* window);\n\n/*! @brief Restores the specified window.\n *\n *  This function restores the specified window, if it was previously\n *  iconified/minimized.  If it is a full screen window, the resolution chosen\n *  for the window is restored on the selected monitor.  If the window is\n *  already restored, this function does nothing.\n *\n *  @param[in] window The window to restore.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwIconifyWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwRestoreWindow(GLFWwindow* window);\n\n/*! @brief Makes the specified window visible.\n *\n *  This function makes the specified window visible, if it was previously\n *  hidden.  If the window is already visible or is in full screen mode, this\n *  function does nothing.\n *\n *  @param[in] window The window to make visible.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwHideWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwShowWindow(GLFWwindow* window);\n\n/*! @brief Hides the specified window.\n *\n *  This function hides the specified window, if it was previously visible.  If\n *  the window is already hidden or is in full screen mode, this function does\n *  nothing.\n *\n *  @param[in] window The window to hide.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwShowWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwHideWindow(GLFWwindow* window);\n\n/*! @brief Returns the monitor that the window uses for full screen mode.\n *\n *  This function returns the handle of the monitor that the specified window is\n *  in full screen on.\n *\n *  @param[in] window The window to query.\n *  @return The monitor, or `NULL` if the window is in windowed mode.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);\n\n/*! @brief Returns an attribute of the specified window.\n *\n *  This function returns an attribute of the specified window.  There are many\n *  attributes, some related to the window and others to its context.\n *\n *  @param[in] window The window to query.\n *  @param[in] attrib The [window attribute](@ref window_attribs) whose value to\n *  return.\n *  @return The value of the attribute, or zero if an error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);\n\n/*! @brief Sets the user pointer of the specified window.\n *\n *  This function sets the user-defined pointer of the specified window.  The\n *  current value is retained until the window is destroyed.  The initial value\n *  is `NULL`.\n *\n *  @param[in] window The window whose pointer to set.\n *  @param[in] pointer The new value.\n *\n *  @sa glfwGetWindowUserPointer\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);\n\n/*! @brief Returns the user pointer of the specified window.\n *\n *  This function returns the current value of the user-defined pointer of the\n *  specified window.  The initial value is `NULL`.\n *\n *  @param[in] window The window whose pointer to return.\n *\n *  @sa glfwSetWindowUserPointer\n *\n *  @ingroup window\n */\nGLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);\n\n/*! @brief Sets the position callback for the specified window.\n *\n *  This function sets the position callback of the specified window, which is\n *  called when the window is moved.  The callback is provided with the screen\n *  position of the upper-left corner of the client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);\n\n/*! @brief Sets the size callback for the specified window.\n *\n *  This function sets the size callback of the specified window, which is\n *  called when the window is resized.  The callback is provided with the size,\n *  in screen coordinates, of the client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);\n\n/*! @brief Sets the close callback for the specified window.\n *\n *  This function sets the close callback of the specified window, which is\n *  called when the user attempts to close the window, for example by clicking\n *  the close widget in the title bar.\n *\n *  The close flag is set before this callback is called, but you can modify it\n *  at any time with @ref glfwSetWindowShouldClose.\n *\n *  The close callback is not triggered by @ref glfwDestroyWindow.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @remarks **Mac OS X:** Selecting Quit from the application menu will\n *  trigger the close callback for all windows.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);\n\n/*! @brief Sets the refresh callback for the specified window.\n *\n *  This function sets the refresh callback of the specified window, which is\n *  called when the client area of the window needs to be redrawn, for example\n *  if the window has been exposed after having been covered by another window.\n *\n *  On compositing window systems such as Aero, Compiz or Aqua, where the window\n *  contents are saved off-screen, this callback may be called only very\n *  infrequently or never at all.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @note On compositing window systems such as Aero, Compiz or Aqua, where the\n *  window contents are saved off-screen, this callback may be called only very\n *  infrequently or never at all.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);\n\n/*! @brief Sets the focus callback for the specified window.\n *\n *  This function sets the focus callback of the specified window, which is\n *  called when the window gains or loses focus.\n *\n *  After the focus callback is called for a window that lost focus, synthetic\n *  key and mouse button release events will be generated for all such that had\n *  been pressed.  For more information, see @ref glfwSetKeyCallback and @ref\n *  glfwSetMouseButtonCallback.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);\n\n/*! @brief Sets the iconify callback for the specified window.\n *\n *  This function sets the iconification callback of the specified window, which\n *  is called when the window is iconified or restored.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);\n\n/*! @brief Sets the framebuffer resize callback for the specified window.\n *\n *  This function sets the framebuffer resize callback of the specified window,\n *  which is called when the framebuffer of the specified window is resized.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);\n\n/*! @brief Processes all pending events.\n *\n *  This function processes only those events that have already been received\n *  and then returns immediately.  Processing events will cause the window and\n *  input callbacks associated with those events to be called.\n *\n *  This function is not required for joystick input to work.\n *\n *  @par New in GLFW 3\n *  This function is no longer called by @ref glfwSwapBuffers.  You need to call\n *  it or @ref glfwWaitEvents yourself.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note On some platforms, certain callbacks may be called outside of a call\n *  to one of the event processing functions.\n *\n *  @sa glfwWaitEvents\n *\n *  @ingroup window\n */\nGLFWAPI void glfwPollEvents(void);\n\n/*! @brief Waits until events are pending and processes them.\n *\n *  This function puts the calling thread to sleep until at least one event has\n *  been received.  Once one or more events have been recevied, it behaves as if\n *  @ref glfwPollEvents was called, i.e. the events are processed and the\n *  function then returns immediately.  Processing events will cause the window\n *  and input callbacks associated with those events to be called.\n *\n *  Since not all events are associated with callbacks, this function may return\n *  without a callback having been called even if you are monitoring all\n *  callbacks.\n *\n *  This function is not required for joystick input to work.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note On some platforms, certain callbacks may be called outside of a call\n *  to one of the event processing functions.\n *\n *  @sa glfwPollEvents\n *\n *  @ingroup window\n */\nGLFWAPI void glfwWaitEvents(void);\n\n/*! @brief Returns the value of an input option for the specified window.\n *\n *  @param[in] window The window to query.\n *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or\n *  `GLFW_STICKY_MOUSE_BUTTONS`.\n *\n *  @sa glfwSetInputMode\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);\n\n/*! @brief Sets an input option for the specified window.\n *  @param[in] window The window whose input mode to set.\n *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or\n *  `GLFW_STICKY_MOUSE_BUTTONS`.\n *  @param[in] value The new value of the specified input mode.\n *\n *  If `mode` is `GLFW_CURSOR`, the value must be one of the supported input\n *  modes:\n *  - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.\n *  - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client\n *    area of the window.\n *  - `GLFW_CURSOR_DISABLED` disables the cursor and removes any limitations on\n *    cursor movement.\n *\n *  If `mode` is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to\n *  enable sticky keys, or `GL_FALSE` to disable it.  If sticky keys are\n *  enabled, a key press will ensure that @ref glfwGetKey returns @ref\n *  GLFW_PRESS the next time it is called even if the key had been released\n *  before the call.  This is useful when you are only interested in whether\n *  keys have been pressed but not when or in which order.\n *\n *  If `mode` is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either `GL_TRUE`\n *  to enable sticky mouse buttons, or `GL_FALSE` to disable it.  If sticky\n *  mouse buttons are enabled, a mouse button press will ensure that @ref\n *  glfwGetMouseButton returns @ref GLFW_PRESS the next time it is called even\n *  if the mouse button had been released before the call.  This is useful when\n *  you are only interested in whether mouse buttons have been pressed but not\n *  when or in which order.\n *\n *  @sa glfwGetInputMode\n *\n *  @ingroup input\n */\nGLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);\n\n/*! @brief Returns the last reported state of a keyboard key for the specified\n *  window.\n *\n *  This function returns the last state reported for the specified key to the\n *  specified window.  The returned state is one of `GLFW_PRESS` or\n *  `GLFW_RELEASE`.  The higher-level state `GLFW_REPEAT` is only reported to\n *  the key callback.\n *\n *  If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns\n *  `GLFW_PRESS` the first time you call this function after a key has been\n *  pressed, even if the key has already been released.\n *\n *  The key functions deal with physical keys, with [key tokens](@ref keys)\n *  named after their use on the standard US keyboard layout.  If you want to\n *  input text, use the Unicode character callback instead.\n *\n *  @param[in] window The desired window.\n *  @param[in] key The desired [keyboard key](@ref keys).\n *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *\n *  @note `GLFW_KEY_UNKNOWN` is not a valid key for this function.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetKey(GLFWwindow* window, int key);\n\n/*! @brief Returns the last reported state of a mouse button for the specified\n *  window.\n *\n *  This function returns the last state reported for the specified mouse button\n *  to the specified window.\n *\n *  If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function\n *  returns `GLFW_PRESS` the first time you call this function after a mouse\n *  button has been pressed, even if the mouse button has already been released.\n *\n *  @param[in] window The desired window.\n *  @param[in] button The desired [mouse button](@ref buttons).\n *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);\n\n/*! @brief Retrieves the last reported cursor position, relative to the client\n *  area of the window.\n *\n *  This function returns the last reported position of the cursor to the\n *  specified window.\n *\n *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor\n *  position is unbounded and limited only by the minimum and maximum values of\n *  a `double`.\n *\n *  The coordinate can be converted to their integer equivalents with the\n *  `floor` function.  Casting directly to an integer type works for positive\n *  coordinates, but fails for negative ones.\n *\n *  @param[in] window The desired window.\n *  @param[out] xpos Where to store the cursor x-coordinate, relative to the\n *  left edge of the client area, or `NULL`.\n *  @param[out] ypos Where to store the cursor y-coordinate, relative to the to\n *  top edge of the client area, or `NULL`.\n *\n *  @sa glfwSetCursorPos\n *\n *  @ingroup input\n */\nGLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);\n\n/*! @brief Sets the position of the cursor, relative to the client area of the window.\n *\n *  This function sets the position of the cursor.  The specified window must be\n *  focused.  If the window does not have focus when this function is called, it\n *  fails silently.\n *\n *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor\n *  position is unbounded and limited only by the minimum and maximum values of\n *  a `double`.\n *\n *  @param[in] window The desired window.\n *  @param[in] xpos The desired x-coordinate, relative to the left edge of the\n *  client area, or `NULL`.\n *  @param[in] ypos The desired y-coordinate, relative to the top edge of the\n *  client area, or `NULL`.\n *\n *  @sa glfwGetCursorPos\n *\n *  @ingroup input\n */\nGLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);\n\n/*! @brief Sets the key callback.\n *\n *  This function sets the key callback of the specific window, which is called\n *  when a key is pressed, repeated or released.\n *\n *  The key functions deal with physical keys, with layout independent\n *  [key tokens](@ref keys) named after their values in the standard US keyboard\n *  layout.  If you want to input text, use the\n *  [character callback](@ref glfwSetCharCallback) instead.\n *\n *  When a window loses focus, it will generate synthetic key release events\n *  for all pressed keys.  You can tell these events from user-generated events\n *  by the fact that the synthetic ones are generated after the window has lost\n *  focus, i.e. `GLFW_FOCUSED` will be false and the focus callback will have\n *  already been called.\n *\n *  The scancode of a key is specific to that platform or sometimes even to that\n *  machine.  Scancodes are intended to allow users to bind keys that don't have\n *  a GLFW key token.  Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their\n *  state is not saved and so it cannot be retrieved with @ref glfwGetKey.\n *\n *  Sometimes GLFW needs to generate synthetic key events, in which case the\n *  scancode may be zero.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new key callback, or `NULL` to remove the currently\n *  set callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);\n\n/*! @brief Sets the Unicode character callback.\n *\n *  This function sets the character callback of the specific window, which is\n *  called when a Unicode character is input.\n *\n *  The character callback is intended for text input.  If you want to know\n *  whether a specific key was pressed or released, use the\n *  [key callback](@ref glfwSetKeyCallback) instead.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);\n\n/*! @brief Sets the mouse button callback.\n *\n *  This function sets the mouse button callback of the specified window, which\n *  is called when a mouse button is pressed or released.\n *\n *  When a window loses focus, it will generate synthetic mouse button release\n *  events for all pressed mouse buttons.  You can tell these events from\n *  user-generated events by the fact that the synthetic ones are generated\n *  after the window has lost focus, i.e. `GLFW_FOCUSED` will be false and the\n *  focus callback will have already been called.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);\n\n/*! @brief Sets the cursor position callback.\n *\n *  This function sets the cursor position callback of the specified window,\n *  which is called when the cursor is moved.  The callback is provided with the\n *  position relative to the upper-left corner of the client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);\n\n/*! @brief Sets the cursor enter/exit callback.\n *\n *  This function sets the cursor boundary crossing callback of the specified\n *  window, which is called when the cursor enters or leaves the client area of\n *  the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);\n\n/*! @brief Sets the scroll callback.\n *\n *  This function sets the scroll callback of the specified window, which is\n *  called when a scrolling device is used, such as a mouse wheel or scrolling\n *  area of a touchpad.\n *\n *  The scroll callback receives all scrolling input, like that from a mouse\n *  wheel or a touchpad scrolling area.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new scroll callback, or `NULL` to remove the currently\n *  set callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);\n\n/*! @brief Returns whether the specified joystick is present.\n *\n *  This function returns whether the specified joystick is present.\n *\n *  @param[in] joy The joystick to query.\n *  @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwJoystickPresent(int joy);\n\n/*! @brief Returns the values of all axes of the specified joystick.\n *\n *  This function returns the values of all axes of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of axis values, or `NULL` if the joystick is not present.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the next call to @ref\n *  glfwGetJoystickAxes for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const float* glfwGetJoystickAxes(int joy, int* count);\n\n/*! @brief Returns the state of all buttons of the specified joystick.\n *\n *  This function returns the state of all buttons of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of button states, or `NULL` if the joystick is not present.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the next call to @ref\n *  glfwGetJoystickButtons for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count);\n\n/*! @brief Returns the name of the specified joystick.\n *\n *  This function returns the name, encoded as UTF-8, of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick\n *  is not present.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned string is valid only until the next call to @ref\n *  glfwGetJoystickName for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const char* glfwGetJoystickName(int joy);\n\n/*! @brief Sets the clipboard to the specified string.\n *\n *  This function sets the system clipboard to the specified, UTF-8 encoded\n *  string.  The string is copied before returning, so you don't have to retain\n *  it afterwards.\n *\n *  @param[in] window The window that will own the clipboard contents.\n *  @param[in] string A UTF-8 encoded string.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwGetClipboardString\n *\n *  @ingroup clipboard\n */\nGLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);\n\n/*! @brief Retrieves the contents of the clipboard as a string.\n *\n *  This function returns the contents of the system clipboard, if it contains\n *  or is convertible to a UTF-8 encoded string.\n *\n *  @param[in] window The window that will request the clipboard contents.\n *  @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`\n *  if an error occurred.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned string is valid only until the next call to @ref\n *  glfwGetClipboardString or @ref glfwSetClipboardString.\n *\n *  @sa glfwSetClipboardString\n *\n *  @ingroup clipboard\n */\nGLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);\n\n/*! @brief Returns the value of the GLFW timer.\n *\n *  This function returns the value of the GLFW timer.  Unless the timer has\n *  been set using @ref glfwSetTime, the timer measures time elapsed since GLFW\n *  was initialized.\n *\n *  @return The current value, in seconds, or zero if an error occurred.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note The resolution of the timer is system dependent, but is usually on the\n *  order of a few micro- or nanoseconds.  It uses the highest-resolution\n *  monotonic time source on each supported platform.\n *\n *  @ingroup time\n */\nGLFWAPI double glfwGetTime(void);\n\n/*! @brief Sets the GLFW timer.\n *\n *  This function sets the value of the GLFW timer.  It then continues to count\n *  up from that value.\n *\n *  @param[in] time The new value, in seconds.\n *\n *  @note The resolution of the timer is system dependent, but is usually on the\n *  order of a few micro- or nanoseconds.  It uses the highest-resolution\n *  monotonic time source on each supported platform.\n *\n *  @ingroup time\n */\nGLFWAPI void glfwSetTime(double time);\n\n/*! @brief Makes the context of the specified window current for the calling\n *  thread.\n *\n *  This function makes the context of the specified window current on the\n *  calling thread.  A context can only be made current on a single thread at\n *  a time and each thread can have only a single current context at a time.\n *\n *  @param[in] window The window whose context to make current, or `NULL` to\n *  detach the current context.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @sa glfwGetCurrentContext\n *\n *  @ingroup context\n */\nGLFWAPI void glfwMakeContextCurrent(GLFWwindow* window);\n\n/*! @brief Returns the window whose context is current on the calling thread.\n *\n *  This function returns the window whose context is current on the calling\n *  thread.\n *\n *  @return The window whose context is current, or `NULL` if no window's\n *  context is current.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @sa glfwMakeContextCurrent\n *\n *  @ingroup context\n */\nGLFWAPI GLFWwindow* glfwGetCurrentContext(void);\n\n/*! @brief Swaps the front and back buffers of the specified window.\n *\n *  This function swaps the front and back buffers of the specified window.  If\n *  the swap interval is greater than zero, the GPU driver waits the specified\n *  number of screen updates before swapping the buffers.\n *\n *  @param[in] window The window whose buffers to swap.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @par New in GLFW 3\n *  This function no longer calls @ref glfwPollEvents.  You need to call it or\n *  @ref glfwWaitEvents yourself.\n *\n *  @sa glfwSwapInterval\n *\n *  @ingroup context\n */\nGLFWAPI void glfwSwapBuffers(GLFWwindow* window);\n\n/*! @brief Sets the swap interval for the current context.\n *\n *  This function sets the swap interval for the current context, i.e. the\n *  number of screen updates to wait before swapping the buffers of a window and\n *  returning from @ref glfwSwapBuffers.  This is sometimes called 'vertical\n *  synchronization', 'vertical retrace synchronization' or 'vsync'.\n *\n *  Contexts that support either of the `WGL_EXT_swap_control_tear` and\n *  `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals,\n *  which allow the driver to swap even if a frame arrives a little bit late.\n *  You can check for the presence of these extensions using @ref\n *  glfwExtensionSupported.  For more information about swap tearing, see the\n *  extension specifications.\n *\n *  @param[in] interval The minimum number of screen updates to wait for\n *  until the buffers are swapped by @ref glfwSwapBuffers.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note Some GPU drivers do not honor the requested swap interval, either\n *  because of user settings that override the request or due to bugs in the\n *  driver.\n *\n *  @sa glfwSwapBuffers\n *\n *  @ingroup context\n */\nGLFWAPI void glfwSwapInterval(int interval);\n\n/*! @brief Returns whether the specified extension is available.\n *\n *  This function returns whether the specified\n *  [OpenGL or context creation API extension](@ref context_glext) is supported\n *  by the current context.  For example, on Windows both the OpenGL and WGL\n *  extension strings are checked.\n *\n *  @param[in] extension The ASCII encoded name of the extension.\n *  @return `GL_TRUE` if the extension is available, or `GL_FALSE` otherwise.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note As this functions searches one or more extension strings on each call,\n *  it is recommended that you cache its results if it's going to be used\n *  frequently.  The extension strings will not change during the lifetime of\n *  a context, so there is no danger in doing this.\n *\n *  @ingroup context\n */\nGLFWAPI int glfwExtensionSupported(const char* extension);\n\n/*! @brief Returns the address of the specified function for the current\n *  context.\n *\n *  This function returns the address of the specified\n *  [client API or extension function](@ref context_glext), if it is supported\n *  by the current context.\n *\n *  @param[in] procname The ASCII encoded name of the function.\n *  @return The address of the function, or `NULL` if the function is\n *  unavailable.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note The addresses of these functions are not guaranteed to be the same for\n *  all contexts, especially if they use different client APIs or even different\n *  context creation hints.\n *\n *  @ingroup context\n */\nGLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);\n\n\n/*************************************************************************\n * Global definition cleanup\n *************************************************************************/\n\n/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */\n\n#ifdef GLFW_WINGDIAPI_DEFINED\n #undef WINGDIAPI\n #undef GLFW_WINGDIAPI_DEFINED\n#endif\n\n#ifdef GLFW_CALLBACK_DEFINED\n #undef CALLBACK\n #undef GLFW_CALLBACK_DEFINED\n#endif\n\n/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _glfw3_h_ */\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/include/GLFW/glfw3native.h",
    "content": "/*************************************************************************\n * GLFW - An OpenGL library\n * API version: 3.0\n * WWW:         http://www.glfw.org/\n *------------------------------------------------------------------------\n * Copyright (c) 2002-2006 Marcus Geelnard\n * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n *\n * This software is provided 'as-is', without any express or implied\n * warranty. In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would\n *    be appreciated but is not required.\n *\n * 2. Altered source versions must be plainly marked as such, and must not\n *    be misrepresented as being the original software.\n *\n * 3. This notice may not be removed or altered from any source\n *    distribution.\n *\n *************************************************************************/\n\n#ifndef _glfw3_native_h_\n#define _glfw3_native_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/*************************************************************************\n * Doxygen documentation\n *************************************************************************/\n\n/*! @defgroup native Native access\n *\n *  **By using the native API, you assert that you know what you are doing and\n *  how to fix problems caused by using it.  If you don't, you shouldn't be\n *  using it.**\n *\n *  Before the inclusion of @ref glfw3native.h, you must define exactly one\n *  window API macro and exactly one context API macro.  Failure to do this\n *  will cause a compile-time error.\n *\n *  The available window API macros are:\n *  * `GLFW_EXPOSE_NATIVE_WIN32`\n *  * `GLFW_EXPOSE_NATIVE_COCOA`\n *  * `GLFW_EXPOSE_NATIVE_X11`\n *\n *  The available context API macros are:\n *  * `GLFW_EXPOSE_NATIVE_WGL`\n *  * `GLFW_EXPOSE_NATIVE_NSGL`\n *  * `GLFW_EXPOSE_NATIVE_GLX`\n *  * `GLFW_EXPOSE_NATIVE_EGL`\n *\n *  These macros select which of the native access functions that are declared\n *  and which platform-specific headers to include.  It is then up your (by\n *  definition platform-specific) code to handle which of these should be\n *  defined.\n */\n\n\n/*************************************************************************\n * System headers and types\n *************************************************************************/\n\n#if defined(GLFW_EXPOSE_NATIVE_WIN32)\n #include <windows.h>\n#elif defined(GLFW_EXPOSE_NATIVE_COCOA)\n #if defined(__OBJC__)\n  #import <Cocoa/Cocoa.h>\n #else\n  typedef void* id;\n #endif\n#elif defined(GLFW_EXPOSE_NATIVE_X11)\n #include <X11/Xlib.h>\n#else\n #error \"No window API specified\"\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_WGL)\n /* WGL is declared by windows.h */\n#elif defined(GLFW_EXPOSE_NATIVE_NSGL)\n /* NSGL is declared by Cocoa.h */\n#elif defined(GLFW_EXPOSE_NATIVE_GLX)\n #include <GL/glx.h>\n#elif defined(GLFW_EXPOSE_NATIVE_EGL)\n #include <EGL/egl.h>\n#else\n #error \"No context API specified\"\n#endif\n\n\n/*************************************************************************\n * Functions\n *************************************************************************/\n\n#if defined(GLFW_EXPOSE_NATIVE_WIN32)\n/*! @brief Returns the `HWND` of the specified window.\n *  @return The `HWND` of the specified window.\n *  @ingroup native\n */\nGLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_WGL)\n/*! @brief Returns the `HGLRC` of the specified window.\n *  @return The `HGLRC` of the specified window.\n *  @ingroup native\n */\nGLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_COCOA)\n/*! @brief Returns the `NSWindow` of the specified window.\n *  @return The `NSWindow` of the specified window.\n *  @ingroup native\n */\nGLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_NSGL)\n/*! @brief Returns the `NSOpenGLContext` of the specified window.\n *  @return The `NSOpenGLContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI id glfwGetNSGLContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_X11)\n/*! @brief Returns the `Display` used by GLFW.\n *  @return The `Display` used by GLFW.\n *  @ingroup native\n */\nGLFWAPI Display* glfwGetX11Display(void);\n/*! @brief Returns the `Window` of the specified window.\n *  @return The `Window` of the specified window.\n *  @ingroup native\n */\nGLFWAPI Window glfwGetX11Window(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_GLX)\n/*! @brief Returns the `GLXContext` of the specified window.\n *  @return The `GLXContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_EGL)\n/*! @brief Returns the `EGLDisplay` used by GLFW.\n *  @return The `EGLDisplay` used by GLFW.\n *  @ingroup native\n */\nGLFWAPI EGLDisplay glfwGetEGLDisplay(void);\n/*! @brief Returns the `EGLContext` of the specified window.\n *  @return The `EGLContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);\n/*! @brief Returns the `EGLSurface` of the specified window.\n *  @return The `EGLSurface` of the specified window.\n *  @ingroup native\n */\nGLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _glfw3_native_h_ */\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/CMakeLists.txt",
    "content": "\ninclude_directories(${GLFW_SOURCE_DIR}/src\n                    ${GLFW_BINARY_DIR}/src\n                    ${glfw_INCLUDE_DIRS})\n\nif (MSVC)\n    add_definitions(-D_CRT_SECURE_NO_WARNINGS)\nendif()\n\nset(common_HEADERS ${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h internal.h)\nset(common_SOURCES clipboard.c context.c gamma.c init.c input.c joystick.c\n                   monitor.c time.c window.c)\n\nif (_GLFW_COCOA)\n    set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h)\n    set(glfw_SOURCES ${common_SOURCES} cocoa_clipboard.m cocoa_gamma.c\n                     cocoa_init.m cocoa_joystick.m cocoa_monitor.m cocoa_time.c\n                     cocoa_window.m)\nelseif (_GLFW_WIN32)\n    set(glfw_HEADERS ${common_HEADERS} win32_platform.h)\n    set(glfw_SOURCES ${common_SOURCES} win32_clipboard.c win32_gamma.c\n                     win32_init.c win32_joystick.c win32_monitor.c win32_time.c\n                     win32_window.c)\nelseif (_GLFW_X11)\n    set(glfw_HEADERS ${common_HEADERS} x11_platform.h)\n    set(glfw_SOURCES ${common_SOURCES} x11_clipboard.c x11_gamma.c x11_init.c\n                     x11_joystick.c x11_monitor.c x11_time.c x11_window.c\n                     x11_unicode.c)\nendif()\n\nif (_GLFW_EGL)\n    list(APPEND glfw_HEADERS ${common_HEADERS} egl_platform.h)\n    list(APPEND glfw_SOURCES ${common_SOURCES} egl_context.c)\nelseif (_GLFW_NSGL)\n    list(APPEND glfw_HEADERS ${common_HEADERS} nsgl_platform.h)\n    list(APPEND glfw_SOURCES ${common_SOURCES} nsgl_context.m)\nelseif (_GLFW_WGL)\n    list(APPEND glfw_HEADERS ${common_HEADERS} wgl_platform.h)\n    list(APPEND glfw_SOURCES ${common_SOURCES} wgl_context.c)\nelseif (_GLFW_X11)\n    list(APPEND glfw_HEADERS ${common_HEADERS} glx_platform.h)\n    list(APPEND glfw_SOURCES ${common_SOURCES} glx_context.c)\nendif()\n\nif (APPLE)\n    # For some reason, CMake doesn't know about .m\n    set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)\nendif()\n\nadd_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})\nset_target_properties(glfw PROPERTIES OUTPUT_NAME \"${GLFW_LIB_NAME}\")\n\nif (BUILD_SHARED_LIBS)\n    # Include version information in the output\n    set_target_properties(glfw PROPERTIES VERSION ${GLFW_VERSION})\n    if (UNIX)\n        set_target_properties(glfw PROPERTIES SOVERSION ${GLFW_VERSION_MAJOR})\n    endif()\n\n    if (WIN32)\n        # The GLFW DLL needs a special compile-time macro and import library name\n        set_target_properties(glfw PROPERTIES PREFIX \"\" IMPORT_PREFIX \"\")\n\n        if (MINGW)\n            set_target_properties(glfw PROPERTIES IMPORT_SUFFIX \"dll.a\")\n        else()\n            set_target_properties(glfw PROPERTIES IMPORT_SUFFIX \"dll.lib\")\n        endif()\n    elseif (APPLE)\n        # Append -fno-common to the compile flags to work around a bug in\n        # Apple's GCC\n        get_target_property(glfw_CFLAGS glfw COMPILE_FLAGS)\n        if (NOT glfw_CFLAGS)\n            set(glfw_CFLAGS \"\")\n        endif()\n        set_target_properties(glfw PROPERTIES\n                              COMPILE_FLAGS \"${glfw_CFLAGS} -fno-common\")\n    endif()\n\n    target_link_libraries(glfw ${glfw_LIBRARIES})\n    target_link_libraries(glfw LINK_INTERFACE_LIBRARIES)\nendif()\n\nif (GLFW_INSTALL)\n    install(TARGETS glfw EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX})\nendif()\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/clipboard.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <math.h>\n#include <string.h>\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI void glfwSetClipboardString(GLFWwindow* handle, const char* string)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformSetClipboardString(window, string);\n}\n\nGLFWAPI const char* glfwGetClipboardString(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return _glfwPlatformGetClipboardString(window);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/cocoa_clipboard.m",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <limits.h>\n#include <string.h>\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)\n{\n    NSArray* types = [NSArray arrayWithObjects:NSStringPboardType, nil];\n\n    NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];\n    [pasteboard declareTypes:types owner:nil];\n    [pasteboard setString:[NSString stringWithUTF8String:string]\n                  forType:NSStringPboardType];\n}\n\nconst char* _glfwPlatformGetClipboardString(_GLFWwindow* window)\n{\n    NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];\n\n    if (![[pasteboard types] containsObject:NSStringPboardType])\n    {\n        _glfwInputError(GLFW_FORMAT_UNAVAILABLE, NULL);\n        return NULL;\n    }\n\n    NSString* object = [pasteboard stringForType:NSStringPboardType];\n    if (!object)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Cocoa: Failed to retrieve object from pasteboard\");\n        return NULL;\n    }\n\n    free(_glfw.ns.clipboardString);\n    _glfw.ns.clipboardString = strdup([object UTF8String]);\n\n    return _glfw.ns.clipboardString;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/cocoa_gamma.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <limits.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include <ApplicationServices/ApplicationServices.h>\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)\n{\n    uint32_t i, size = CGDisplayGammaTableCapacity(monitor->ns.displayID);\n    CGGammaValue* values = (CGGammaValue*) malloc(size * 3 * sizeof(CGGammaValue));\n\n    CGGetDisplayTransferByTable(monitor->ns.displayID,\n                                size,\n                                values,\n                                values + size,\n                                values + size * 2,\n                                &size);\n\n    _glfwAllocGammaRamp(ramp, size);\n\n    for (i = 0; i < size; i++)\n    {\n        ramp->red[i]   = (unsigned short) (values[i] * 65535);\n        ramp->green[i] = (unsigned short) (values[i + size] * 65535);\n        ramp->blue[i]  = (unsigned short) (values[i + size * 2] * 65535);\n    }\n\n    free(values);\n}\n\nvoid _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)\n{\n    int i;\n    CGGammaValue* values = (CGGammaValue*) malloc(ramp->size * 3 * sizeof(CGGammaValue));\n\n    for (i = 0;  i < ramp->size;  i++)\n    {\n        values[i]                  = ramp->red[i] / 65535.f;\n        values[i + ramp->size]     = ramp->green[i] / 65535.f;\n        values[i + ramp->size * 2] = ramp->blue[i] / 65535.f;\n    }\n\n    CGSetDisplayTransferByTable(monitor->ns.displayID,\n                                ramp->size,\n                                values,\n                                values + ramp->size,\n                                values + ramp->size * 2);\n\n    free(values);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/cocoa_init.m",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa/NSOpenGL\n// API Version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n#include <sys/param.h> // For MAXPATHLEN\n\n\n#if defined(_GLFW_USE_CHDIR)\n\n// Change to our application bundle's resources directory, if present\n//\nstatic void changeToResourcesDirectory(void)\n{\n    char resourcesPath[MAXPATHLEN];\n\n    CFBundleRef bundle = CFBundleGetMainBundle();\n    if (!bundle)\n        return;\n\n    CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(bundle);\n\n    CFStringRef last = CFURLCopyLastPathComponent(resourcesURL);\n    if (CFStringCompare(CFSTR(\"Resources\"), last, 0) != kCFCompareEqualTo)\n    {\n        CFRelease(last);\n        CFRelease(resourcesURL);\n        return;\n    }\n\n    CFRelease(last);\n\n    if (!CFURLGetFileSystemRepresentation(resourcesURL,\n                                          true,\n                                          (UInt8*) resourcesPath,\n                                          MAXPATHLEN))\n    {\n        CFRelease(resourcesURL);\n        return;\n    }\n\n    CFRelease(resourcesURL);\n\n    chdir(resourcesPath);\n}\n\n#endif /* _GLFW_USE_CHDIR */\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformInit(void)\n{\n    _glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];\n\n#if defined(_GLFW_USE_CHDIR)\n    changeToResourcesDirectory();\n#endif\n\n    _glfwInitTimer();\n\n    _glfwInitJoysticks();\n\n    if (!_glfwInitContextAPI())\n        return GL_FALSE;\n\n    _glfw.ns.eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);\n    if (!_glfw.ns.eventSource)\n        return GL_FALSE;\n\n    CGEventSourceSetLocalEventsSuppressionInterval(_glfw.ns.eventSource, 0.0);\n\n    return GL_TRUE;\n}\n\nvoid _glfwPlatformTerminate(void)\n{\n    if (_glfw.ns.eventSource)\n    {\n        CFRelease(_glfw.ns.eventSource);\n        _glfw.ns.eventSource = NULL;\n    }\n\n    [NSApp setDelegate:nil];\n    [_glfw.ns.delegate release];\n    _glfw.ns.delegate = nil;\n\n    [_glfw.ns.autoreleasePool release];\n    _glfw.ns.autoreleasePool = nil;\n\n    [_glfw.ns.cursor release];\n    _glfw.ns.cursor = nil;\n\n    _glfwTerminateJoysticks();\n\n    _glfwTerminateContextAPI();\n}\n\nconst char* _glfwPlatformGetVersionString(void)\n{\n    const char* version = _GLFW_VERSION_FULL \" Cocoa\"\n#if defined(_GLFW_NSGL)\n        \" NSGL\"\n#endif\n#if defined(_GLFW_USE_CHDIR)\n        \" chdir\"\n#endif\n#if defined(_GLFW_USE_MENUBAR)\n        \" menubar\"\n#endif\n#if defined(_GLFW_BUILD_DLL)\n        \" dynamic\"\n#endif\n        ;\n\n    return version;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/cocoa_joystick.m",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa\n// API Version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>\n// Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <unistd.h>\n#include <ctype.h>\n\n#include <mach/mach.h>\n#include <mach/mach_error.h>\n\n#include <CoreFoundation/CoreFoundation.h>\n#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>\n\n\n//------------------------------------------------------------------------\n// Joystick element information\n//------------------------------------------------------------------------\ntypedef struct\n{\n    IOHIDElementCookie cookie;\n\n    long min;\n    long max;\n\n    long minReport;\n    long maxReport;\n\n} _GLFWjoyelement;\n\n\nstatic void getElementsCFArrayHandler(const void* value, void* parameter);\n\n\n// Adds an element to the specified joystick\n//\nstatic void addJoystickElement(_GLFWjoy* joystick, CFTypeRef elementRef)\n{\n    long elementType, usagePage, usage;\n    CFMutableArrayRef elementsArray = NULL;\n\n    CFNumberGetValue(CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementTypeKey)),\n                     kCFNumberLongType, &elementType);\n    CFNumberGetValue(CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementUsagePageKey)),\n                     kCFNumberLongType, &usagePage);\n    CFNumberGetValue(CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementUsageKey)),\n                     kCFNumberLongType, &usage);\n\n    if ((elementType == kIOHIDElementTypeInput_Axis) ||\n        (elementType == kIOHIDElementTypeInput_Button) ||\n        (elementType == kIOHIDElementTypeInput_Misc))\n    {\n        switch (usagePage)\n        {\n            case kHIDPage_GenericDesktop:\n            {\n                switch (usage)\n                {\n                    case kHIDUsage_GD_X:\n                    case kHIDUsage_GD_Y:\n                    case kHIDUsage_GD_Z:\n                    case kHIDUsage_GD_Rx:\n                    case kHIDUsage_GD_Ry:\n                    case kHIDUsage_GD_Rz:\n                    case kHIDUsage_GD_Slider:\n                    case kHIDUsage_GD_Dial:\n                    case kHIDUsage_GD_Wheel:\n                        elementsArray = joystick->axisElements;\n                        break;\n                    case kHIDUsage_GD_Hatswitch:\n                        elementsArray = joystick->hatElements;\n                        break;\n                }\n\n                break;\n            }\n\n            case kHIDPage_Button:\n                elementsArray = joystick->buttonElements;\n                break;\n            default:\n                break;\n        }\n\n        if (elementsArray)\n        {\n            long number;\n            CFTypeRef numberRef;\n            _GLFWjoyelement* element = (_GLFWjoyelement*) malloc(sizeof(_GLFWjoyelement));\n\n            CFArrayAppendValue(elementsArray, element);\n\n            numberRef = CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementCookieKey));\n            if (numberRef && CFNumberGetValue(numberRef, kCFNumberLongType, &number))\n                element->cookie = (IOHIDElementCookie) number;\n\n            numberRef = CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementMinKey));\n            if (numberRef && CFNumberGetValue(numberRef, kCFNumberLongType, &number))\n                element->minReport = element->min = number;\n\n            numberRef = CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementMaxKey));\n            if (numberRef && CFNumberGetValue(numberRef, kCFNumberLongType, &number))\n                element->maxReport = element->max = number;\n        }\n    }\n    else\n    {\n        CFTypeRef array = CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementKey));\n        if (array)\n        {\n            if (CFGetTypeID(array) == CFArrayGetTypeID())\n            {\n                CFRange range = { 0, CFArrayGetCount(array) };\n                CFArrayApplyFunction(array, range, getElementsCFArrayHandler, joystick);\n            }\n        }\n    }\n}\n\n// Adds an element to the specified joystick\n//\nstatic void getElementsCFArrayHandler(const void* value, void* parameter)\n{\n    if (CFGetTypeID(value) == CFDictionaryGetTypeID())\n        addJoystickElement((_GLFWjoy*) parameter, (CFTypeRef) value);\n}\n\n// Returns the value of the specified element of the specified joystick\n//\nstatic long getElementValue(_GLFWjoy* joystick, _GLFWjoyelement* element)\n{\n    IOReturn result = kIOReturnSuccess;\n    IOHIDEventStruct hidEvent;\n    hidEvent.value = 0;\n\n    if (joystick && element && joystick->interface)\n    {\n        result = (*(joystick->interface))->getElementValue(joystick->interface,\n                                                           element->cookie,\n                                                           &hidEvent);\n        if (kIOReturnSuccess == result)\n        {\n            // Record min and max for auto calibration\n            if (hidEvent.value < element->minReport)\n                element->minReport = hidEvent.value;\n            if (hidEvent.value > element->maxReport)\n                element->maxReport = hidEvent.value;\n        }\n    }\n\n    // Auto user scale\n    return (long) hidEvent.value;\n}\n\n// Removes the specified joystick\n//\nstatic void removeJoystick(_GLFWjoy* joystick)\n{\n    int i;\n\n    if (!joystick->present)\n        return;\n\n    for (i = 0;  i < CFArrayGetCount(joystick->axisElements);  i++)\n        free((void*) CFArrayGetValueAtIndex(joystick->axisElements, i));\n    CFArrayRemoveAllValues(joystick->axisElements);\n\n    for (i = 0;  i < CFArrayGetCount(joystick->buttonElements);  i++)\n        free((void*) CFArrayGetValueAtIndex(joystick->buttonElements, i));\n    CFArrayRemoveAllValues(joystick->buttonElements);\n\n    for (i = 0;  i < CFArrayGetCount(joystick->hatElements);  i++)\n        free((void*) CFArrayGetValueAtIndex(joystick->hatElements, i));\n    CFArrayRemoveAllValues(joystick->hatElements);\n\n    free(joystick->axes);\n    free(joystick->buttons);\n\n    (*(joystick->interface))->close(joystick->interface);\n    (*(joystick->interface))->Release(joystick->interface);\n\n    memset(joystick, 0, sizeof(_GLFWjoy));\n}\n\n// Callback for user-initiated joystick removal\n//\nstatic void removalCallback(void* target, IOReturn result, void* refcon, void* sender)\n{\n    removeJoystick((_GLFWjoy*) refcon);\n}\n\n// Polls for joystick events and updates GLFW state\n//\nstatic void pollJoystickEvents(void)\n{\n    int joy;\n\n    for (joy = 0;  joy <= GLFW_JOYSTICK_LAST;  joy++)\n    {\n        CFIndex i;\n        int buttonIndex = 0;\n        _GLFWjoy* joystick = _glfw.ns.joysticks + joy;\n\n        if (!joystick->present)\n            continue;\n\n        for (i = 0;  i < CFArrayGetCount(joystick->buttonElements);  i++)\n        {\n            _GLFWjoyelement* button =\n                (_GLFWjoyelement*) CFArrayGetValueAtIndex(joystick->buttonElements, i);\n\n            if (getElementValue(joystick, button))\n                joystick->buttons[buttonIndex++] = GLFW_PRESS;\n            else\n                joystick->buttons[buttonIndex++] = GLFW_RELEASE;\n        }\n\n        for (i = 0;  i < CFArrayGetCount(joystick->axisElements);  i++)\n        {\n            _GLFWjoyelement* axis =\n                (_GLFWjoyelement*) CFArrayGetValueAtIndex(joystick->axisElements, i);\n\n            long value = getElementValue(joystick, axis);\n            long readScale = axis->maxReport - axis->minReport;\n\n            if (readScale == 0)\n                joystick->axes[i] = value;\n            else\n                joystick->axes[i] = (2.f * (value - axis->minReport) / readScale) - 1.f;\n\n            if (i & 1)\n                joystick->axes[i] = -joystick->axes[i];\n        }\n\n        for (i = 0;  i < CFArrayGetCount(joystick->hatElements);  i++)\n        {\n            _GLFWjoyelement* hat =\n                (_GLFWjoyelement*) CFArrayGetValueAtIndex(joystick->hatElements, i);\n\n            // Bit fields of button presses for each direction, including nil\n            const int directions[9] = { 1, 3, 2, 6, 4, 12, 8, 9, 0 };\n\n            long j, value = getElementValue(joystick, hat);\n            if (value < 0 || value > 8)\n                value = 8;\n\n            for (j = 0;  j < 4;  j++)\n            {\n                if (directions[value] & (1 << j))\n                    joystick->buttons[buttonIndex++] = GLFW_PRESS;\n                else\n                    joystick->buttons[buttonIndex++] = GLFW_RELEASE;\n            }\n        }\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialize joystick interface\n//\nvoid _glfwInitJoysticks(void)\n{\n    int joy = 0;\n    IOReturn result = kIOReturnSuccess;\n    mach_port_t masterPort = 0;\n    io_iterator_t objectIterator = 0;\n    CFMutableDictionaryRef hidMatchDictionary = NULL;\n    io_object_t ioHIDDeviceObject = 0;\n\n    result = IOMasterPort(bootstrap_port, &masterPort);\n    hidMatchDictionary = IOServiceMatching(kIOHIDDeviceKey);\n    if (kIOReturnSuccess != result || !hidMatchDictionary)\n    {\n        if (hidMatchDictionary)\n            CFRelease(hidMatchDictionary);\n\n        return;\n    }\n\n    result = IOServiceGetMatchingServices(masterPort,\n                                          hidMatchDictionary,\n                                          &objectIterator);\n    if (result != kIOReturnSuccess)\n        return;\n\n    if (!objectIterator)\n    {\n        // There are no joysticks\n        return;\n    }\n\n    while ((ioHIDDeviceObject = IOIteratorNext(objectIterator)))\n    {\n        kern_return_t result;\n        CFTypeRef valueRef = 0;\n\n        IOCFPlugInInterface** ppPlugInInterface = NULL;\n        HRESULT plugInResult = S_OK;\n        SInt32 score = 0;\n\n        long usagePage, usage;\n\n        // Check device type\n        valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject,\n                                                   CFSTR(kIOHIDPrimaryUsagePageKey),\n                                                   kCFAllocatorDefault,\n                                                   kNilOptions);\n        if (valueRef)\n        {\n            CFNumberGetValue(valueRef, kCFNumberLongType, &usagePage);\n            if (usagePage != kHIDPage_GenericDesktop)\n            {\n                // This device is not relevant to GLFW\n                continue;\n            }\n\n            CFRelease(valueRef);\n        }\n\n        valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject,\n                                                   CFSTR(kIOHIDPrimaryUsageKey),\n                                                   kCFAllocatorDefault,\n                                                   kNilOptions);\n        if (valueRef)\n        {\n            CFNumberGetValue(valueRef, kCFNumberLongType, &usage);\n\n            if ((usage != kHIDUsage_GD_Joystick &&\n                 usage != kHIDUsage_GD_GamePad &&\n                 usage != kHIDUsage_GD_MultiAxisController))\n            {\n                // This device is not relevant to GLFW\n                continue;\n            }\n\n            CFRelease(valueRef);\n        }\n\n        _GLFWjoy* joystick = _glfw.ns.joysticks + joy;\n        joystick->present = GL_TRUE;\n\n        result = IOCreatePlugInInterfaceForService(ioHIDDeviceObject,\n                                                   kIOHIDDeviceUserClientTypeID,\n                                                   kIOCFPlugInInterfaceID,\n                                                   &ppPlugInInterface,\n                                                   &score);\n\n        if (kIOReturnSuccess != result)\n            return;\n\n        plugInResult = (*ppPlugInInterface)->QueryInterface(\n                            ppPlugInInterface,\n                            CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID),\n                            (void *) &(joystick->interface));\n\n        if (plugInResult != S_OK)\n            return;\n\n        (*ppPlugInInterface)->Release(ppPlugInInterface);\n\n        (*(joystick->interface))->open(joystick->interface, 0);\n        (*(joystick->interface))->setRemovalCallback(joystick->interface,\n                                                     removalCallback,\n                                                     joystick,\n                                                     joystick);\n\n        // Get product string\n        valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject,\n                                                   CFSTR(kIOHIDProductKey),\n                                                   kCFAllocatorDefault,\n                                                   kNilOptions);\n        if (valueRef)\n        {\n            CFStringGetCString(valueRef,\n                               joystick->name,\n                               sizeof(joystick->name),\n                               kCFStringEncodingUTF8);\n            CFRelease(valueRef);\n        }\n\n        joystick->axisElements = CFArrayCreateMutable(NULL, 0, NULL);\n        joystick->buttonElements = CFArrayCreateMutable(NULL, 0, NULL);\n        joystick->hatElements = CFArrayCreateMutable(NULL, 0, NULL);\n\n        valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject,\n                                                   CFSTR(kIOHIDElementKey),\n                                                   kCFAllocatorDefault,\n                                                   kNilOptions);\n        if (CFGetTypeID(valueRef) == CFArrayGetTypeID())\n        {\n            CFRange range = { 0, CFArrayGetCount(valueRef) };\n            CFArrayApplyFunction(valueRef,\n                                 range,\n                                 getElementsCFArrayHandler,\n                                 (void*) joystick);\n            CFRelease(valueRef);\n        }\n\n        joystick->axes = (float*) calloc(CFArrayGetCount(joystick->axisElements),\n                                         sizeof(float));\n        joystick->buttons = (unsigned char*) calloc(CFArrayGetCount(joystick->buttonElements) +\n                                                    CFArrayGetCount(joystick->hatElements) * 4, 1);\n\n        joy++;\n        if (joy > GLFW_JOYSTICK_LAST)\n            break;\n    }\n}\n\n// Close all opened joystick handles\n//\nvoid _glfwTerminateJoysticks(void)\n{\n    int i;\n\n    for (i = 0;  i < GLFW_JOYSTICK_LAST + 1;  i++)\n    {\n        _GLFWjoy* joystick = &_glfw.ns.joysticks[i];\n        removeJoystick(joystick);\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformJoystickPresent(int joy)\n{\n    pollJoystickEvents();\n\n    return _glfw.ns.joysticks[joy].present;\n}\n\nconst float* _glfwPlatformGetJoystickAxes(int joy, int* count)\n{\n    _GLFWjoy* joystick = _glfw.ns.joysticks + joy;\n\n    pollJoystickEvents();\n\n    if (!joystick->present)\n        return NULL;\n\n    *count = (int) CFArrayGetCount(joystick->axisElements);\n    return joystick->axes;\n}\n\nconst unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)\n{\n    _GLFWjoy* joystick = _glfw.ns.joysticks + joy;\n\n    pollJoystickEvents();\n\n    if (!joystick->present)\n        return NULL;\n\n    *count = (int) CFArrayGetCount(joystick->buttonElements) +\n             (int) CFArrayGetCount(joystick->hatElements) * 4;\n    return joystick->buttons;\n}\n\nconst char* _glfwPlatformGetJoystickName(int joy)\n{\n    pollJoystickEvents();\n\n    return _glfw.ns.joysticks[joy].name;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/cocoa_monitor.m",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdlib.h>\n#include <limits.h>\n\n#include <IOKit/graphics/IOGraphicsLib.h>\n\n\n// Get the name of the specified display\n//\nstatic const char* getDisplayName(CGDirectDisplayID displayID)\n{\n    char* name;\n    CFDictionaryRef info, names;\n    CFStringRef value;\n    CFIndex size;\n\n    info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID),\n                                         kIODisplayOnlyPreferredName);\n    names = CFDictionaryGetValue(info, CFSTR(kDisplayProductName));\n\n    if (!CFDictionaryGetValueIfPresent(names, CFSTR(\"en_US\"),\n                                       (const void**) &value))\n    {\n        CFRelease(info);\n        return strdup(\"Unknown\");\n    }\n\n    size = CFStringGetMaximumSizeForEncoding(CFStringGetLength(value),\n                                             kCFStringEncodingUTF8);\n    name = (char*) malloc(size + 1);\n    CFStringGetCString(value, name, size, kCFStringEncodingUTF8);\n\n    CFRelease(info);\n\n    return name;\n}\n\n// Check whether the display mode should be included in enumeration\n//\nstatic GLboolean modeIsGood(CGDisplayModeRef mode)\n{\n    uint32_t flags = CGDisplayModeGetIOFlags(mode);\n    if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag))\n        return GL_FALSE;\n\n    if (flags & kDisplayModeInterlacedFlag)\n        return GL_FALSE;\n\n    if (flags & kDisplayModeTelevisionFlag)\n        return GL_FALSE;\n\n    if (flags & kDisplayModeStretchedFlag)\n        return GL_FALSE;\n\n    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);\n    if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&\n        CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))\n    {\n        CFRelease(format);\n        return GL_FALSE;\n    }\n\n    CFRelease(format);\n    return GL_TRUE;\n}\n\n// Convert Core Graphics display mode to GLFW video mode\n//\nstatic GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode)\n{\n    GLFWvidmode result;\n    result.width = CGDisplayModeGetWidth(mode);\n    result.height = CGDisplayModeGetHeight(mode);\n    result.refreshRate = (int) CGDisplayModeGetRefreshRate(mode);\n\n    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);\n\n    if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)\n    {\n        result.redBits = 5;\n        result.greenBits = 5;\n        result.blueBits = 5;\n    }\n    else\n    {\n        result.redBits = 8;\n        result.greenBits = 8;\n        result.blueBits = 8;\n    }\n\n    CFRelease(format);\n    return result;\n}\n\n// Starts reservation for display fading\n//\nstatic CGDisplayFadeReservationToken beginFadeReservation(void)\n{\n    CGDisplayFadeReservationToken token = kCGDisplayFadeReservationInvalidToken;\n\n    if (CGAcquireDisplayFadeReservation(5, &token) == kCGErrorSuccess)\n        CGDisplayFade(token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);\n\n    return token;\n}\n\n// Ends reservation for display fading\n//\nstatic void endFadeReservation(CGDisplayFadeReservationToken token)\n{\n    if (token != kCGDisplayFadeReservationInvalidToken)\n    {\n        CGDisplayFade(token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);\n        CGReleaseDisplayFadeReservation(token);\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Change the current video mode\n//\nGLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)\n{\n    CGDisplayModeRef bestMode = NULL;\n    CFArrayRef modes;\n    CFIndex count, i;\n    unsigned int sizeDiff, leastSizeDiff = UINT_MAX;\n    unsigned int rateDiff, leastRateDiff = UINT_MAX;\n    const int bpp = desired->redBits - desired->greenBits - desired->blueBits;\n\n    modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);\n    count = CFArrayGetCount(modes);\n\n    for (i = 0;  i < count;  i++)\n    {\n        CGDisplayModeRef mode = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);\n        if (!modeIsGood(mode))\n            continue;\n\n        int modeBPP;\n\n        // Identify display mode pixel encoding\n        {\n            CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);\n\n            if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)\n                modeBPP = 16;\n            else\n                modeBPP = 32;\n\n            CFRelease(format);\n        }\n\n        const int modeWidth = (int) CGDisplayModeGetWidth(mode);\n        const int modeHeight = (int) CGDisplayModeGetHeight(mode);\n        const int modeRate = (int) CGDisplayModeGetRefreshRate(mode);\n\n        sizeDiff = (abs(modeBPP - bpp) << 25) |\n                   ((modeWidth - desired->width) * (modeWidth - desired->width) +\n                    (modeHeight - desired->height) * (modeHeight - desired->height));\n\n        if (desired->refreshRate)\n            rateDiff = abs(modeRate - desired->refreshRate);\n        else\n            rateDiff = UINT_MAX - modeRate;\n\n        if ((sizeDiff < leastSizeDiff) ||\n            (sizeDiff == leastSizeDiff && rateDiff < leastRateDiff))\n        {\n            bestMode = mode;\n            leastSizeDiff = sizeDiff;\n            leastRateDiff = rateDiff;\n        }\n    }\n\n    if (!bestMode)\n    {\n        CFRelease(modes);\n        return GL_FALSE;\n    }\n\n    monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);\n\n    CGDisplayFadeReservationToken token = beginFadeReservation();\n\n    CGDisplayCapture(monitor->ns.displayID);\n    CGDisplaySetDisplayMode(monitor->ns.displayID, bestMode, NULL);\n\n    endFadeReservation(token);\n\n    CFRelease(modes);\n    return GL_TRUE;\n}\n\n// Restore the previously saved (original) video mode\n//\nvoid _glfwRestoreVideoMode(_GLFWmonitor* monitor)\n{\n    CGDisplayFadeReservationToken token = beginFadeReservation();\n\n    CGDisplaySetDisplayMode(monitor->ns.displayID, monitor->ns.previousMode, NULL);\n    CGDisplayRelease(monitor->ns.displayID);\n\n    endFadeReservation(token);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n_GLFWmonitor** _glfwPlatformGetMonitors(int* count)\n{\n    uint32_t i, found = 0, monitorCount;\n    _GLFWmonitor** monitors;\n    CGDirectDisplayID* displays;\n\n    *count = 0;\n\n    CGGetActiveDisplayList(0, NULL, &monitorCount);\n\n    displays = (CGDirectDisplayID*) calloc(monitorCount, sizeof(CGDirectDisplayID));\n    monitors = (_GLFWmonitor**) calloc(monitorCount, sizeof(_GLFWmonitor*));\n\n    CGGetActiveDisplayList(monitorCount, displays, &monitorCount);\n\n    for (i = 0;  i < monitorCount;  i++)\n    {\n        const CGSize size = CGDisplayScreenSize(displays[i]);\n\n        monitors[found] = _glfwCreateMonitor(getDisplayName(displays[i]),\n                                             size.width, size.height);\n\n        monitors[found]->ns.displayID = displays[i];\n        found++;\n    }\n\n    free(displays);\n\n    for (i = 0;  i < monitorCount;  i++)\n    {\n        if (CGDisplayIsMain(monitors[i]->ns.displayID))\n        {\n            _GLFWmonitor* temp = monitors[0];\n            monitors[0] = monitors[i];\n            monitors[i] = temp;\n            break;\n        }\n    }\n\n    NSArray* screens = [NSScreen screens];\n\n    for (i = 0;  i < monitorCount;  i++)\n    {\n        int j;\n\n        for (j = 0;  j < [screens count];  j++)\n        {\n            NSScreen* screen = [screens objectAtIndex:j];\n            NSDictionary* dictionary = [screen deviceDescription];\n            NSNumber* number = [dictionary objectForKey:@\"NSScreenNumber\"];\n\n            if (monitors[i]->ns.displayID == [number unsignedIntegerValue])\n            {\n                monitors[i]->ns.screen = screen;\n                break;\n            }\n        }\n\n        if (monitors[i]->ns.screen == nil)\n        {\n            _glfwDestroyMonitors(monitors, monitorCount);\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"Cocoa: Failed to find NSScreen for CGDisplay %s\",\n                            monitors[i]->name);\n\n            free(monitors);\n            return NULL;\n        }\n    }\n\n    *count = monitorCount;\n    return monitors;\n}\n\nGLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)\n{\n    return first->ns.displayID == second->ns.displayID;\n}\n\nvoid _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)\n{\n    const CGRect bounds = CGDisplayBounds(monitor->ns.displayID);\n\n    if (xpos)\n        *xpos = (int) bounds.origin.x;\n    if (ypos)\n        *ypos = (int) bounds.origin.y;\n}\n\nGLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)\n{\n    CFArrayRef modes;\n    CFIndex count, i;\n    GLFWvidmode* result;\n\n    modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);\n    count = CFArrayGetCount(modes);\n\n    result = (GLFWvidmode*) malloc(sizeof(GLFWvidmode) * count);\n    *found = 0;\n\n    for (i = 0;  i < count;  i++)\n    {\n        CGDisplayModeRef mode;\n\n        mode = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);\n        if (modeIsGood(mode))\n        {\n            result[*found] = vidmodeFromCGDisplayMode(mode);\n            (*found)++;\n        }\n    }\n\n    CFRelease(modes);\n    return result;\n}\n\nvoid _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)\n{\n    CGDisplayModeRef displayMode;\n\n    displayMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);\n    *mode = vidmodeFromCGDisplayMode(displayMode);\n    CGDisplayModeRelease(displayMode);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/cocoa_platform.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa\n// API Version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#ifndef _cocoa_platform_h_\n#define _cocoa_platform_h_\n\n\n#include <stdint.h>\n\n#if defined(__OBJC__)\n#import <Cocoa/Cocoa.h>\n#else\n#include <ApplicationServices/ApplicationServices.h>\ntypedef void* id;\n#endif\n\n#if defined(_GLFW_NSGL)\n #include \"nsgl_platform.h\"\n#else\n #error \"No supported context creation API selected\"\n#endif\n\n#include <IOKit/IOKitLib.h>\n#include <IOKit/IOCFPlugIn.h>\n#include <IOKit/hid/IOHIDLib.h>\n#include <IOKit/hid/IOHIDKeys.h>\n\n#define _GLFW_PLATFORM_WINDOW_STATE         _GLFWwindowNS  ns\n#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns\n#define _GLFW_PLATFORM_MONITOR_STATE        _GLFWmonitorNS ns\n\n\n//========================================================================\n// GLFW platform specific types\n//========================================================================\n\n\n//------------------------------------------------------------------------\n// Platform-specific window structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWwindowNS\n{\n    id              object;\n    id\t            delegate;\n    id              view;\n    unsigned int    modifierFlags;\n} _GLFWwindowNS;\n\n\n//------------------------------------------------------------------------\n// Joystick information & state\n//------------------------------------------------------------------------\ntypedef struct\n{\n    int             present;\n    char            name[256];\n\n    IOHIDDeviceInterface** interface;\n\n    CFMutableArrayRef axisElements;\n    CFMutableArrayRef buttonElements;\n    CFMutableArrayRef hatElements;\n\n    float*          axes;\n    unsigned char*  buttons;\n\n} _GLFWjoy;\n\n\n//------------------------------------------------------------------------\n// Platform-specific library global data for Cocoa\n//------------------------------------------------------------------------\ntypedef struct _GLFWlibraryNS\n{\n    struct {\n        double      base;\n        double      resolution;\n    } timer;\n\n    CGEventSourceRef eventSource;\n    id              delegate;\n    id              autoreleasePool;\n    id              cursor;\n\n    GLboolean       cursorHidden;\n\n    char*           clipboardString;\n\n    _GLFWjoy        joysticks[GLFW_JOYSTICK_LAST + 1];\n} _GLFWlibraryNS;\n\n\n//------------------------------------------------------------------------\n// Platform-specific monitor structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWmonitorNS\n{\n    CGDirectDisplayID   displayID;\n    CGDisplayModeRef    previousMode;\n    id                  screen;\n\n} _GLFWmonitorNS;\n\n\n//========================================================================\n// Prototypes for platform specific internal functions\n//========================================================================\n\n// Time\nvoid _glfwInitTimer(void);\n\n// Joystick input\nvoid _glfwInitJoysticks(void);\nvoid _glfwTerminateJoysticks(void);\n\n// Fullscreen\nGLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);\nvoid _glfwRestoreVideoMode(_GLFWmonitor* monitor);\n\n// OpenGL support\nint _glfwInitContextAPI(void);\nvoid _glfwTerminateContextAPI(void);\nint _glfwCreateContext(_GLFWwindow* window,\n                       const _GLFWwndconfig* wndconfig,\n                       const _GLFWfbconfig* fbconfig);\nvoid _glfwDestroyContext(_GLFWwindow* window);\n\n#endif // _cocoa_platform_h_\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/cocoa_time.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa\n// API Version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <mach/mach_time.h>\n\n\n// Return raw time\n//\nstatic uint64_t getRawTime(void)\n{\n    return mach_absolute_time();\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialise timer\n//\nvoid _glfwInitTimer(void)\n{\n    mach_timebase_info_data_t info;\n    mach_timebase_info(&info);\n\n    _glfw.ns.timer.resolution = (double) info.numer / (info.denom * 1.0e9);\n    _glfw.ns.timer.base = getRawTime();\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\ndouble _glfwPlatformGetTime(void)\n{\n    return (double) (getRawTime() - _glfw.ns.timer.base) *\n        _glfw.ns.timer.resolution;\n}\n\nvoid _glfwPlatformSetTime(double time)\n{\n    _glfw.ns.timer.base = getRawTime() -\n        (uint64_t) (time / _glfw.ns.timer.resolution);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/cocoa_window.m",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa/NSOpenGL\n// API Version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n// Needed for _NSGetProgname\n#include <crt_externs.h>\n\n\n// Enter fullscreen mode\n//\nstatic void enterFullscreenMode(_GLFWwindow* window)\n{\n    if ([window->ns.view isInFullScreenMode])\n        return;\n\n    _glfwSetVideoMode(window->monitor, &window->videoMode);\n\n    [window->ns.view enterFullScreenMode:window->monitor->ns.screen\n                             withOptions:nil];\n}\n\n// Leave fullscreen mode\n//\nstatic void leaveFullscreenMode(_GLFWwindow* window)\n{\n    if (![window->ns.view isInFullScreenMode])\n        return;\n\n    _glfwRestoreVideoMode(window->monitor);\n\n    // Exit full screen after the video restore to avoid a nasty display\n    // flickering during the fade\n    [window->ns.view exitFullScreenModeWithOptions:nil];\n}\n\n// Transforms the specified y-coordinate between the CG display and NS screen\n// coordinate systems\n//\nstatic float transformY(float y)\n{\n    const float height = CGDisplayBounds(CGMainDisplayID()).size.height;\n    return height - y;\n}\n\n// Returns the backing rect of the specified window\n//\nstatic NSRect convertRectToBacking(_GLFWwindow* window, NSRect contentRect)\n{\n    if ([window->ns.view respondsToSelector:@selector(convertRectToBacking:)])\n        return [window->ns.view convertRectToBacking:contentRect];\n    else\n        return contentRect;\n}\n\n\n//------------------------------------------------------------------------\n// Delegate for window related notifications\n//------------------------------------------------------------------------\n\n@interface GLFWWindowDelegate : NSObject\n{\n    _GLFWwindow* window;\n}\n\n- (id)initWithGlfwWindow:(_GLFWwindow *)initWndow;\n\n@end\n\n@implementation GLFWWindowDelegate\n\nstatic void centerCursor(_GLFWwindow *window)\n{\n    int width, height;\n    _glfwPlatformGetWindowSize(window, &width, &height);\n    _glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0);\n}\n\n- (id)initWithGlfwWindow:(_GLFWwindow *)initWindow\n{\n    self = [super init];\n    if (self != nil)\n        window = initWindow;\n\n    return self;\n}\n\n- (BOOL)windowShouldClose:(id)sender\n{\n    _glfwInputWindowCloseRequest(window);\n    return NO;\n}\n\n- (void)windowDidResize:(NSNotification *)notification\n{\n    [window->nsgl.context update];\n\n    const NSRect contentRect = [window->ns.view frame];\n    const NSRect fbRect = convertRectToBacking(window, contentRect);\n\n    _glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);\n    _glfwInputWindowSize(window, contentRect.size.width, contentRect.size.height);\n    _glfwInputWindowDamage(window);\n\n    if (window->cursorMode == GLFW_CURSOR_DISABLED)\n        centerCursor(window);\n}\n\n- (void)windowDidMove:(NSNotification *)notification\n{\n    [window->nsgl.context update];\n\n    int x, y;\n    _glfwPlatformGetWindowPos(window, &x, &y);\n    _glfwInputWindowPos(window, x, y);\n\n    if (window->cursorMode == GLFW_CURSOR_DISABLED)\n        centerCursor(window);\n}\n\n- (void)windowDidMiniaturize:(NSNotification *)notification\n{\n    _glfwInputWindowIconify(window, GL_TRUE);\n}\n\n- (void)windowDidDeminiaturize:(NSNotification *)notification\n{\n    if (window->monitor)\n        enterFullscreenMode(window);\n\n    _glfwInputWindowIconify(window, GL_FALSE);\n}\n\n- (void)windowDidBecomeKey:(NSNotification *)notification\n{\n    _glfwInputWindowFocus(window, GL_TRUE);\n\n    if (window->cursorMode == GLFW_CURSOR_DISABLED)\n        centerCursor(window);\n}\n\n- (void)windowDidResignKey:(NSNotification *)notification\n{\n    _glfwInputWindowFocus(window, GL_FALSE);\n}\n\n@end\n\n\n//------------------------------------------------------------------------\n// Delegate for application related notifications\n//------------------------------------------------------------------------\n\n@interface GLFWApplicationDelegate : NSObject\n@end\n\n@implementation GLFWApplicationDelegate\n\n- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender\n{\n    _GLFWwindow* window;\n\n    for (window = _glfw.windowListHead;  window;  window = window->next)\n        _glfwInputWindowCloseRequest(window);\n\n    return NSTerminateCancel;\n}\n\n- (void)applicationDidHide:(NSNotification *)notification\n{\n    _GLFWwindow* window;\n\n    for (window = _glfw.windowListHead;  window;  window = window->next)\n        _glfwInputWindowVisibility(window, GL_FALSE);\n}\n\n- (void)applicationDidUnhide:(NSNotification *)notification\n{\n    _GLFWwindow* window;\n\n    for (window = _glfw.windowListHead;  window;  window = window->next)\n    {\n        if ([window->ns.object isVisible])\n            _glfwInputWindowVisibility(window, GL_TRUE);\n    }\n}\n\n- (void)applicationDidChangeScreenParameters:(NSNotification *) notification\n{\n    _glfwInputMonitorChange();\n}\n\n@end\n\n// Translates Mac OS X key modifiers into GLFW ones\n//\nstatic int translateFlags(NSUInteger flags)\n{\n    int mods = 0;\n\n    if (flags & NSShiftKeyMask)\n        mods |= GLFW_MOD_SHIFT;\n    if (flags & NSControlKeyMask)\n        mods |= GLFW_MOD_CONTROL;\n    if (flags & NSAlternateKeyMask)\n        mods |= GLFW_MOD_ALT;\n    if (flags & NSCommandKeyMask)\n        mods |= GLFW_MOD_SUPER;\n\n    return mods;\n}\n\n// Translates a Mac OS X keycode to a GLFW keycode\n//\nstatic int translateKey(unsigned int key)\n{\n    // Keyboard symbol translation table\n    // TODO: Need to find mappings for F13-F15, volume down/up/mute, and eject.\n    static const unsigned int table[128] =\n    {\n        /* 00 */ GLFW_KEY_A,\n        /* 01 */ GLFW_KEY_S,\n        /* 02 */ GLFW_KEY_D,\n        /* 03 */ GLFW_KEY_F,\n        /* 04 */ GLFW_KEY_H,\n        /* 05 */ GLFW_KEY_G,\n        /* 06 */ GLFW_KEY_Z,\n        /* 07 */ GLFW_KEY_X,\n        /* 08 */ GLFW_KEY_C,\n        /* 09 */ GLFW_KEY_V,\n        /* 0a */ GLFW_KEY_GRAVE_ACCENT,\n        /* 0b */ GLFW_KEY_B,\n        /* 0c */ GLFW_KEY_Q,\n        /* 0d */ GLFW_KEY_W,\n        /* 0e */ GLFW_KEY_E,\n        /* 0f */ GLFW_KEY_R,\n        /* 10 */ GLFW_KEY_Y,\n        /* 11 */ GLFW_KEY_T,\n        /* 12 */ GLFW_KEY_1,\n        /* 13 */ GLFW_KEY_2,\n        /* 14 */ GLFW_KEY_3,\n        /* 15 */ GLFW_KEY_4,\n        /* 16 */ GLFW_KEY_6,\n        /* 17 */ GLFW_KEY_5,\n        /* 18 */ GLFW_KEY_EQUAL,\n        /* 19 */ GLFW_KEY_9,\n        /* 1a */ GLFW_KEY_7,\n        /* 1b */ GLFW_KEY_MINUS,\n        /* 1c */ GLFW_KEY_8,\n        /* 1d */ GLFW_KEY_0,\n        /* 1e */ GLFW_KEY_RIGHT_BRACKET,\n        /* 1f */ GLFW_KEY_O,\n        /* 20 */ GLFW_KEY_U,\n        /* 21 */ GLFW_KEY_LEFT_BRACKET,\n        /* 22 */ GLFW_KEY_I,\n        /* 23 */ GLFW_KEY_P,\n        /* 24 */ GLFW_KEY_ENTER,\n        /* 25 */ GLFW_KEY_L,\n        /* 26 */ GLFW_KEY_J,\n        /* 27 */ GLFW_KEY_APOSTROPHE,\n        /* 28 */ GLFW_KEY_K,\n        /* 29 */ GLFW_KEY_SEMICOLON,\n        /* 2a */ GLFW_KEY_BACKSLASH,\n        /* 2b */ GLFW_KEY_COMMA,\n        /* 2c */ GLFW_KEY_SLASH,\n        /* 2d */ GLFW_KEY_N,\n        /* 2e */ GLFW_KEY_M,\n        /* 2f */ GLFW_KEY_PERIOD,\n        /* 30 */ GLFW_KEY_TAB,\n        /* 31 */ GLFW_KEY_SPACE,\n        /* 32 */ GLFW_KEY_WORLD_1,\n        /* 33 */ GLFW_KEY_BACKSPACE,\n        /* 34 */ GLFW_KEY_UNKNOWN,\n        /* 35 */ GLFW_KEY_ESCAPE,\n        /* 36 */ GLFW_KEY_RIGHT_SUPER,\n        /* 37 */ GLFW_KEY_LEFT_SUPER,\n        /* 38 */ GLFW_KEY_LEFT_SHIFT,\n        /* 39 */ GLFW_KEY_CAPS_LOCK,\n        /* 3a */ GLFW_KEY_LEFT_ALT,\n        /* 3b */ GLFW_KEY_LEFT_CONTROL,\n        /* 3c */ GLFW_KEY_RIGHT_SHIFT,\n        /* 3d */ GLFW_KEY_RIGHT_ALT,\n        /* 3e */ GLFW_KEY_RIGHT_CONTROL,\n        /* 3f */ GLFW_KEY_UNKNOWN, /* Function */\n        /* 40 */ GLFW_KEY_F17,\n        /* 41 */ GLFW_KEY_KP_DECIMAL,\n        /* 42 */ GLFW_KEY_UNKNOWN,\n        /* 43 */ GLFW_KEY_KP_MULTIPLY,\n        /* 44 */ GLFW_KEY_UNKNOWN,\n        /* 45 */ GLFW_KEY_KP_ADD,\n        /* 46 */ GLFW_KEY_UNKNOWN,\n        /* 47 */ GLFW_KEY_NUM_LOCK, /* Really KeypadClear... */\n        /* 48 */ GLFW_KEY_UNKNOWN, /* VolumeUp */\n        /* 49 */ GLFW_KEY_UNKNOWN, /* VolumeDown */\n        /* 4a */ GLFW_KEY_UNKNOWN, /* Mute */\n        /* 4b */ GLFW_KEY_KP_DIVIDE,\n        /* 4c */ GLFW_KEY_KP_ENTER,\n        /* 4d */ GLFW_KEY_UNKNOWN,\n        /* 4e */ GLFW_KEY_KP_SUBTRACT,\n        /* 4f */ GLFW_KEY_F18,\n        /* 50 */ GLFW_KEY_F19,\n        /* 51 */ GLFW_KEY_KP_EQUAL,\n        /* 52 */ GLFW_KEY_KP_0,\n        /* 53 */ GLFW_KEY_KP_1,\n        /* 54 */ GLFW_KEY_KP_2,\n        /* 55 */ GLFW_KEY_KP_3,\n        /* 56 */ GLFW_KEY_KP_4,\n        /* 57 */ GLFW_KEY_KP_5,\n        /* 58 */ GLFW_KEY_KP_6,\n        /* 59 */ GLFW_KEY_KP_7,\n        /* 5a */ GLFW_KEY_F20,\n        /* 5b */ GLFW_KEY_KP_8,\n        /* 5c */ GLFW_KEY_KP_9,\n        /* 5d */ GLFW_KEY_UNKNOWN,\n        /* 5e */ GLFW_KEY_UNKNOWN,\n        /* 5f */ GLFW_KEY_UNKNOWN,\n        /* 60 */ GLFW_KEY_F5,\n        /* 61 */ GLFW_KEY_F6,\n        /* 62 */ GLFW_KEY_F7,\n        /* 63 */ GLFW_KEY_F3,\n        /* 64 */ GLFW_KEY_F8,\n        /* 65 */ GLFW_KEY_F9,\n        /* 66 */ GLFW_KEY_UNKNOWN,\n        /* 67 */ GLFW_KEY_F11,\n        /* 68 */ GLFW_KEY_UNKNOWN,\n        /* 69 */ GLFW_KEY_PRINT_SCREEN,\n        /* 6a */ GLFW_KEY_F16,\n        /* 6b */ GLFW_KEY_F14,\n        /* 6c */ GLFW_KEY_UNKNOWN,\n        /* 6d */ GLFW_KEY_F10,\n        /* 6e */ GLFW_KEY_UNKNOWN,\n        /* 6f */ GLFW_KEY_F12,\n        /* 70 */ GLFW_KEY_UNKNOWN,\n        /* 71 */ GLFW_KEY_F15,\n        /* 72 */ GLFW_KEY_INSERT, /* Really Help... */\n        /* 73 */ GLFW_KEY_HOME,\n        /* 74 */ GLFW_KEY_PAGE_UP,\n        /* 75 */ GLFW_KEY_DELETE,\n        /* 76 */ GLFW_KEY_F4,\n        /* 77 */ GLFW_KEY_END,\n        /* 78 */ GLFW_KEY_F2,\n        /* 79 */ GLFW_KEY_PAGE_DOWN,\n        /* 7a */ GLFW_KEY_F1,\n        /* 7b */ GLFW_KEY_LEFT,\n        /* 7c */ GLFW_KEY_RIGHT,\n        /* 7d */ GLFW_KEY_DOWN,\n        /* 7e */ GLFW_KEY_UP,\n        /* 7f */ GLFW_KEY_UNKNOWN,\n    };\n\n    if (key >= 128)\n        return GLFW_KEY_UNKNOWN;\n\n    return table[key];\n}\n\n\n//------------------------------------------------------------------------\n// Content view class for the GLFW window\n//------------------------------------------------------------------------\n\n@interface GLFWContentView : NSView\n{\n    _GLFWwindow* window;\n    NSTrackingArea* trackingArea;\n\tNSText* fieldEditor;\n}\n\n- (id)initWithGlfwWindow:(_GLFWwindow *)initWindow;\n\n@end\n\n@implementation GLFWContentView\n\n+ (void)initialize\n{\t\n    if (self == [GLFWContentView class])\n    {\n        if (_glfw.ns.cursor == nil)\n        {\n            NSImage* data = [[NSImage alloc] initWithSize:NSMakeSize(1, 1)];\n            _glfw.ns.cursor = [[NSCursor alloc] initWithImage:data\n                                                      hotSpot:NSZeroPoint];\n            [data release];\n        }\n    }\n}\n\n- (id)initWithGlfwWindow:(_GLFWwindow *)initWindow\n{\n    self = [super init];\n    if (self != nil)\n    {\n        window = initWindow;\n        trackingArea = nil;\n\n        [self updateTrackingAreas];\n\t\n\t\tNSRect r = NSMakeRect(0.0, 0.0, 0.0, 0.0);\n\t\tfieldEditor = [[NSTextView alloc] initWithFrame:r];\n\t\t[self addSubview: fieldEditor];\n    }\n\n    return self;\n}\n\n-(void)dealloc\n{\n    [fieldEditor release];\n\t[trackingArea release];\n    [super dealloc];\n}\n\n- (BOOL)isOpaque\n{\n    return YES;\n}\n\n- (BOOL)canBecomeKeyView\n{\n    return YES;\n}\n\n- (BOOL)acceptsFirstResponder\n{\n    return YES;\n}\n\n- (void)mouseDown:(NSEvent *)event\n{\n    _glfwInputMouseClick(window,\n                         GLFW_MOUSE_BUTTON_LEFT,\n                         GLFW_PRESS,\n                         translateFlags([event modifierFlags]));\n}\n\n- (void)mouseDragged:(NSEvent *)event\n{\n    [self mouseMoved:event];\n}\n\n- (void)mouseUp:(NSEvent *)event\n{\n    _glfwInputMouseClick(window,\n                         GLFW_MOUSE_BUTTON_LEFT,\n                         GLFW_RELEASE,\n                         translateFlags([event modifierFlags]));\n}\n\n- (void)mouseMoved:(NSEvent *)event\n{\n    if (window->cursorMode == GLFW_CURSOR_DISABLED)\n        _glfwInputCursorMotion(window, [event deltaX], [event deltaY]);\n    else\n    {\n        const NSRect contentRect = [window->ns.view frame];\n        const NSPoint p = [event locationInWindow];\n\n        _glfwInputCursorMotion(window, p.x, contentRect.size.height - p.y);\n    }\n}\n\n- (void)rightMouseDown:(NSEvent *)event\n{\n    _glfwInputMouseClick(window,\n                         GLFW_MOUSE_BUTTON_RIGHT,\n                         GLFW_PRESS,\n                         translateFlags([event modifierFlags]));\n}\n\n- (void)rightMouseDragged:(NSEvent *)event\n{\n    [self mouseMoved:event];\n}\n\n- (void)rightMouseUp:(NSEvent *)event\n{\n    _glfwInputMouseClick(window,\n                         GLFW_MOUSE_BUTTON_RIGHT,\n                         GLFW_RELEASE,\n                         translateFlags([event modifierFlags]));\n}\n\n- (void)otherMouseDown:(NSEvent *)event\n{\n    _glfwInputMouseClick(window,\n                         [event buttonNumber],\n                         GLFW_PRESS,\n                         translateFlags([event modifierFlags]));\n}\n\n- (void)otherMouseDragged:(NSEvent *)event\n{\n    [self mouseMoved:event];\n}\n\n- (void)otherMouseUp:(NSEvent *)event\n{\n    _glfwInputMouseClick(window,\n                         [event buttonNumber],\n                         GLFW_RELEASE,\n                         translateFlags([event modifierFlags]));\n}\n\n- (void)mouseExited:(NSEvent *)event\n{\n    _glfwInputCursorEnter(window, GL_FALSE);\n}\n\n- (void)mouseEntered:(NSEvent *)event\n{\n    _glfwInputCursorEnter(window, GL_TRUE);\n}\n\n- (void)viewDidChangeBackingProperties\n{\n    const NSRect contentRect = [window->ns.view frame];\n    const NSRect fbRect = convertRectToBacking(window, contentRect);\n\n    _glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);\n}\n\n- (void)updateTrackingAreas\n{\n    if (trackingArea != nil)\n    {\n        [self removeTrackingArea:trackingArea];\n        [trackingArea release];\n    }\n\n    NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited |\n                                    NSTrackingActiveAlways |\n                                    NSTrackingInVisibleRect;\n\n    trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds]\n                                                options:options\n                                                  owner:self\n                                               userInfo:nil];\n\n    [self addTrackingArea:trackingArea];\n\t[super updateTrackingAreas];\n}\n\n- (void)keyDown:(NSEvent *)event\n{\n\tconst int keyCode = [event keyCode];\n    const int key = translateKey(keyCode);\n    const int mods = translateFlags([event modifierFlags]);\n    _glfwInputKey(window, key, [event keyCode], GLFW_PRESS, mods);\n\n    if (mods & GLFW_MOD_SUPER)\n        return;\n\n\tif ((key >= GLFW_KEY_ESCAPE && key <= GLFW_KEY_F25) ||\n\t    (key >= GLFW_KEY_LEFT_SHIFT && key <= GLFW_KEY_LAST))\n\t\treturn;\n\t\n\t[fieldEditor interpretKeyEvents:[NSArray arrayWithObject:event]];\n\n    NSString* characters = [event characters];\n    NSUInteger i, length = [characters length];\n\n    for (i = 0;  i < length;  i++)\n        _glfwInputChar(window, [characters characterAtIndex:i]);\n}\n\n- (void)flagsChanged:(NSEvent *)event\n{\n    int action;\n    unsigned int newModifierFlags =\n        [event modifierFlags] & NSDeviceIndependentModifierFlagsMask;\n\n    if (newModifierFlags > window->ns.modifierFlags)\n        action = GLFW_PRESS;\n    else\n        action = GLFW_RELEASE;\n\n    window->ns.modifierFlags = newModifierFlags;\n\n    const int key = translateKey([event keyCode]);\n    const int mods = translateFlags([event modifierFlags]);\n    _glfwInputKey(window, key, [event keyCode], action, mods);\n}\n\n- (void)keyUp:(NSEvent *)event\n{\n    const int key = translateKey([event keyCode]);\n    const int mods = translateFlags([event modifierFlags]);\n    _glfwInputKey(window, key, [event keyCode], GLFW_RELEASE, mods);\n}\n\n- (void)scrollWheel:(NSEvent *)event\n{\n    double deltaX = [event deltaX];\n    double deltaY = [event deltaY];\n\n    if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)\n        _glfwInputScroll(window, deltaX, deltaY);\n}\n\n/*\n- (void)resetCursorRects\n{\n    [self discardCursorRects];\n    [self addCursorRect:[self bounds] cursor:_glfw.ns.cursor];\n}*/\n\n@end\n\n\n//------------------------------------------------------------------------\n// GLFW window class\n//------------------------------------------------------------------------\n\n@interface GLFWWindow : NSWindow {}\n@end\n\n@implementation GLFWWindow\n\n- (BOOL)canBecomeKeyWindow\n{\n    // Required for NSBorderlessWindowMask windows\n    return YES;\n}\n\n@end\n\n\n//------------------------------------------------------------------------\n// GLFW application class\n//------------------------------------------------------------------------\n\n@interface GLFWApplication : NSApplication\n@end\n\n@implementation GLFWApplication\n\n// From http://cocoadev.com/index.pl?GameKeyboardHandlingAlmost\n// This works around an AppKit bug, where key up events while holding\n// down the command key don't get sent to the key window.\n- (void)sendEvent:(NSEvent *)event\n{\n    if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask))\n        [[self keyWindow] sendEvent:event];\n    else\n        [super sendEvent:event];\n}\n\n@end\n\n#if defined(_GLFW_USE_MENUBAR)\n\n// Try to figure out what the calling application is called\n//\nstatic NSString* findAppName(void)\n{\n    unsigned int i;\n    NSDictionary* infoDictionary = [[NSBundle mainBundle] infoDictionary];\n\n    // Keys to search for as potential application names\n    NSString* GLFWNameKeys[] =\n    {\n        @\"CFBundleDisplayName\",\n        @\"CFBundleName\",\n        @\"CFBundleExecutable\",\n    };\n\n    for (i = 0;  i < sizeof(GLFWNameKeys) / sizeof(GLFWNameKeys[0]);  i++)\n    {\n        id name = [infoDictionary objectForKey:GLFWNameKeys[i]];\n        if (name &&\n            [name isKindOfClass:[NSString class]] &&\n            ![name isEqualToString:@\"\"])\n        {\n            return name;\n        }\n    }\n\n    char** progname = _NSGetProgname();\n    if (progname && *progname)\n        return [NSString stringWithUTF8String:*progname];\n\n    // Really shouldn't get here\n    return @\"GLFW Application\";\n}\n\n// Set up the menu bar (manually)\n// This is nasty, nasty stuff -- calls to undocumented semi-private APIs that\n// could go away at any moment, lots of stuff that really should be\n// localize(d|able), etc.  Loading a nib would save us this horror, but that\n// doesn't seem like a good thing to require of GLFW's clients.\n//\nstatic void createMenuBar(void)\n{\n    NSString* appName = findAppName();\n\n    NSMenu* bar = [[NSMenu alloc] init];\n    [NSApp setMainMenu:bar];\n\n    NSMenuItem* appMenuItem =\n        [bar addItemWithTitle:@\"\" action:NULL keyEquivalent:@\"\"];\n    NSMenu* appMenu = [[NSMenu alloc] init];\n    [appMenuItem setSubmenu:appMenu];\n\n    [appMenu addItemWithTitle:[NSString stringWithFormat:@\"About %@\", appName]\n                       action:@selector(orderFrontStandardAboutPanel:)\n                keyEquivalent:@\"\"];\n    [appMenu addItem:[NSMenuItem separatorItem]];\n    NSMenu* servicesMenu = [[NSMenu alloc] init];\n    [NSApp setServicesMenu:servicesMenu];\n    [[appMenu addItemWithTitle:@\"Services\"\n                       action:NULL\n                keyEquivalent:@\"\"] setSubmenu:servicesMenu];\n    [appMenu addItem:[NSMenuItem separatorItem]];\n    [appMenu addItemWithTitle:[NSString stringWithFormat:@\"Hide %@\", appName]\n                       action:@selector(hide:)\n                keyEquivalent:@\"h\"];\n    [[appMenu addItemWithTitle:@\"Hide Others\"\n                       action:@selector(hideOtherApplications:)\n                keyEquivalent:@\"h\"]\n        setKeyEquivalentModifierMask:NSAlternateKeyMask | NSCommandKeyMask];\n    [appMenu addItemWithTitle:@\"Show All\"\n                       action:@selector(unhideAllApplications:)\n                keyEquivalent:@\"\"];\n    [appMenu addItem:[NSMenuItem separatorItem]];\n    [appMenu addItemWithTitle:[NSString stringWithFormat:@\"Quit %@\", appName]\n                       action:@selector(terminate:)\n                keyEquivalent:@\"q\"];\n\n    NSMenuItem* windowMenuItem =\n        [bar addItemWithTitle:@\"\" action:NULL keyEquivalent:@\"\"];\n    NSMenu* windowMenu = [[NSMenu alloc] initWithTitle:@\"Window\"];\n    [NSApp setWindowsMenu:windowMenu];\n    [windowMenuItem setSubmenu:windowMenu];\n\n    [windowMenu addItemWithTitle:@\"Miniaturize\"\n                          action:@selector(performMiniaturize:)\n                   keyEquivalent:@\"m\"];\n    [windowMenu addItemWithTitle:@\"Zoom\"\n                          action:@selector(performZoom:)\n                   keyEquivalent:@\"\"];\n    [windowMenu addItem:[NSMenuItem separatorItem]];\n    [windowMenu addItemWithTitle:@\"Bring All to Front\"\n                          action:@selector(arrangeInFront:)\n                   keyEquivalent:@\"\"];\n\n    // Prior to Snow Leopard, we need to use this oddly-named semi-private API\n    // to get the application menu working properly.\n    [NSApp performSelector:@selector(setAppleMenu:) withObject:appMenu];\n}\n\n#endif /* _GLFW_USE_MENUBAR */\n\n// Initialize the Cocoa Application Kit\n//\nstatic GLboolean initializeAppKit(void)\n{\n    if (NSApp)\n        return GL_TRUE;\n\n    // Implicitly create shared NSApplication instance\n    [GLFWApplication sharedApplication];\n\n    // If we get here, the application is unbundled\n    ProcessSerialNumber psn = { 0, kCurrentProcess };\n    TransformProcessType(&psn, kProcessTransformToForegroundApplication);\n\n    // Having the app in front of the terminal window is also generally\n    // handy.  There is an NSApplication API to do this, but...\n    SetFrontProcess(&psn);\n\n#if defined(_GLFW_USE_MENUBAR)\n    // Menu bar setup must go between sharedApplication above and\n    // finishLaunching below, in order to properly emulate the behavior\n    // of NSApplicationMain\n    createMenuBar();\n#endif\n\n    [NSApp finishLaunching];\n\n    return GL_TRUE;\n}\n\n// Create the Cocoa window\n//\nstatic GLboolean createWindow(_GLFWwindow* window,\n                              const _GLFWwndconfig* wndconfig)\n{\n    unsigned int styleMask = 0;\n\n    if (wndconfig->monitor || !wndconfig->decorated)\n        styleMask = NSBorderlessWindowMask;\n    else\n    {\n        styleMask = NSTitledWindowMask | NSClosableWindowMask |\n                    NSMiniaturizableWindowMask;\n\n        if (wndconfig->resizable)\n            styleMask |= NSResizableWindowMask;\n    }\n\n    window->ns.object = [[GLFWWindow alloc]\n        initWithContentRect:NSMakeRect(0, 0, wndconfig->width, wndconfig->height)\n                  styleMask:styleMask\n                    backing:NSBackingStoreBuffered\n                      defer:NO];\n\n    if (window->ns.object == nil)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR, \"Cocoa: Failed to create window\");\n        return GL_FALSE;\n    }\n\n    window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];\n\n    if ([window->ns.view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])\n        [window->ns.view setWantsBestResolutionOpenGLSurface:YES];\n\n    [window->ns.object setTitle:[NSString stringWithUTF8String:wndconfig->title]];\n    [window->ns.object setContentView:window->ns.view];\n    [window->ns.object setDelegate:window->ns.delegate];\n    [window->ns.object setAcceptsMouseMovedEvents:YES];\n    [window->ns.object disableCursorRects];\n    [window->ns.object center];\n\n    if ([window->ns.object respondsToSelector:@selector(setRestorable:)])\n        [window->ns.object setRestorable:NO];\n\n    return GL_TRUE;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformCreateWindow(_GLFWwindow* window,\n                              const _GLFWwndconfig* wndconfig,\n                              const _GLFWfbconfig* fbconfig)\n{\n    if (!initializeAppKit())\n        return GL_FALSE;\n\n    // There can only be one application delegate, but we allocate it the\n    // first time a window is created to keep all window code in this file\n    if (_glfw.ns.delegate == nil)\n    {\n        _glfw.ns.delegate = [[GLFWApplicationDelegate alloc] init];\n        if (_glfw.ns.delegate == nil)\n        {\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"Cocoa: Failed to create application delegate\");\n            return GL_FALSE;\n        }\n\n        [NSApp setDelegate:_glfw.ns.delegate];\n    }\n\n    window->ns.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window];\n    if (window->ns.delegate == nil)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Cocoa: Failed to create window delegate\");\n        return GL_FALSE;\n    }\n\n    // Don't use accumulation buffer support; it's not accelerated\n    // Aux buffers probably aren't accelerated either\n\n    if (!createWindow(window, wndconfig))\n        return GL_FALSE;\n\n    if (!_glfwCreateContext(window, wndconfig, fbconfig))\n        return GL_FALSE;\n\n    [window->nsgl.context setView:window->ns.view];\n\n    if (wndconfig->monitor)\n        enterFullscreenMode(window);\n\n    return GL_TRUE;\n}\n\nvoid _glfwPlatformDestroyWindow(_GLFWwindow* window)\n{\n    [window->ns.object orderOut:nil];\n\n    if (window->monitor)\n        leaveFullscreenMode(window);\n\n    _glfwDestroyContext(window);\n\n    [window->ns.object setDelegate:nil];\n    [window->ns.delegate release];\n    window->ns.delegate = nil;\n\n    [window->ns.view release];\n    window->ns.view = nil;\n\n    [window->ns.object close];\n    window->ns.object = nil;\n}\n\nvoid _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char *title)\n{\n    [window->ns.object setTitle:[NSString stringWithUTF8String:title]];\n}\n\nvoid _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)\n{\n    const NSRect contentRect =\n        [window->ns.object contentRectForFrameRect:[window->ns.object frame]];\n\n    if (xpos)\n        *xpos = contentRect.origin.x;\n    if (ypos)\n        *ypos = transformY(contentRect.origin.y + contentRect.size.height);\n}\n\nvoid _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y)\n{\n    const NSRect frameRect =\n        [window->ns.object frameRectForContentRect:NSMakeRect(x, y, 0, 0)];\n    [window->ns.object setFrameOrigin:frameRect.origin];\n}\n\nvoid _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)\n{\n    const NSRect contentRect = [window->ns.view frame];\n\n    if (width)\n        *width = contentRect.size.width;\n    if (height)\n        *height = contentRect.size.height;\n}\n\nvoid _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)\n{\n    [window->ns.object setContentSize:NSMakeSize(width, height)];\n}\n\nvoid _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)\n{\n    const NSRect contentRect = [window->ns.view frame];\n    const NSRect fbRect = convertRectToBacking(window, contentRect);\n\n    if (width)\n        *width = (int) fbRect.size.width;\n    if (height)\n        *height = (int) fbRect.size.height;\n}\n\nvoid _glfwPlatformIconifyWindow(_GLFWwindow* window)\n{\n    if (window->monitor)\n        leaveFullscreenMode(window);\n\n    [window->ns.object miniaturize:nil];\n}\n\nvoid _glfwPlatformRestoreWindow(_GLFWwindow* window)\n{\n    [window->ns.object deminiaturize:nil];\n}\n\nvoid _glfwPlatformShowWindow(_GLFWwindow* window)\n{\n    [window->ns.object makeKeyAndOrderFront:nil];\n    _glfwInputWindowVisibility(window, GL_TRUE);\n}\n\nvoid _glfwPlatformHideWindow(_GLFWwindow* window)\n{\n    [window->ns.object orderOut:nil];\n    _glfwInputWindowVisibility(window, GL_FALSE);\n}\n\nvoid _glfwPlatformPollEvents(void)\n{\n\tfor (;;)\n    {\n        NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask\n                                            untilDate:[NSDate distantPast]\n                                               inMode:NSDefaultRunLoopMode\n                                              dequeue:YES];\n        if (event == nil)\n            break;\n\n        [NSApp sendEvent:event];\n    }\n\n    [_glfw.ns.autoreleasePool drain];\n    _glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];\n}\n\nvoid _glfwPlatformWaitEvents(void)\n{\n    // I wanted to pass NO to dequeue:, and rely on PollEvents to\n    // dequeue and send.  For reasons not at all clear to me, passing\n    // NO to dequeue: causes this method never to return.\n    NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask\n                                        untilDate:[NSDate distantFuture]\n                                           inMode:NSDefaultRunLoopMode\n                                          dequeue:YES];\n    [NSApp sendEvent:event];\n\n    _glfwPlatformPollEvents();\n}\n\nvoid _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)\n{\n    if (window->monitor)\n    {\n        CGDisplayMoveCursorToPoint(window->monitor->ns.displayID,\n                                   CGPointMake(x, y));\n    }\n    else\n    {\n        const NSRect contentRect = [window->ns.view frame];\n        const NSPoint localPoint = NSMakePoint(x, contentRect.size.height - y - 1);\n        const NSPoint globalPoint = [window->ns.object convertBaseToScreen:localPoint];\n\n        CGWarpMouseCursorPosition(CGPointMake(globalPoint.x,\n                                              transformY(globalPoint.y)));\n    }\n}\n\nvoid _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)\n{\n    if (mode == GLFW_CURSOR_HIDDEN)\n    {\n        [window->ns.object enableCursorRects];\n        [window->ns.object invalidateCursorRectsForView:window->ns.view];\n    }\n    else\n    {\n        [window->ns.object disableCursorRects];\n        [window->ns.object invalidateCursorRectsForView:window->ns.view];\n    }\n\n    if (mode == GLFW_CURSOR_DISABLED)\n    {\n        CGAssociateMouseAndMouseCursorPosition(false);\n\n        if (!_glfw.ns.cursorHidden)\n        {\n            [NSCursor hide];\n            _glfw.ns.cursorHidden = GL_TRUE;\n        }\n    }\n    else\n    {\n        CGAssociateMouseAndMouseCursorPosition(true);\n\n        if (_glfw.ns.cursorHidden)\n        {\n            [NSCursor unhide];\n            _glfw.ns.cursorHidden = GL_FALSE;\n        }\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW native API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI id glfwGetCocoaWindow(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(nil);\n    return window->ns.object;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/config.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n// As config.h.in, this file is used by CMake to produce the config.h shared\n// configuration header file.  If you are adding a feature requiring\n// conditional compilation, this is the proper place to add the macros.\n//========================================================================\n// As config.h, this file defines compile-time build options and macros for\n// all platforms supported by GLFW.  As this is a generated file, don't modify\n// it.  Instead, you should modify the config.h.in file.\n//========================================================================\n\n// The GLFW version as used by glfwGetVersionString\n#define _GLFW_VERSION_FULL \"3.0.1\"\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/config.h.in",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n// As config.h.in, this file is used by CMake to produce the config.h shared\n// configuration header file.  If you are adding a feature requiring\n// conditional compilation, this is the proper place to add the macros.\n//========================================================================\n// As config.h, this file defines compile-time build options and macros for\n// all platforms supported by GLFW.  As this is a generated file, don't modify\n// it.  Instead, you should modify the config.h.in file.\n//========================================================================\n\n// Define this to 1 if building GLFW for X11\n#cmakedefine _GLFW_X11\n// Define this to 1 if building GLFW for Win32\n#cmakedefine _GLFW_WIN32\n// Define this to 1 if building GLFW for Cocoa\n#cmakedefine _GLFW_COCOA\n\n// Define this to 1 if building GLFW for EGL\n#cmakedefine _GLFW_EGL\n// Define this to 1 if building GLFW for GLX\n#cmakedefine _GLFW_GLX\n// Define this to 1 if building GLFW for WGL\n#cmakedefine _GLFW_WGL\n// Define this to 1 if building GLFW for NSGL\n#cmakedefine _GLFW_NSGL\n\n// Define this to 1 if building as a shared library / dynamic library / DLL\n#cmakedefine _GLFW_BUILD_DLL\n\n// Define this to 1 to disable dynamic loading of winmm\n#cmakedefine _GLFW_NO_DLOAD_WINMM\n\n// Define this to 1 if glXGetProcAddress is available\n#cmakedefine _GLFW_HAS_GLXGETPROCADDRESS\n// Define this to 1 if glXGetProcAddressARB is available\n#cmakedefine _GLFW_HAS_GLXGETPROCADDRESSARB\n// Define this to 1 if glXGetProcAddressEXT is available\n#cmakedefine _GLFW_HAS_GLXGETPROCADDRESSEXT\n// Define this to 1 if dlopen is available\n#cmakedefine _GLFW_HAS_DLOPEN\n\n// Define this to 1 if glfwInit should change the current directory\n#cmakedefine _GLFW_USE_CHDIR\n// Define this to 1 if glfwCreateWindow should populate the menu bar\n#cmakedefine _GLFW_USE_MENUBAR\n\n// Define this to 1 if using OpenGL as the client library\n#cmakedefine _GLFW_USE_OPENGL\n// Define this to 1 if using OpenGL ES 1.1 as the client library\n#cmakedefine _GLFW_USE_GLESV1\n// Define this to 1 if using OpenGL ES 2.0 as the client library\n#cmakedefine _GLFW_USE_GLESV2\n\n// The GLFW version as used by glfwGetVersionString\n#define _GLFW_VERSION_FULL \"@GLFW_VERSION_FULL@\"\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/context.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdio.h>\n#include <string.h>\n#include <limits.h>\n#include <stdio.h>\n\n\n// Parses the client API version string and extracts the version number\n//\nstatic GLboolean parseGLVersion(int* api, int* major, int* minor, int* rev)\n{\n    int i, _api = GLFW_OPENGL_API, _major, _minor = 0, _rev = 0;\n    const char* version;\n    const char* prefixes[] =\n    {\n        \"OpenGL ES-CM \",\n        \"OpenGL ES-CL \",\n        \"OpenGL ES \",\n        NULL\n    };\n\n    version = (const char*) glGetString(GL_VERSION);\n    if (!version)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Failed to retrieve context version string\");\n        return GL_FALSE;\n    }\n\n    for (i = 0;  prefixes[i];  i++)\n    {\n        const size_t length = strlen(prefixes[i]);\n\n        if (strncmp(version, prefixes[i], length) == 0)\n        {\n            version += length;\n            _api = GLFW_OPENGL_ES_API;\n            break;\n        }\n    }\n\n    if (!sscanf(version, \"%d.%d.%d\", &_major, &_minor, &_rev))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"No version found in context version string\");\n        return GL_FALSE;\n    }\n\n    *api = _api;\n    *major = _major;\n    *minor = _minor;\n    *rev = _rev;\n\n    return GL_TRUE;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nGLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)\n{\n    if (wndconfig->clientAPI != GLFW_OPENGL_API &&\n        wndconfig->clientAPI != GLFW_OPENGL_ES_API)\n    {\n        _glfwInputError(GLFW_INVALID_ENUM, \"Invalid client API requested\");\n        return GL_FALSE;\n    }\n\n    if (wndconfig->clientAPI == GLFW_OPENGL_API)\n    {\n        if (wndconfig->glMajor < 1 || wndconfig->glMinor < 0 ||\n            (wndconfig->glMajor == 1 && wndconfig->glMinor > 5) ||\n            (wndconfig->glMajor == 2 && wndconfig->glMinor > 1) ||\n            (wndconfig->glMajor == 3 && wndconfig->glMinor > 3))\n        {\n            // OpenGL 1.0 is the smallest valid version\n            // OpenGL 1.x series ended with version 1.5\n            // OpenGL 2.x series ended with version 2.1\n            // OpenGL 3.x series ended with version 3.3\n\n            _glfwInputError(GLFW_INVALID_VALUE,\n                            \"Invalid OpenGL version %i.%i requested\",\n                            wndconfig->glMajor, wndconfig->glMinor);\n            return GL_FALSE;\n        }\n        else\n        {\n            // For now, let everything else through\n        }\n\n        if (wndconfig->glProfile)\n        {\n            if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE &&\n                wndconfig->glProfile != GLFW_OPENGL_COMPAT_PROFILE)\n            {\n                _glfwInputError(GLFW_INVALID_ENUM,\n                                \"Invalid OpenGL profile requested\");\n                return GL_FALSE;\n            }\n\n            if (wndconfig->glMajor < 3 ||\n                (wndconfig->glMajor == 3 && wndconfig->glMinor < 2))\n            {\n                // Desktop OpenGL context profiles are only defined for version 3.2\n                // and above\n\n                _glfwInputError(GLFW_INVALID_VALUE,\n                                \"Context profiles only exist for \"\n                                \"OpenGL version 3.2 and above\");\n                return GL_FALSE;\n            }\n        }\n\n        if (wndconfig->glForward && wndconfig->glMajor < 3)\n        {\n            // Forward-compatible contexts are only defined for OpenGL version 3.0 and above\n            _glfwInputError(GLFW_INVALID_VALUE,\n                            \"Forward compatibility only exist for OpenGL \"\n                            \"version 3.0 and above\");\n            return GL_FALSE;\n        }\n    }\n    else if (wndconfig->clientAPI == GLFW_OPENGL_ES_API)\n    {\n        if (wndconfig->glMajor < 1 || wndconfig->glMinor < 0 ||\n            (wndconfig->glMajor == 1 && wndconfig->glMinor > 1) ||\n            (wndconfig->glMajor == 2 && wndconfig->glMinor > 0))\n        {\n            // OpenGL ES 1.0 is the smallest valid version\n            // OpenGL ES 1.x series ended with version 1.1\n            // OpenGL ES 2.x series ended with version 2.0\n\n            _glfwInputError(GLFW_INVALID_VALUE,\n                            \"Invalid OpenGL ES version %i.%i requested\",\n                            wndconfig->glMajor, wndconfig->glMinor);\n            return GL_FALSE;\n        }\n        else\n        {\n            // For now, let everything else through\n        }\n\n        if (wndconfig->glProfile)\n        {\n            // OpenGL ES does not support profiles\n            _glfwInputError(GLFW_INVALID_VALUE,\n                            \"Context profiles are not supported by OpenGL ES\");\n            return GL_FALSE;\n        }\n\n        if (wndconfig->glForward)\n        {\n            // OpenGL ES does not support forward-compatibility\n            _glfwInputError(GLFW_INVALID_VALUE,\n                            \"Forward compatibility is not supported by OpenGL ES\");\n            return GL_FALSE;\n        }\n    }\n\n    if (wndconfig->glRobustness)\n    {\n        if (wndconfig->glRobustness != GLFW_NO_RESET_NOTIFICATION &&\n            wndconfig->glRobustness != GLFW_LOSE_CONTEXT_ON_RESET)\n        {\n            _glfwInputError(GLFW_INVALID_VALUE,\n                            \"Invalid context robustness mode requested\");\n            return GL_FALSE;\n        }\n    }\n\n    return GL_TRUE;\n}\n\nconst _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,\n                                         const _GLFWfbconfig* alternatives,\n                                         unsigned int count)\n{\n    unsigned int i;\n    unsigned int missing, leastMissing = UINT_MAX;\n    unsigned int colorDiff, leastColorDiff = UINT_MAX;\n    unsigned int extraDiff, leastExtraDiff = UINT_MAX;\n    const _GLFWfbconfig* current;\n    const _GLFWfbconfig* closest = NULL;\n\n    for (i = 0;  i < count;  i++)\n    {\n        current = alternatives + i;\n\n        if (desired->stereo > 0 && current->stereo == 0)\n        {\n            // Stereo is a hard constraint\n            continue;\n        }\n\n        // Count number of missing buffers\n        {\n            missing = 0;\n\n            if (desired->alphaBits > 0 && current->alphaBits == 0)\n                missing++;\n\n            if (desired->depthBits > 0 && current->depthBits == 0)\n                missing++;\n\n            if (desired->stencilBits > 0 && current->stencilBits == 0)\n                missing++;\n\n            if (desired->auxBuffers > 0 && current->auxBuffers < desired->auxBuffers)\n                missing += desired->auxBuffers - current->auxBuffers;\n\n            if (desired->samples > 0 && current->samples == 0)\n            {\n                // Technically, several multisampling buffers could be\n                // involved, but that's a lower level implementation detail and\n                // not important to us here, so we count them as one\n                missing++;\n            }\n        }\n\n        // These polynomials make many small channel size differences matter\n        // less than one large channel size difference\n\n        // Calculate color channel size difference value\n        {\n            colorDiff = 0;\n\n            if (desired->redBits > 0)\n            {\n                colorDiff += (desired->redBits - current->redBits) *\n                             (desired->redBits - current->redBits);\n            }\n\n            if (desired->greenBits > 0)\n            {\n                colorDiff += (desired->greenBits - current->greenBits) *\n                             (desired->greenBits - current->greenBits);\n            }\n\n            if (desired->blueBits > 0)\n            {\n                colorDiff += (desired->blueBits - current->blueBits) *\n                             (desired->blueBits - current->blueBits);\n            }\n        }\n\n        // Calculate non-color channel size difference value\n        {\n            extraDiff = 0;\n\n            if (desired->alphaBits > 0)\n            {\n                extraDiff += (desired->alphaBits - current->alphaBits) *\n                             (desired->alphaBits - current->alphaBits);\n            }\n\n            if (desired->depthBits > 0)\n            {\n                extraDiff += (desired->depthBits - current->depthBits) *\n                             (desired->depthBits - current->depthBits);\n            }\n\n            if (desired->stencilBits > 0)\n            {\n                extraDiff += (desired->stencilBits - current->stencilBits) *\n                             (desired->stencilBits - current->stencilBits);\n            }\n\n            if (desired->accumRedBits > 0)\n            {\n                extraDiff += (desired->accumRedBits - current->accumRedBits) *\n                             (desired->accumRedBits - current->accumRedBits);\n            }\n\n            if (desired->accumGreenBits > 0)\n            {\n                extraDiff += (desired->accumGreenBits - current->accumGreenBits) *\n                             (desired->accumGreenBits - current->accumGreenBits);\n            }\n\n            if (desired->accumBlueBits > 0)\n            {\n                extraDiff += (desired->accumBlueBits - current->accumBlueBits) *\n                             (desired->accumBlueBits - current->accumBlueBits);\n            }\n\n            if (desired->accumAlphaBits > 0)\n            {\n                extraDiff += (desired->accumAlphaBits - current->accumAlphaBits) *\n                             (desired->accumAlphaBits - current->accumAlphaBits);\n            }\n\n            if (desired->samples > 0)\n            {\n                extraDiff += (desired->samples - current->samples) *\n                             (desired->samples - current->samples);\n            }\n\n            if (desired->sRGB)\n            {\n                if (!current->sRGB)\n                    extraDiff++;\n            }\n        }\n\n        // Figure out if the current one is better than the best one found so far\n        // Least number of missing buffers is the most important heuristic,\n        // then color buffer size match and lastly size match for other buffers\n\n        if (missing < leastMissing)\n            closest = current;\n        else if (missing == leastMissing)\n        {\n            if ((colorDiff < leastColorDiff) ||\n                (colorDiff == leastColorDiff && extraDiff < leastExtraDiff))\n            {\n                closest = current;\n            }\n        }\n\n        if (current == closest)\n        {\n            leastMissing = missing;\n            leastColorDiff = colorDiff;\n            leastExtraDiff = extraDiff;\n        }\n    }\n\n    return closest;\n}\n\nGLboolean _glfwRefreshContextAttribs(void)\n{\n    _GLFWwindow* window = _glfwPlatformGetCurrentContext();\n\n    if (!parseGLVersion(&window->clientAPI,\n                        &window->glMajor,\n                        &window->glMinor,\n                        &window->glRevision))\n    {\n        return GL_FALSE;\n    }\n\n#if defined(_GLFW_USE_OPENGL)\n    if (window->glMajor > 2)\n    {\n        // OpenGL 3.0+ uses a different function for extension string retrieval\n        // We cache it here instead of in glfwExtensionSupported mostly to alert\n        // users as early as possible that their build may be broken\n\n        window->GetStringi = (PFNGLGETSTRINGIPROC) glfwGetProcAddress(\"glGetStringi\");\n        if (!window->GetStringi)\n        {\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"Entry point retrieval is broken\");\n            return GL_FALSE;\n        }\n    }\n\n    if (window->clientAPI == GLFW_OPENGL_API)\n    {\n        // Read back context flags (OpenGL 3.0 and above)\n        if (window->glMajor >= 3)\n        {\n            GLint flags;\n            glGetIntegerv(GL_CONTEXT_FLAGS, &flags);\n\n            if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)\n                window->glForward = GL_TRUE;\n\n            if (flags & GL_CONTEXT_FLAG_DEBUG_BIT)\n                window->glDebug = GL_TRUE;\n            else if (glfwExtensionSupported(\"GL_ARB_debug_output\"))\n            {\n                // HACK: This is a workaround for older drivers (pre KHR_debug)\n                // not setting the debug bit in the context flags for debug\n                // contexts\n                window->glDebug = GL_TRUE;\n            }\n        }\n\n        // Read back OpenGL context profile (OpenGL 3.2 and above)\n        if (window->glMajor > 3 ||\n            (window->glMajor == 3 && window->glMinor >= 2))\n        {\n            GLint mask;\n            glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask);\n\n            if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)\n                window->glProfile = GLFW_OPENGL_COMPAT_PROFILE;\n            else if (mask & GL_CONTEXT_CORE_PROFILE_BIT)\n                window->glProfile = GLFW_OPENGL_CORE_PROFILE;\n        }\n\n        // Read back robustness strategy\n        if (glfwExtensionSupported(\"GL_ARB_robustness\"))\n        {\n            // NOTE: We avoid using the context flags for detection, as they are\n            // only present from 3.0 while the extension applies from 1.1\n\n            GLint strategy;\n            glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy);\n\n            if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB)\n                window->glRobustness = GLFW_LOSE_CONTEXT_ON_RESET;\n            else if (strategy == GL_NO_RESET_NOTIFICATION_ARB)\n                window->glRobustness = GLFW_NO_RESET_NOTIFICATION;\n        }\n    }\n    else\n    {\n        // Read back robustness strategy\n        if (glfwExtensionSupported(\"GL_EXT_robustness\"))\n        {\n            // NOTE: The values of these constants match those of the OpenGL ARB\n            // one, so we can reuse them here\n\n            GLint strategy;\n            glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy);\n\n            if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB)\n                window->glRobustness = GLFW_LOSE_CONTEXT_ON_RESET;\n            else if (strategy == GL_NO_RESET_NOTIFICATION_ARB)\n                window->glRobustness = GLFW_NO_RESET_NOTIFICATION;\n        }\n    }\n#endif // _GLFW_USE_OPENGL\n\n    return GL_TRUE;\n}\n\nGLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig)\n{\n    _GLFWwindow* window = _glfwPlatformGetCurrentContext();\n\n    if (window->glMajor < wndconfig->glMajor ||\n        (window->glMajor == wndconfig->glMajor &&\n         window->glMinor < wndconfig->glMinor))\n    {\n        // The desired OpenGL version is greater than the actual version\n        // This only happens if the machine lacks {GLX|WGL}_ARB_create_context\n        // /and/ the user has requested an OpenGL version greater than 1.0\n\n        // For API consistency, we emulate the behavior of the\n        // {GLX|WGL}_ARB_create_context extension and fail here\n\n        _glfwInputError(GLFW_VERSION_UNAVAILABLE, NULL);\n        return GL_FALSE;\n    }\n\n    return GL_TRUE;\n}\n\nint _glfwStringInExtensionString(const char* string, const GLubyte* extensions)\n{\n    const GLubyte* start;\n    GLubyte* where;\n    GLubyte* terminator;\n\n    // It takes a bit of care to be fool-proof about parsing the\n    // OpenGL extensions string. Don't be fooled by sub-strings,\n    // etc.\n    start = extensions;\n    for (;;)\n    {\n        where = (GLubyte*) strstr((const char*) start, string);\n        if (!where)\n            return GL_FALSE;\n\n        terminator = where + strlen(string);\n        if (where == start || *(where - 1) == ' ')\n        {\n            if (*terminator == ' ' || *terminator == '\\0')\n                break;\n        }\n\n        start = terminator;\n    }\n\n    return GL_TRUE;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (_glfwPlatformGetCurrentContext() == window)\n        return;\n\n    _glfwPlatformMakeContextCurrent(window);\n}\n\nGLFWAPI GLFWwindow* glfwGetCurrentContext(void)\n{\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return (GLFWwindow*) _glfwPlatformGetCurrentContext();\n}\n\nGLFWAPI void glfwSwapBuffers(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformSwapBuffers(window);\n}\n\nGLFWAPI void glfwSwapInterval(int interval)\n{\n    _GLFW_REQUIRE_INIT();\n\n    if (!_glfwPlatformGetCurrentContext())\n    {\n        _glfwInputError(GLFW_NO_CURRENT_CONTEXT, NULL);\n        return;\n    }\n\n    _glfwPlatformSwapInterval(interval);\n}\n\nGLFWAPI int glfwExtensionSupported(const char* extension)\n{\n    const GLubyte* extensions;\n    _GLFWwindow* window;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(GL_FALSE);\n\n    window = _glfwPlatformGetCurrentContext();\n    if (!window)\n    {\n        _glfwInputError(GLFW_NO_CURRENT_CONTEXT, NULL);\n        return GL_FALSE;\n    }\n\n    if (extension == NULL || *extension == '\\0')\n    {\n        _glfwInputError(GLFW_INVALID_VALUE, NULL);\n        return GL_FALSE;\n    }\n\n    if (window->glMajor < 3)\n    {\n        // Check if extension is in the old style OpenGL extensions string\n\n        extensions = glGetString(GL_EXTENSIONS);\n        if (extensions != NULL)\n        {\n            if (_glfwStringInExtensionString(extension, extensions))\n                return GL_TRUE;\n        }\n    }\n#if defined(_GLFW_USE_OPENGL)\n    else\n    {\n        int i;\n        GLint count;\n\n        // Check if extension is in the modern OpenGL extensions string list\n\n        glGetIntegerv(GL_NUM_EXTENSIONS, &count);\n\n        for (i = 0;  i < count;  i++)\n        {\n             if (strcmp((const char*) window->GetStringi(GL_EXTENSIONS, i),\n                         extension) == 0)\n             {\n                 return GL_TRUE;\n             }\n        }\n    }\n#endif // _GLFW_USE_OPENGL\n\n    // Check if extension is in the platform-specific string\n    return _glfwPlatformExtensionSupported(extension);\n}\n\nGLFWAPI GLFWglproc glfwGetProcAddress(const char* procname)\n{\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    if (!_glfwPlatformGetCurrentContext())\n    {\n        _glfwInputError(GLFW_NO_CURRENT_CONTEXT, NULL);\n        return NULL;\n    }\n\n    return _glfwPlatformGetProcAddress(procname);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/egl_context.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    EGL\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <assert.h>\n\n\n// Thread local storage attribute macro\n//\n#if defined(_MSC_VER)\n #define _GLFW_TLS __declspec(thread)\n#elif defined(__GNUC__)\n #define _GLFW_TLS __thread\n#else\n #define _GLFW_TLS\n#endif\n\n\n// The per-thread current context/window pointer\n//\nstatic _GLFW_TLS _GLFWwindow* _glfwCurrentWindow = NULL;\n\n\n// Return a description of the specified EGL error\n//\nstatic const char* getErrorString(EGLint error)\n{\n    switch (error)\n    {\n        case EGL_SUCCESS:\n            return \"Success\";\n        case EGL_NOT_INITIALIZED:\n            return \"EGL is not or could not be initialized\";\n        case EGL_BAD_ACCESS:\n            return \"EGL cannot access a requested resource\";\n        case EGL_BAD_ALLOC:\n            return \"EGL failed to allocate resources for the requested operation\";\n        case EGL_BAD_ATTRIBUTE:\n            return \"An unrecognized attribute or attribute value was passed \"\n                   \"in the attribute list\";\n        case EGL_BAD_CONTEXT:\n            return \"An EGLContext argument does not name a valid EGL \"\n                   \"rendering context\";\n        case EGL_BAD_CONFIG:\n            return \"An EGLConfig argument does not name a valid EGL frame \"\n                   \"buffer configuration\";\n        case EGL_BAD_CURRENT_SURFACE:\n            return \"The current surface of the calling thread is a window, pixel \"\n                   \"buffer or pixmap that is no longer valid\";\n        case EGL_BAD_DISPLAY:\n            return \"An EGLDisplay argument does not name a valid EGL display \"\n                   \"connection\";\n        case EGL_BAD_SURFACE:\n            return \"An EGLSurface argument does not name a valid surface \"\n                   \"configured for GL rendering\";\n        case EGL_BAD_MATCH:\n            return \"Arguments are inconsistent\";\n        case EGL_BAD_PARAMETER:\n            return \"One or more argument values are invalid\";\n        case EGL_BAD_NATIVE_PIXMAP:\n            return \"A NativePixmapType argument does not refer to a valid \"\n                   \"native pixmap\";\n        case EGL_BAD_NATIVE_WINDOW:\n            return \"A NativeWindowType argument does not refer to a valid \"\n                   \"native window\";\n        case EGL_CONTEXT_LOST:\n            return \"The application must destroy all contexts and reinitialise\";\n    }\n\n    return \"UNKNOWN EGL ERROR\";\n}\n\n// Returns the specified attribute of the specified EGLConfig\n//\nstatic int getConfigAttrib(EGLConfig config, int attrib)\n{\n    int value;\n    eglGetConfigAttrib(_glfw.egl.display, config, attrib, &value);\n    return value;\n}\n\n// Return a list of available and usable framebuffer configs\n//\nstatic GLboolean chooseFBConfigs(const _GLFWwndconfig* wndconfig,\n                                 const _GLFWfbconfig* desired,\n                                 EGLConfig* result)\n{\n    EGLConfig* nativeConfigs;\n    _GLFWfbconfig* usableConfigs;\n    const _GLFWfbconfig* closest;\n    int i, nativeCount, usableCount;\n\n    eglGetConfigs(_glfw.egl.display, NULL, 0, &nativeCount);\n    if (!nativeCount)\n    {\n        _glfwInputError(GLFW_API_UNAVAILABLE, \"EGL: No EGLConfigs returned\");\n        return GL_FALSE;\n    }\n\n    nativeConfigs = (EGLConfig*) calloc(nativeCount, sizeof(EGLConfig));\n    eglGetConfigs(_glfw.egl.display, nativeConfigs, nativeCount, &nativeCount);\n\n    usableConfigs = (_GLFWfbconfig*) calloc(nativeCount, sizeof(_GLFWfbconfig));\n    usableCount = 0;\n\n    for (i = 0;  i < nativeCount;  i++)\n    {\n        const EGLConfig n = nativeConfigs[i];\n        _GLFWfbconfig* u = usableConfigs + usableCount;\n\n#if defined(_GLFW_X11)\n        if (!getConfigAttrib(n, EGL_NATIVE_VISUAL_ID))\n        {\n            // Only consider EGLConfigs with associated visuals\n            continue;\n        }\n#endif // _GLFW_X11\n\n        if (!(getConfigAttrib(n, EGL_COLOR_BUFFER_TYPE) & EGL_RGB_BUFFER))\n        {\n            // Only consider RGB(A) EGLConfigs\n            continue;\n        }\n\n        if (!(getConfigAttrib(n, EGL_SURFACE_TYPE) & EGL_WINDOW_BIT))\n        {\n            // Only consider window EGLConfigs\n            continue;\n        }\n\n        if (wndconfig->clientAPI == GLFW_OPENGL_ES_API)\n        {\n            if (wndconfig->glMajor == 1)\n            {\n                if (!(getConfigAttrib(n, EGL_RENDERABLE_TYPE) & EGL_OPENGL_ES_BIT))\n                    continue;\n            }\n            else\n            {\n                if (!(getConfigAttrib(n, EGL_RENDERABLE_TYPE) & EGL_OPENGL_ES2_BIT))\n                    continue;\n            }\n        }\n        else if (wndconfig->clientAPI == GLFW_OPENGL_API)\n        {\n            if (!(getConfigAttrib(n, EGL_RENDERABLE_TYPE) & EGL_OPENGL_BIT))\n                continue;\n        }\n\n        u->redBits = getConfigAttrib(n, EGL_RED_SIZE);\n        u->greenBits = getConfigAttrib(n, EGL_GREEN_SIZE);\n        u->blueBits = getConfigAttrib(n, EGL_BLUE_SIZE);\n\n        u->alphaBits = getConfigAttrib(n, EGL_ALPHA_SIZE);\n        u->depthBits = getConfigAttrib(n, EGL_DEPTH_SIZE);\n        u->stencilBits = getConfigAttrib(n, EGL_STENCIL_SIZE);\n\n        u->samples = getConfigAttrib(n, EGL_SAMPLES);\n\n        u->egl = n;\n        usableCount++;\n    }\n\n    closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);\n    if (closest)\n        *result = closest->egl;\n\n    free(nativeConfigs);\n    free(usableConfigs);\n\n    return closest ? GL_TRUE : GL_FALSE;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialize EGL\n//\nint _glfwInitContextAPI(void)\n{\n    _glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY);\n    if (_glfw.egl.display == EGL_NO_DISPLAY)\n    {\n        _glfwInputError(GLFW_API_UNAVAILABLE,\n                        \"EGL: Failed to get EGL display: %s\",\n                        getErrorString(eglGetError()));\n        return GL_FALSE;\n    }\n\n    if (!eglInitialize(_glfw.egl.display,\n                       &_glfw.egl.versionMajor,\n                       &_glfw.egl.versionMinor))\n    {\n        _glfwInputError(GLFW_API_UNAVAILABLE,\n                        \"EGL: Failed to initialize EGL: %s\",\n                        getErrorString(eglGetError()));\n        return GL_FALSE;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"EGL_KHR_create_context\"))\n        _glfw.egl.KHR_create_context = GL_TRUE;\n\n    return GL_TRUE;\n}\n\n// Terminate EGL\n//\nvoid _glfwTerminateContextAPI(void)\n{\n    eglTerminate(_glfw.egl.display);\n}\n\n#define setEGLattrib(attribName, attribValue) \\\n{ \\\n    attribs[index++] = attribName; \\\n    attribs[index++] = attribValue; \\\n    assert(index < sizeof(attribs) / sizeof(attribs[0])); \\\n}\n\n// Prepare for creation of the OpenGL context\n//\nint _glfwCreateContext(_GLFWwindow* window,\n                       const _GLFWwndconfig* wndconfig,\n                       const _GLFWfbconfig* fbconfig)\n{\n    int attribs[40];\n    EGLint count = 0;\n    EGLConfig config;\n    EGLContext share = NULL;\n\n    if (wndconfig->share)\n        share = wndconfig->share->egl.context;\n\n    if (!chooseFBConfigs(wndconfig, fbconfig, &config))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"EGL: Failed to find a suitable EGLConfig\");\n        return GL_FALSE;\n    }\n\n#if defined(_GLFW_X11)\n    // Retrieve the visual corresponding to the chosen EGL config\n    {\n        int mask;\n        EGLint redBits, greenBits, blueBits, alphaBits, visualID = 0;\n        XVisualInfo info;\n\n        eglGetConfigAttrib(_glfw.egl.display, config,\n                           EGL_NATIVE_VISUAL_ID, &visualID);\n\n        info.screen = _glfw.x11.screen;\n        mask = VisualScreenMask;\n\n        if (visualID)\n        {\n            // The X window visual must match the EGL config\n            info.visualid = visualID;\n            mask |= VisualIDMask;\n        }\n        else\n        {\n            // some EGL drivers don't implement the EGL_NATIVE_VISUAL_ID\n            // attribute, so attempt to find the closest match.\n\n            eglGetConfigAttrib(_glfw.egl.display, config,\n                               EGL_RED_SIZE, &redBits);\n            eglGetConfigAttrib(_glfw.egl.display, config,\n                               EGL_GREEN_SIZE, &greenBits);\n            eglGetConfigAttrib(_glfw.egl.display, config,\n                               EGL_BLUE_SIZE, &blueBits);\n            eglGetConfigAttrib(_glfw.egl.display, config,\n                               EGL_ALPHA_SIZE, &alphaBits);\n\n            info.depth = redBits + greenBits + blueBits + alphaBits;\n            mask |= VisualDepthMask;\n        }\n\n        window->egl.visual = XGetVisualInfo(_glfw.x11.display,\n                                            mask, &info, &count);\n\n        if (window->egl.visual == NULL)\n        {\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"EGL: Failed to retrieve visual for EGLConfig\");\n            return GL_FALSE;\n        }\n    }\n#endif // _GLFW_X11\n\n    if (wndconfig->clientAPI == GLFW_OPENGL_ES_API)\n    {\n        if (!eglBindAPI(EGL_OPENGL_ES_API))\n        {\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"EGL: Failed to bind OpenGL ES: %s\",\n                            getErrorString(eglGetError()));\n            return GL_FALSE;\n        }\n    }\n    else\n    {\n        if (!eglBindAPI(EGL_OPENGL_API))\n        {\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"EGL: Failed to bind OpenGL: %s\",\n                            getErrorString(eglGetError()));\n            return GL_FALSE;\n        }\n    }\n\n    if (_glfw.egl.KHR_create_context)\n    {\n        int index = 0, mask = 0, flags = 0, strategy = 0;\n\n        if (wndconfig->clientAPI == GLFW_OPENGL_API)\n        {\n            if (wndconfig->glProfile == GLFW_OPENGL_CORE_PROFILE)\n                mask |= EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;\n            else if (wndconfig->glProfile == GLFW_OPENGL_COMPAT_PROFILE)\n                mask |= EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR;\n\n            if (wndconfig->glForward)\n                flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;\n\n            if (wndconfig->glDebug)\n                flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;\n        }\n\n        if (wndconfig->glRobustness != GLFW_NO_ROBUSTNESS)\n        {\n            if (wndconfig->glRobustness == GLFW_NO_RESET_NOTIFICATION)\n                strategy = EGL_NO_RESET_NOTIFICATION_KHR;\n            else if (wndconfig->glRobustness == GLFW_LOSE_CONTEXT_ON_RESET)\n                strategy = EGL_LOSE_CONTEXT_ON_RESET_KHR;\n\n            flags |= EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;\n        }\n\n        if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0)\n        {\n            setEGLattrib(EGL_CONTEXT_MAJOR_VERSION_KHR, wndconfig->glMajor);\n            setEGLattrib(EGL_CONTEXT_MINOR_VERSION_KHR, wndconfig->glMinor);\n        }\n\n        if (mask)\n            setEGLattrib(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, mask);\n\n        if (flags)\n            setEGLattrib(EGL_CONTEXT_FLAGS_KHR, flags);\n\n        if (strategy)\n            setEGLattrib(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR, strategy);\n\n        setEGLattrib(EGL_NONE, EGL_NONE);\n    }\n    else\n    {\n        int index = 0;\n\n        if (wndconfig->clientAPI == GLFW_OPENGL_ES_API)\n            setEGLattrib(EGL_CONTEXT_CLIENT_VERSION, wndconfig->glMajor);\n\n        setEGLattrib(EGL_NONE, EGL_NONE);\n    }\n\n    window->egl.context = eglCreateContext(_glfw.egl.display,\n                                           config, share, attribs);\n\n    if (window->egl.context == EGL_NO_CONTEXT)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"EGL: Failed to create context: %s\",\n                        getErrorString(eglGetError()));\n        return GL_FALSE;\n    }\n\n    window->egl.config = config;\n\n    return GL_TRUE;\n}\n\n#undef setEGLattrib\n\n// Destroy the OpenGL context\n//\nvoid _glfwDestroyContext(_GLFWwindow* window)\n{\n#if defined(_GLFW_X11)\n    if (window->egl.visual)\n    {\n       XFree(window->egl.visual);\n       window->egl.visual = NULL;\n    }\n#endif // _GLFW_X11\n\n    if (window->egl.surface)\n    {\n        eglDestroySurface(_glfw.egl.display, window->egl.surface);\n        window->egl.surface = EGL_NO_SURFACE;\n    }\n\n    if (window->egl.context)\n    {\n        eglDestroyContext(_glfw.egl.display, window->egl.context);\n        window->egl.context = EGL_NO_CONTEXT;\n    }\n}\n\n// Analyzes the specified context for possible recreation\n//\nint _glfwAnalyzeContext(const _GLFWwindow* window,\n                        const _GLFWwndconfig* wndconfig,\n                        const _GLFWfbconfig* fbconfig)\n{\n#if defined(_GLFW_WIN32)\n    return _GLFW_RECREATION_NOT_NEEDED;\n#else\n    return 0;\n#endif\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformMakeContextCurrent(_GLFWwindow* window)\n{\n    if (window)\n    {\n        if (window->egl.surface == EGL_NO_SURFACE)\n        {\n            window->egl.surface = eglCreateWindowSurface(_glfw.egl.display,\n                                                         window->egl.config,\n                                                         _GLFW_EGL_NATIVE_WINDOW,\n                                                         NULL);\n            if (window->egl.surface == EGL_NO_SURFACE)\n            {\n                _glfwInputError(GLFW_PLATFORM_ERROR,\n                                \"EGL: Failed to create window surface: %s\",\n                                getErrorString(eglGetError()));\n            }\n        }\n\n        eglMakeCurrent(_glfw.egl.display,\n                       window->egl.surface,\n                       window->egl.surface,\n                       window->egl.context);\n    }\n    else\n    {\n        eglMakeCurrent(_glfw.egl.display,\n                       EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);\n    }\n\n    _glfwCurrentWindow = window;\n}\n\n_GLFWwindow* _glfwPlatformGetCurrentContext(void)\n{\n    return _glfwCurrentWindow;\n}\n\nvoid _glfwPlatformSwapBuffers(_GLFWwindow* window)\n{\n    eglSwapBuffers(_glfw.egl.display, window->egl.surface);\n}\n\nvoid _glfwPlatformSwapInterval(int interval)\n{\n    eglSwapInterval(_glfw.egl.display, interval);\n}\n\nint _glfwPlatformExtensionSupported(const char* extension)\n{\n    const char* extensions;\n\n    extensions = eglQueryString(_glfw.egl.display, EGL_EXTENSIONS);\n    if (extensions != NULL)\n    {\n        if (_glfwStringInExtensionString(extension, (unsigned char*) extensions))\n            return GL_TRUE;\n    }\n\n    return GL_FALSE;\n}\n\nGLFWglproc _glfwPlatformGetProcAddress(const char* procname)\n{\n    return eglGetProcAddress(procname);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW native API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI EGLDisplay glfwGetEGLDisplay(void)\n{\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return _glfw.egl.display;\n}\n\nGLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return window->egl.context;\n}\n\nGLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(0);\n    return window->egl.surface;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/egl_platform.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    EGL\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#ifndef _egl_platform_h_\n#define _egl_platform_h_\n\n#include <EGL/egl.h>\n\n// This path may need to be changed if you build GLFW using your own setup\n// We ship and use our own copy of eglext.h since GLFW uses fairly new\n// extensions and not all operating systems come with an up-to-date version\n#include \"../deps/EGL/eglext.h\"\n\n// Do we have support for dlopen/dlsym?\n#if defined(_GLFW_HAS_DLOPEN)\n #include <dlfcn.h>\n#endif\n\n#define _GLFW_PLATFORM_FBCONFIG             EGLConfig       egl\n#define _GLFW_PLATFORM_CONTEXT_STATE        _GLFWcontextEGL egl\n#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryEGL egl\n\n\n//========================================================================\n// GLFW platform specific types\n//========================================================================\n\n//------------------------------------------------------------------------\n// Platform-specific OpenGL context structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWcontextEGL\n{\n   EGLConfig      config;\n   EGLContext     context;\n   EGLSurface     surface;\n\n#if defined(_GLFW_X11)\n   XVisualInfo*   visual;\n#endif\n} _GLFWcontextEGL;\n\n\n//------------------------------------------------------------------------\n// Platform-specific library global data for EGL\n//------------------------------------------------------------------------\ntypedef struct _GLFWlibraryEGL\n{\n    EGLDisplay      display;\n    EGLint          versionMajor, versionMinor;\n\n    GLboolean       KHR_create_context;\n\n} _GLFWlibraryEGL;\n\n\n#endif // _egl_platform_h_\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/gamma.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <math.h>\n#include <stdlib.h>\n#include <string.h>\n\n#if defined(_MSC_VER)\n #include <malloc.h>\n#endif\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwAllocGammaRamp(GLFWgammaramp* ramp, unsigned int size)\n{\n    ramp->red = (unsigned short*) malloc(size * sizeof(unsigned short));\n    ramp->green = (unsigned short*) malloc(size * sizeof(unsigned short));\n    ramp->blue = (unsigned short*) malloc(size * sizeof(unsigned short));\n    ramp->size = size;\n}\n\nvoid _glfwFreeGammaRamp(GLFWgammaramp* ramp)\n{\n    free(ramp->red);\n    free(ramp->green);\n    free(ramp->blue);\n\n    memset(ramp, 0, sizeof(GLFWgammaramp));\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma)\n{\n    int i;\n    unsigned short values[256];\n    GLFWgammaramp ramp;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (gamma <= 0.f)\n    {\n        _glfwInputError(GLFW_INVALID_VALUE,\n                        \"Gamma value must be greater than zero\");\n        return;\n    }\n\n    for (i = 0;  i < 256;  i++)\n    {\n        float value;\n\n        // Calculate intensity\n        value = i / 255.f;\n        // Apply gamma curve\n        value = (float) pow(value, 1.f / gamma) * 65535.f + 0.5f;\n\n        // Clamp to value range\n        if (value < 0.f)\n            value = 0.f;\n        else if (value > 65535.f)\n            value = 65535.f;\n\n        values[i] = (unsigned short) value;\n    }\n\n    ramp.red = values;\n    ramp.green = values;\n    ramp.blue = values;\n    ramp.size = 256;\n\n    glfwSetGammaRamp(handle, &ramp);\n}\n\nGLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* handle)\n{\n    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    _glfwFreeGammaRamp(&monitor->currentRamp);\n    _glfwPlatformGetGammaRamp(monitor, &monitor->currentRamp);\n\n    return &monitor->currentRamp;\n}\n\nGLFWAPI void glfwSetGammaRamp(GLFWmonitor* handle, const GLFWgammaramp* ramp)\n{\n    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (!monitor->originalRamp.size)\n        _glfwPlatformGetGammaRamp(monitor, &monitor->originalRamp);\n\n    _glfwPlatformSetGammaRamp(monitor, ramp);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/glfw3.pc.in",
    "content": "prefix=@CMAKE_INSTALL_PREFIX@\nexec_prefix=${prefix}\nincludedir=${prefix}/include\nlibdir=${exec_prefix}/lib\n\nName: GLFW\nDescription: A portable library for OpenGL, window and input\nVersion: @GLFW_VERSION_FULL@\nURL: http://www.glfw.org/\nRequires.private: @GLFW_PKG_DEPS@\nLibs: -L${libdir} -l@GLFW_LIB_NAME@\nLibs.private: @GLFW_PKG_LIBS@\nCflags: -I${includedir}\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/glfwConfig.cmake.in",
    "content": "# - Config file for the glfw package\n# It defines the following variables\n#   GLFW_INCLUDE_DIR, the path where GLFW headers are located\n#   GLFW_LIBRARY_DIR, folder in which the GLFW library is located\n#   GLFW_LIBRARY, library to link against to use GLFW\n\nset(GLFW_INCLUDE_DIR \"@CMAKE_INSTALL_PREFIX@/include\")\nset(GLFW_LIBRARY_DIR \"@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@\")\n\nfind_library(GLFW_LIBRARY \"@GLFW_LIB_NAME@\" HINTS ${GLFW_LIBRARY_DIR})\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/glfwConfigVersion.cmake.in",
    "content": "\nset(PACKAGE_VERSION \"@GLFW_VERSION_FULL@\")\n\nif (\"${PACKAGE_FIND_VERSION_MAJOR}\" EQUAL \"@GLFW_VERSION_MAJOR@\")\n\tset(PACKAGE_VERSION_COMPATIBLE TRUE)\n\tif (\"${PACKAGE_FIND_VERSION_MINOR}\" EQUAL @GLFW_VERSION_MINOR@)\n\t\tset(PACKAGE_VERSION_EXACT TRUE)\n\tendif()\nelse()\n\tset(PACKAGE_VERSION_COMPATIBLE FALSE)\nendif()\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/glx_context.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11/GLX\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <string.h>\n#include <stdlib.h>\n#include <assert.h>\n#include <pthread.h>\n\n\n// This is the only glXGetProcAddress variant not declared by glxext.h\nvoid (*glXGetProcAddressEXT(const GLubyte* procName))();\n\n\n#ifndef GLXBadProfileARB\n #define GLXBadProfileARB 13\n#endif\n\n\n// Error handler used when creating a context\n//\nstatic int errorHandler(Display *display, XErrorEvent* event)\n{\n    _glfw.glx.errorCode = event->error_code;\n    return 0;\n}\n\n// Returns the specified attribute of the specified GLXFBConfig\n// NOTE: Do not call this unless we have found GLX 1.3+ or GLX_SGIX_fbconfig\n//\nstatic int getFBConfigAttrib(GLXFBConfig fbconfig, int attrib)\n{\n    int value;\n\n    if (_glfw.glx.SGIX_fbconfig)\n    {\n        _glfw.glx.GetFBConfigAttribSGIX(_glfw.x11.display,\n                                        fbconfig, attrib, &value);\n    }\n    else\n        glXGetFBConfigAttrib(_glfw.x11.display, fbconfig, attrib, &value);\n\n    return value;\n}\n\n// Return a list of available and usable framebuffer configs\n//\nstatic GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* result)\n{\n    GLXFBConfig* nativeConfigs;\n    _GLFWfbconfig* usableConfigs;\n    const _GLFWfbconfig* closest;\n    int i, nativeCount, usableCount;\n    const char* vendor;\n    GLboolean trustWindowBit = GL_TRUE;\n\n    vendor = glXGetClientString(_glfw.x11.display, GLX_VENDOR);\n    if (strcmp(vendor, \"Chromium\") == 0)\n    {\n        // HACK: This is a (hopefully temporary) workaround for Chromium\n        // (VirtualBox GL) not setting the window bit on any GLXFBConfigs\n        trustWindowBit = GL_FALSE;\n    }\n\n    if (_glfw.glx.SGIX_fbconfig)\n    {\n        nativeConfigs = _glfw.glx.ChooseFBConfigSGIX(_glfw.x11.display,\n                                                     _glfw.x11.screen,\n                                                     NULL,\n                                                     &nativeCount);\n    }\n    else\n    {\n        nativeConfigs = glXGetFBConfigs(_glfw.x11.display,\n                                        _glfw.x11.screen,\n                                        &nativeCount);\n    }\n\n    if (!nativeCount)\n    {\n        _glfwInputError(GLFW_API_UNAVAILABLE,\n                        \"GLX: No GLXFBConfigs returned\");\n        return GL_FALSE;\n    }\n\n    usableConfigs = (_GLFWfbconfig*) calloc(nativeCount, sizeof(_GLFWfbconfig));\n    usableCount = 0;\n\n    for (i = 0;  i < nativeCount;  i++)\n    {\n        const GLXFBConfig n = nativeConfigs[i];\n        _GLFWfbconfig* u = usableConfigs + usableCount;\n\n        if (!getFBConfigAttrib(n, GLX_DOUBLEBUFFER) ||\n            !getFBConfigAttrib(n, GLX_VISUAL_ID))\n        {\n            // Only consider double-buffered GLXFBConfigs with associated visuals\n            continue;\n        }\n\n        if (!(getFBConfigAttrib(n, GLX_RENDER_TYPE) & GLX_RGBA_BIT))\n        {\n            // Only consider RGBA GLXFBConfigs\n            continue;\n        }\n\n        if (!(getFBConfigAttrib(n, GLX_DRAWABLE_TYPE) & GLX_WINDOW_BIT))\n        {\n            if (trustWindowBit)\n            {\n                // Only consider window GLXFBConfigs\n                continue;\n            }\n        }\n\n        u->redBits = getFBConfigAttrib(n, GLX_RED_SIZE);\n        u->greenBits = getFBConfigAttrib(n, GLX_GREEN_SIZE);\n        u->blueBits = getFBConfigAttrib(n, GLX_BLUE_SIZE);\n\n        u->alphaBits = getFBConfigAttrib(n, GLX_ALPHA_SIZE);\n        u->depthBits = getFBConfigAttrib(n, GLX_DEPTH_SIZE);\n        u->stencilBits = getFBConfigAttrib(n, GLX_STENCIL_SIZE);\n\n        u->accumRedBits = getFBConfigAttrib(n, GLX_ACCUM_RED_SIZE);\n        u->accumGreenBits = getFBConfigAttrib(n, GLX_ACCUM_GREEN_SIZE);\n        u->accumBlueBits = getFBConfigAttrib(n, GLX_ACCUM_BLUE_SIZE);\n        u->accumAlphaBits = getFBConfigAttrib(n, GLX_ACCUM_ALPHA_SIZE);\n\n        u->auxBuffers = getFBConfigAttrib(n, GLX_AUX_BUFFERS);\n        u->stereo = getFBConfigAttrib(n, GLX_STEREO);\n\n        if (_glfw.glx.ARB_multisample)\n            u->samples = getFBConfigAttrib(n, GLX_SAMPLES);\n\n        if (_glfw.glx.ARB_framebuffer_sRGB)\n            u->sRGB = getFBConfigAttrib(n, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB);\n\n        u->glx = n;\n        usableCount++;\n    }\n\n    closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);\n    if (closest)\n        *result = closest->glx;\n\n    XFree(nativeConfigs);\n    free(usableConfigs);\n\n    return closest ? GL_TRUE : GL_FALSE;\n}\n\n// Create the OpenGL context using legacy API\n//\nstatic GLXContext createLegacyContext(_GLFWwindow* window,\n                                      GLXFBConfig fbconfig,\n                                      GLXContext share)\n{\n    if (_glfw.glx.SGIX_fbconfig)\n    {\n        return _glfw.glx.CreateContextWithConfigSGIX(_glfw.x11.display,\n                                                     fbconfig,\n                                                     GLX_RGBA_TYPE,\n                                                     share,\n                                                     True);\n    }\n    else\n    {\n        return glXCreateNewContext(_glfw.x11.display,\n                                   fbconfig,\n                                   GLX_RGBA_TYPE,\n                                   share,\n                                   True);\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialize GLX\n//\nint _glfwInitContextAPI(void)\n{\n#ifdef _GLFW_DLOPEN_LIBGL\n    int i;\n    char* libGL_names[ ] =\n    {\n        \"libGL.so\",\n        \"libGL.so.1\",\n        \"/usr/lib/libGL.so\",\n        \"/usr/lib/libGL.so.1\",\n        NULL\n    };\n\n    for (i = 0;  libGL_names[i] != NULL;  i++)\n    {\n        _glfw.glx.libGL = dlopen(libGL_names[i], RTLD_LAZY | RTLD_GLOBAL);\n        if (_glfw.glx.libGL)\n            break;\n    }\n\n    if (!_glfw.glx.libGL)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR, \"GLX: Failed to find libGL\");\n        return GL_FALSE;\n    }\n#endif\n\n    if (pthread_key_create(&_glfw.glx.current, NULL) != 0)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"GLX: Failed to create context TLS\");\n        return GL_FALSE;\n    }\n\n    // Check if GLX is supported on this display\n    if (!glXQueryExtension(_glfw.x11.display,\n                           &_glfw.glx.errorBase,\n                           &_glfw.glx.eventBase))\n    {\n        _glfwInputError(GLFW_API_UNAVAILABLE, \"GLX: GLX support not found\");\n        return GL_FALSE;\n    }\n\n    if (!glXQueryVersion(_glfw.x11.display,\n                         &_glfw.glx.versionMajor,\n                         &_glfw.glx.versionMinor))\n    {\n        _glfwInputError(GLFW_API_UNAVAILABLE,\n                        \"GLX: Failed to query GLX version\");\n        return GL_FALSE;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"GLX_EXT_swap_control\"))\n    {\n        _glfw.glx.SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)\n            _glfwPlatformGetProcAddress(\"glXSwapIntervalEXT\");\n\n        if (_glfw.glx.SwapIntervalEXT)\n            _glfw.glx.EXT_swap_control = GL_TRUE;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"GLX_SGI_swap_control\"))\n    {\n        _glfw.glx.SwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)\n            _glfwPlatformGetProcAddress(\"glXSwapIntervalSGI\");\n\n        if (_glfw.glx.SwapIntervalSGI)\n            _glfw.glx.SGI_swap_control = GL_TRUE;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"GLX_MESA_swap_control\"))\n    {\n        _glfw.glx.SwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)\n            _glfwPlatformGetProcAddress(\"glXSwapIntervalMESA\");\n\n        if (_glfw.glx.SwapIntervalMESA)\n            _glfw.glx.MESA_swap_control = GL_TRUE;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"GLX_SGIX_fbconfig\"))\n    {\n        _glfw.glx.GetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)\n            _glfwPlatformGetProcAddress(\"glXGetFBConfigAttribSGIX\");\n        _glfw.glx.ChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)\n            _glfwPlatformGetProcAddress(\"glXChooseFBConfigSGIX\");\n        _glfw.glx.CreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)\n            _glfwPlatformGetProcAddress(\"glXCreateContextWithConfigSGIX\");\n        _glfw.glx.GetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)\n            _glfwPlatformGetProcAddress(\"glXGetVisualFromFBConfigSGIX\");\n\n        if (_glfw.glx.GetFBConfigAttribSGIX &&\n            _glfw.glx.ChooseFBConfigSGIX &&\n            _glfw.glx.CreateContextWithConfigSGIX &&\n            _glfw.glx.GetVisualFromFBConfigSGIX)\n        {\n            _glfw.glx.SGIX_fbconfig = GL_TRUE;\n        }\n    }\n\n    if (_glfwPlatformExtensionSupported(\"GLX_ARB_multisample\"))\n        _glfw.glx.ARB_multisample = GL_TRUE;\n\n    if (_glfwPlatformExtensionSupported(\"GLX_ARB_framebuffer_sRGB\"))\n        _glfw.glx.ARB_framebuffer_sRGB = GL_TRUE;\n\n    if (_glfwPlatformExtensionSupported(\"GLX_ARB_create_context\"))\n    {\n        _glfw.glx.CreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)\n            _glfwPlatformGetProcAddress(\"glXCreateContextAttribsARB\");\n\n        if (_glfw.glx.CreateContextAttribsARB)\n            _glfw.glx.ARB_create_context = GL_TRUE;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"GLX_ARB_create_context_robustness\"))\n        _glfw.glx.ARB_create_context_robustness = GL_TRUE;\n\n    if (_glfwPlatformExtensionSupported(\"GLX_ARB_create_context_profile\"))\n        _glfw.glx.ARB_create_context_profile = GL_TRUE;\n\n    if (_glfwPlatformExtensionSupported(\"GLX_EXT_create_context_es2_profile\"))\n        _glfw.glx.EXT_create_context_es2_profile = GL_TRUE;\n\n    return GL_TRUE;\n}\n\n// Terminate GLX\n//\nvoid _glfwTerminateContextAPI(void)\n{\n    // Unload libGL.so if necessary\n#ifdef _GLFW_DLOPEN_LIBGL\n    if (_glfw.glx.libGL != NULL)\n    {\n        dlclose(_glfw.glx.libGL);\n        _glfw.glx.libGL = NULL;\n    }\n#endif\n\n    pthread_key_delete(_glfw.glx.current);\n}\n\n#define setGLXattrib(attribName, attribValue) \\\n{ \\\n    attribs[index++] = attribName; \\\n    attribs[index++] = attribValue; \\\n    assert(index < sizeof(attribs) / sizeof(attribs[0])); \\\n}\n\n// Prepare for creation of the OpenGL context\n//\nint _glfwCreateContext(_GLFWwindow* window,\n                       const _GLFWwndconfig* wndconfig,\n                       const _GLFWfbconfig* fbconfig)\n{\n    int attribs[40];\n    GLXFBConfig native;\n    GLXContext share = NULL;\n\n    if (wndconfig->share)\n        share = wndconfig->share->glx.context;\n\n    if (!chooseFBConfig(fbconfig, &native))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"GLX: Failed to find a suitable GLXFBConfig\");\n        return GL_FALSE;\n    }\n\n    // Retrieve the corresponding visual\n    if (_glfw.glx.SGIX_fbconfig)\n    {\n        window->glx.visual =\n            _glfw.glx.GetVisualFromFBConfigSGIX(_glfw.x11.display, native);\n    }\n    else\n        window->glx.visual = glXGetVisualFromFBConfig(_glfw.x11.display, native);\n\n    if (window->glx.visual == NULL)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"GLX: Failed to retrieve visual for GLXFBConfig\");\n        return GL_FALSE;\n    }\n\n    if (wndconfig->clientAPI == GLFW_OPENGL_ES_API)\n    {\n        if (!_glfw.glx.ARB_create_context ||\n            !_glfw.glx.ARB_create_context_profile ||\n            !_glfw.glx.EXT_create_context_es2_profile)\n        {\n            _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                            \"GLX: OpenGL ES requested but \"\n                            \"GLX_EXT_create_context_es2_profile is unavailable\");\n            return GL_FALSE;\n        }\n    }\n\n    if (wndconfig->glForward)\n    {\n        if (!_glfw.glx.ARB_create_context)\n        {\n            _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                            \"GLX: Forward compatibility requested but \"\n                            \"GLX_ARB_create_context_profile is unavailable\");\n            return GL_FALSE;\n        }\n    }\n\n    if (wndconfig->glProfile)\n    {\n        if (!_glfw.glx.ARB_create_context ||\n            !_glfw.glx.ARB_create_context_profile)\n        {\n            _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                            \"GLX: An OpenGL profile requested but \"\n                            \"GLX_ARB_create_context_profile is unavailable\");\n            return GL_FALSE;\n        }\n    }\n\n    _glfw.glx.errorCode = Success;\n    XSetErrorHandler(errorHandler);\n\n    if (_glfw.glx.ARB_create_context)\n    {\n        int index = 0, mask = 0, flags = 0, strategy = 0;\n\n        if (wndconfig->clientAPI == GLFW_OPENGL_API)\n        {\n            if (wndconfig->glForward)\n                flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;\n\n            if (wndconfig->glDebug)\n                flags |= GLX_CONTEXT_DEBUG_BIT_ARB;\n\n            if (wndconfig->glProfile)\n            {\n                if (wndconfig->glProfile == GLFW_OPENGL_CORE_PROFILE)\n                    mask |= GLX_CONTEXT_CORE_PROFILE_BIT_ARB;\n                else if (wndconfig->glProfile == GLFW_OPENGL_COMPAT_PROFILE)\n                    mask |= GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;\n            }\n        }\n        else\n            mask |= GLX_CONTEXT_ES2_PROFILE_BIT_EXT;\n\n        if (wndconfig->glRobustness != GLFW_NO_ROBUSTNESS)\n        {\n            if (_glfw.glx.ARB_create_context_robustness)\n            {\n                if (wndconfig->glRobustness == GLFW_NO_RESET_NOTIFICATION)\n                    strategy = GLX_NO_RESET_NOTIFICATION_ARB;\n                else if (wndconfig->glRobustness == GLFW_LOSE_CONTEXT_ON_RESET)\n                    strategy = GLX_LOSE_CONTEXT_ON_RESET_ARB;\n\n                flags |= GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB;\n            }\n        }\n\n        if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0)\n        {\n            // NOTE: Only request an explicitly versioned context when\n            // necessary, as explicitly requesting version 1.0 does not always\n            // return the highest available version\n\n            setGLXattrib(GLX_CONTEXT_MAJOR_VERSION_ARB, wndconfig->glMajor);\n            setGLXattrib(GLX_CONTEXT_MINOR_VERSION_ARB, wndconfig->glMinor);\n        }\n\n        if (mask)\n            setGLXattrib(GLX_CONTEXT_PROFILE_MASK_ARB, mask);\n\n        if (flags)\n            setGLXattrib(GLX_CONTEXT_FLAGS_ARB, flags);\n\n        if (strategy)\n            setGLXattrib(GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB, strategy);\n\n        setGLXattrib(None, None);\n\n        window->glx.context =\n            _glfw.glx.CreateContextAttribsARB(_glfw.x11.display,\n                                              native,\n                                              share,\n                                              True,\n                                              attribs);\n\n        if (window->glx.context == NULL)\n        {\n            // HACK: This is a fallback for the broken Mesa implementation of\n            // GLX_ARB_create_context_profile, which fails default 1.0 context\n            // creation with a GLXBadProfileARB error in violation of the spec\n            if (_glfw.glx.errorCode == _glfw.glx.errorBase + GLXBadProfileARB &&\n                wndconfig->clientAPI == GLFW_OPENGL_API &&\n                wndconfig->glProfile == GLFW_OPENGL_ANY_PROFILE &&\n                wndconfig->glForward == GL_FALSE)\n            {\n                window->glx.context = createLegacyContext(window, native, share);\n            }\n        }\n    }\n    else\n        window->glx.context = createLegacyContext(window, native, share);\n\n    XSetErrorHandler(NULL);\n\n    if (window->glx.context == NULL)\n    {\n        char buffer[8192];\n        XGetErrorText(_glfw.x11.display,\n                      _glfw.glx.errorCode,\n                      buffer, sizeof(buffer));\n\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"GLX: Failed to create context: %s\",\n                        buffer);\n\n        return GL_FALSE;\n    }\n\n    return GL_TRUE;\n}\n\n#undef setGLXattrib\n\n// Destroy the OpenGL context\n//\nvoid _glfwDestroyContext(_GLFWwindow* window)\n{\n    if (window->glx.visual)\n    {\n        XFree(window->glx.visual);\n        window->glx.visual = NULL;\n    }\n\n    if (window->glx.context)\n    {\n        glXDestroyContext(_glfw.x11.display, window->glx.context);\n        window->glx.context = NULL;\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformMakeContextCurrent(_GLFWwindow* window)\n{\n    if (window)\n    {\n        glXMakeCurrent(_glfw.x11.display,\n                       window->x11.handle,\n                       window->glx.context);\n    }\n    else\n        glXMakeCurrent(_glfw.x11.display, None, NULL);\n\n    pthread_setspecific(_glfw.glx.current, window);\n}\n\n_GLFWwindow* _glfwPlatformGetCurrentContext(void)\n{\n    return (_GLFWwindow*) pthread_getspecific(_glfw.glx.current);\n}\n\nvoid _glfwPlatformSwapBuffers(_GLFWwindow* window)\n{\n    glXSwapBuffers(_glfw.x11.display, window->x11.handle);\n}\n\nvoid _glfwPlatformSwapInterval(int interval)\n{\n    _GLFWwindow* window = _glfwPlatformGetCurrentContext();\n\n    if (_glfw.glx.EXT_swap_control)\n    {\n        _glfw.glx.SwapIntervalEXT(_glfw.x11.display,\n                                  window->x11.handle,\n                                  interval);\n    }\n    else if (_glfw.glx.MESA_swap_control)\n        _glfw.glx.SwapIntervalMESA(interval);\n    else if (_glfw.glx.SGI_swap_control)\n    {\n        if (interval > 0)\n            _glfw.glx.SwapIntervalSGI(interval);\n    }\n}\n\nint _glfwPlatformExtensionSupported(const char* extension)\n{\n    const GLubyte* extensions;\n\n    // Get list of GLX extensions\n    extensions = (const GLubyte*) glXQueryExtensionsString(_glfw.x11.display,\n                                                           _glfw.x11.screen);\n    if (extensions != NULL)\n    {\n        if (_glfwStringInExtensionString(extension, extensions))\n            return GL_TRUE;\n    }\n\n    return GL_FALSE;\n}\n\nGLFWglproc _glfwPlatformGetProcAddress(const char* procname)\n{\n    return _glfw_glXGetProcAddress((const GLubyte*) procname);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW native API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return window->glx.context;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/glx_platform.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11/GLX\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#ifndef _glx_platform_h_\n#define _glx_platform_h_\n\n#define GLX_GLXEXT_LEGACY\n#include <GL/glx.h>\n\n// This path may need to be changed if you build GLFW using your own setup\n// We ship and use our own copy of glxext.h since GLFW uses fairly new\n// extensions and not all operating systems come with an up-to-date version\n#include \"../deps/GL/glxext.h\"\n\n// Do we have support for dlopen/dlsym?\n#if defined(_GLFW_HAS_DLOPEN)\n #include <dlfcn.h>\n#endif\n\n// We support four different ways for getting addresses for GL/GLX\n// extension functions: glXGetProcAddress, glXGetProcAddressARB,\n// glXGetProcAddressEXT, and dlsym\n#if defined(_GLFW_HAS_GLXGETPROCADDRESSARB)\n #define _glfw_glXGetProcAddress(x) glXGetProcAddressARB(x)\n#elif defined(_GLFW_HAS_GLXGETPROCADDRESS)\n #define _glfw_glXGetProcAddress(x) glXGetProcAddress(x)\n#elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT)\n #define _glfw_glXGetProcAddress(x) glXGetProcAddressEXT(x)\n#elif defined(_GLFW_HAS_DLOPEN)\n #define _glfw_glXGetProcAddress(x) dlsym(_glfw.glx.libGL, x)\n #define _GLFW_DLOPEN_LIBGL\n#else\n #error \"No OpenGL entry point retrieval mechanism was enabled\"\n#endif\n\n#define _GLFW_PLATFORM_FBCONFIG             GLXFBConfig     glx\n#define _GLFW_PLATFORM_CONTEXT_STATE        _GLFWcontextGLX glx\n#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryGLX glx\n\n#ifndef GLX_MESA_swap_control\ntypedef int (*PFNGLXSWAPINTERVALMESAPROC)(int);\n#endif\n\n\n//========================================================================\n// GLFW platform specific types\n//========================================================================\n\n//------------------------------------------------------------------------\n// Platform-specific OpenGL context structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWcontextGLX\n{\n    GLXContext      context; // OpenGL rendering context\n    XVisualInfo*    visual;  // Visual for selected GLXFBConfig\n\n} _GLFWcontextGLX;\n\n\n//------------------------------------------------------------------------\n// Platform-specific library global data for GLX\n//------------------------------------------------------------------------\ntypedef struct _GLFWlibraryGLX\n{\n    // Server-side GLX version\n    int             versionMajor, versionMinor;\n    int             eventBase;\n    int             errorBase;\n\n    // TLS key for per-thread current context/window\n    pthread_key_t   current;\n\n    // GLX error code received by Xlib error callback\n    int             errorCode;\n\n    // GLX extensions\n    PFNGLXSWAPINTERVALSGIPROC             SwapIntervalSGI;\n    PFNGLXSWAPINTERVALEXTPROC             SwapIntervalEXT;\n    PFNGLXSWAPINTERVALMESAPROC            SwapIntervalMESA;\n    PFNGLXGETFBCONFIGATTRIBSGIXPROC       GetFBConfigAttribSGIX;\n    PFNGLXCHOOSEFBCONFIGSGIXPROC          ChooseFBConfigSGIX;\n    PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX;\n    PFNGLXGETVISUALFROMFBCONFIGSGIXPROC   GetVisualFromFBConfigSGIX;\n    PFNGLXCREATECONTEXTATTRIBSARBPROC     CreateContextAttribsARB;\n    GLboolean       SGIX_fbconfig;\n    GLboolean       SGI_swap_control;\n    GLboolean       EXT_swap_control;\n    GLboolean       MESA_swap_control;\n    GLboolean       ARB_multisample;\n    GLboolean       ARB_framebuffer_sRGB;\n    GLboolean       ARB_create_context;\n    GLboolean       ARB_create_context_profile;\n    GLboolean       ARB_create_context_robustness;\n    GLboolean       EXT_create_context_es2_profile;\n\n#if defined(_GLFW_DLOPEN_LIBGL)\n    void*           libGL;  // dlopen handle for libGL.so\n#endif\n} _GLFWlibraryGLX;\n\n\n#endif // _glx_platform_h_\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/init.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <string.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdarg.h>\n\n\n// Global state shared between compilation units of GLFW\n// These are documented in internal.h\n//\nGLboolean _glfwInitialized = GL_FALSE;\n_GLFWlibrary _glfw;\n\n\n// The current error callback\n// This is outside of _glfw so it can be initialized and usable before\n// glfwInit is called, which lets that function report errors\n//\nstatic GLFWerrorfun _glfwErrorCallback = NULL;\n\n\n// Returns a generic string representation of the specified error\n//\nstatic const char* getErrorString(int error)\n{\n    switch (error)\n    {\n        case GLFW_NOT_INITIALIZED:\n            return \"The GLFW library is not initialized\";\n        case GLFW_NO_CURRENT_CONTEXT:\n            return \"There is no current context\";\n        case GLFW_INVALID_ENUM:\n            return \"Invalid argument for enum parameter\";\n        case GLFW_INVALID_VALUE:\n            return \"Invalid value for parameter\";\n        case GLFW_OUT_OF_MEMORY:\n            return \"Out of memory\";\n        case GLFW_API_UNAVAILABLE:\n            return \"The requested client API is unavailable\";\n        case GLFW_VERSION_UNAVAILABLE:\n            return \"The requested client API version is unavailable\";\n        case GLFW_PLATFORM_ERROR:\n            return \"A platform-specific error occurred\";\n        case GLFW_FORMAT_UNAVAILABLE:\n            return \"The requested format is unavailable\";\n    }\n\n    return \"ERROR: UNKNOWN ERROR TOKEN PASSED TO glfwErrorString\";\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                         GLFW event API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwInputError(int error, const char* format, ...)\n{\n    if (_glfwErrorCallback)\n    {\n        char buffer[16384];\n        const char* description;\n\n        if (format)\n        {\n            int count;\n            va_list vl;\n\n            va_start(vl, format);\n            count = vsnprintf(buffer, sizeof(buffer), format, vl);\n            va_end(vl);\n\n            if (count < 0)\n                buffer[sizeof(buffer) - 1] = '\\0';\n\n            description = buffer;\n        }\n        else\n            description = getErrorString(error);\n\n        _glfwErrorCallback(error, description);\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI int glfwInit(void)\n{\n    if (_glfwInitialized)\n        return GL_TRUE;\n\n    memset(&_glfw, 0, sizeof(_glfw));\n\n    if (!_glfwPlatformInit())\n    {\n        _glfwPlatformTerminate();\n        return GL_FALSE;\n    }\n\n    _glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);\n    if (_glfw.monitors == NULL)\n    {\n        _glfwErrorCallback(GLFW_PLATFORM_ERROR, \"No monitors found\");\n        _glfwPlatformTerminate();\n        return GL_FALSE;\n    }\n\n    _glfwInitialized = GL_TRUE;\n\n    // Not all window hints have zero as their default value\n    glfwDefaultWindowHints();\n\n    return GL_TRUE;\n}\n\nGLFWAPI void glfwTerminate(void)\n{\n    int i;\n\n    if (!_glfwInitialized)\n        return;\n\n    // Close all remaining windows\n    while (_glfw.windowListHead)\n        glfwDestroyWindow((GLFWwindow*) _glfw.windowListHead);\n\n    for (i = 0;  i < _glfw.monitorCount;  i++)\n    {\n        _GLFWmonitor* monitor = _glfw.monitors[i];\n        if (monitor->originalRamp.size)\n            _glfwPlatformSetGammaRamp(monitor, &monitor->originalRamp);\n    }\n\n    _glfwDestroyMonitors(_glfw.monitors, _glfw.monitorCount);\n    _glfw.monitors = NULL;\n    _glfw.monitorCount = 0;\n\n    _glfwPlatformTerminate();\n\n    _glfwInitialized = GL_FALSE;\n}\n\nGLFWAPI void glfwGetVersion(int* major, int* minor, int* rev)\n{\n    if (major != NULL)\n        *major = GLFW_VERSION_MAJOR;\n\n    if (minor != NULL)\n        *minor = GLFW_VERSION_MINOR;\n\n    if (rev != NULL)\n        *rev = GLFW_VERSION_REVISION;\n}\n\nGLFWAPI const char* glfwGetVersionString(void)\n{\n    return _glfwPlatformGetVersionString();\n}\n\nGLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)\n{\n    GLFWerrorfun previous = _glfwErrorCallback;\n    _glfwErrorCallback = cbfun;\n    return previous;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/input.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n// Internal key state used for sticky keys\n#define _GLFW_STICK 3\n\n\n// Sets the cursor mode for the specified window\n//\nstatic void setCursorMode(_GLFWwindow* window, int newMode)\n{\n    int oldMode;\n\n    if (newMode != GLFW_CURSOR_NORMAL &&\n        newMode != GLFW_CURSOR_HIDDEN &&\n        newMode != GLFW_CURSOR_DISABLED)\n    {\n        _glfwInputError(GLFW_INVALID_ENUM, NULL);\n        return;\n    }\n\n    oldMode = window->cursorMode;\n    if (oldMode == newMode)\n        return;\n\n    if (window == _glfw.focusedWindow)\n    {\n        if (oldMode == GLFW_CURSOR_DISABLED)\n            _glfwPlatformSetCursorPos(window, _glfw.cursorPosX, _glfw.cursorPosY);\n        else if (newMode == GLFW_CURSOR_DISABLED)\n        {\n            int width, height;\n\n            _glfw.cursorPosX = window->cursorPosX;\n            _glfw.cursorPosY = window->cursorPosY;\n\n            _glfwPlatformGetWindowSize(window, &width, &height);\n            _glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0);\n        }\n\n        _glfwPlatformSetCursorMode(window, newMode);\n    }\n\n    window->cursorMode = newMode;\n}\n\n// Set sticky keys mode for the specified window\n//\nstatic void setStickyKeys(_GLFWwindow* window, int enabled)\n{\n    if (window->stickyKeys == enabled)\n        return;\n\n    if (!enabled)\n    {\n        int i;\n\n        // Release all sticky keys\n        for (i = 0;  i <= GLFW_KEY_LAST;  i++)\n        {\n            if (window->key[i] == _GLFW_STICK)\n                window->key[i] = GLFW_RELEASE;\n        }\n    }\n\n    window->stickyKeys = enabled;\n}\n\n// Set sticky mouse buttons mode for the specified window\n//\nstatic void setStickyMouseButtons(_GLFWwindow* window, int enabled)\n{\n    if (window->stickyMouseButtons == enabled)\n        return;\n\n    if (!enabled)\n    {\n        int i;\n\n        // Release all sticky mouse buttons\n        for (i = 0;  i <= GLFW_MOUSE_BUTTON_LAST;  i++)\n        {\n            if (window->mouseButton[i] == _GLFW_STICK)\n                window->mouseButton[i] = GLFW_RELEASE;\n        }\n    }\n\n    window->stickyMouseButtons = enabled;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                         GLFW event API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods)\n{\n    GLboolean repeated = GL_FALSE;\n\n    if (action == GLFW_RELEASE && window->key[key] == GLFW_RELEASE)\n        return;\n\n    if (key >= 0 && key <= GLFW_KEY_LAST)\n    {\n        if (action == GLFW_PRESS && window->key[key] == GLFW_PRESS)\n            repeated = GL_TRUE;\n\n        if (action == GLFW_RELEASE && window->stickyKeys)\n            window->key[key] = _GLFW_STICK;\n        else\n            window->key[key] = (char) action;\n    }\n\n    if (repeated)\n        action = GLFW_REPEAT;\n\n    if (window->callbacks.key)\n        window->callbacks.key((GLFWwindow*) window, key, scancode, action, mods);\n}\n\nvoid _glfwInputChar(_GLFWwindow* window, unsigned int character)\n{\n    if (character == -1)\n        return;\n\n    if (character < 32 || (character > 126 && character < 160))\n        return;\n\n    if (window->callbacks.character)\n        window->callbacks.character((GLFWwindow*) window, character);\n}\n\nvoid _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset)\n{\n    if (window->callbacks.scroll)\n        window->callbacks.scroll((GLFWwindow*) window, xoffset, yoffset);\n}\n\nvoid _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods)\n{\n    if (button < 0 || button > GLFW_MOUSE_BUTTON_LAST)\n        return;\n\n    // Register mouse button action\n    if (action == GLFW_RELEASE && window->stickyMouseButtons)\n        window->mouseButton[button] = _GLFW_STICK;\n    else\n        window->mouseButton[button] = (char) action;\n\n    if (window->callbacks.mouseButton)\n        window->callbacks.mouseButton((GLFWwindow*) window, button, action, mods);\n}\n\nvoid _glfwInputCursorMotion(_GLFWwindow* window, double x, double y)\n{\n    if (window->cursorMode == GLFW_CURSOR_DISABLED)\n    {\n        if (x == 0.0 && y == 0.0)\n            return;\n\n        window->cursorPosX += x;\n        window->cursorPosY += y;\n    }\n    else\n    {\n        if (window->cursorPosX == x && window->cursorPosY == y)\n            return;\n\n        window->cursorPosX = x;\n        window->cursorPosY = y;\n    }\n\n    if (window->callbacks.cursorPos)\n    {\n        window->callbacks.cursorPos((GLFWwindow*) window,\n                                    window->cursorPosX,\n                                    window->cursorPosY);\n    }\n}\n\nvoid _glfwInputCursorEnter(_GLFWwindow* window, int entered)\n{\n    if (window->callbacks.cursorEnter)\n        window->callbacks.cursorEnter((GLFWwindow*) window, entered);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI int glfwGetInputMode(GLFWwindow* handle, int mode)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(0);\n\n    switch (mode)\n    {\n        case GLFW_CURSOR:\n            return window->cursorMode;\n        case GLFW_STICKY_KEYS:\n            return window->stickyKeys;\n        case GLFW_STICKY_MOUSE_BUTTONS:\n            return window->stickyMouseButtons;\n        default:\n            _glfwInputError(GLFW_INVALID_ENUM, NULL);\n            return 0;\n    }\n}\n\nGLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    switch (mode)\n    {\n        case GLFW_CURSOR:\n            setCursorMode(window, value);\n            break;\n        case GLFW_STICKY_KEYS:\n            setStickyKeys(window, value ? GL_TRUE : GL_FALSE);\n            break;\n        case GLFW_STICKY_MOUSE_BUTTONS:\n            setStickyMouseButtons(window, value ? GL_TRUE : GL_FALSE);\n            break;\n        default:\n            _glfwInputError(GLFW_INVALID_ENUM, NULL);\n            break;\n    }\n}\n\nGLFWAPI int glfwGetKey(GLFWwindow* handle, int key)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_RELEASE);\n\n    if (key < 0 || key > GLFW_KEY_LAST)\n    {\n        _glfwInputError(GLFW_INVALID_ENUM, \"The specified key is invalid\");\n        return GLFW_RELEASE;\n    }\n\n    if (window->key[key] == _GLFW_STICK)\n    {\n        // Sticky mode: release key now\n        window->key[key] = GLFW_RELEASE;\n        return GLFW_PRESS;\n    }\n\n    return (int) window->key[key];\n}\n\nGLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_RELEASE);\n\n    if (button < 0 || button > GLFW_MOUSE_BUTTON_LAST)\n    {\n        _glfwInputError(GLFW_INVALID_ENUM,\n                        \"The specified mouse button is invalid\");\n        return GLFW_RELEASE;\n    }\n\n    if (window->mouseButton[button] == _GLFW_STICK)\n    {\n        // Sticky mode: release mouse button now\n        window->mouseButton[button] = GLFW_RELEASE;\n        return GLFW_PRESS;\n    }\n\n    return (int) window->mouseButton[button];\n}\n\nGLFWAPI void glfwGetCursorPos(GLFWwindow* handle, double* xpos, double* ypos)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (xpos)\n        *xpos = window->cursorPosX;\n\n    if (ypos)\n        *ypos = window->cursorPosY;\n}\n\nGLFWAPI void glfwSetCursorPos(GLFWwindow* handle, double xpos, double ypos)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (_glfw.focusedWindow != window)\n        return;\n\n    // Don't do anything if the cursor position did not change\n    if (xpos == window->cursorPosX && ypos == window->cursorPosY)\n        return;\n\n    // Set GLFW cursor position\n    window->cursorPosX = xpos;\n    window->cursorPosY = ypos;\n\n    // Do not move physical cursor if it is disabled\n    if (window->cursorMode == GLFW_CURSOR_DISABLED)\n        return;\n\n    // Update physical cursor position\n    _glfwPlatformSetCursorPos(window, xpos, ypos);\n}\n\nGLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* handle, GLFWkeyfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWkeyfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.key;\n    window->callbacks.key = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* handle, GLFWcharfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWcharfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.character;\n    window->callbacks.character = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* handle,\n                                                      GLFWmousebuttonfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWmousebuttonfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.mouseButton;\n    window->callbacks.mouseButton = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* handle,\n                                                  GLFWcursorposfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWcursorposfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.cursorPos;\n    window->callbacks.cursorPos = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* handle,\n                                                      GLFWcursorenterfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWcursorenterfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.cursorEnter;\n    window->callbacks.cursorEnter = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* handle,\n                                            GLFWscrollfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWscrollfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.scroll;\n    window->callbacks.scroll = cbfun;\n    return previous;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/internal.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#ifndef _internal_h_\n#define _internal_h_\n\n\n#include \"config.h\"\n\n#if defined(_GLFW_USE_OPENGL)\n // This is the default for glfw3.h\n#elif defined(_GLFW_USE_GLESV1)\n #define GLFW_INCLUDE_ES1\n#elif defined(_GLFW_USE_GLESV2)\n #define GLFW_INCLUDE_ES2\n#else\n #error \"No supported client library selected\"\n#endif\n\n// Disable the inclusion of the platform glext.h by gl.h to allow proper\n// inclusion of our own, newer glext.h below\n#define GL_GLEXT_LEGACY\n\n#include \"../include/GLFW/glfw3.h\"\n\n#if defined(_GLFW_USE_OPENGL)\n // This path may need to be changed if you build GLFW using your own setup\n // GLFW comes with its own copy of glext.h since it uses fairly new extensions\n // and not all development environments come with an up-to-date version\n #include \"../deps/GL/glext.h\"\n#endif\n\ntypedef struct _GLFWhints       _GLFWhints;\ntypedef struct _GLFWwndconfig   _GLFWwndconfig;\ntypedef struct _GLFWfbconfig    _GLFWfbconfig;\ntypedef struct _GLFWwindow      _GLFWwindow;\ntypedef struct _GLFWlibrary     _GLFWlibrary;\ntypedef struct _GLFWmonitor     _GLFWmonitor;\n\n#if defined(_GLFW_COCOA)\n #include \"cocoa_platform.h\"\n#elif defined(_GLFW_WIN32)\n #include \"win32_platform.h\"\n#elif defined(_GLFW_X11)\n #include \"x11_platform.h\"\n#else\n #error \"No supported window creation API selected\"\n#endif\n\n\n//========================================================================\n// Doxygen group definitions\n//========================================================================\n\n/*! @defgroup platform Platform interface\n *  @brief The interface implemented by the platform-specific code.\n *\n *  The platform API is the interface exposed by the platform-specific code for\n *  each platform and is called by the shared code of the public API It mirrors\n *  the public API except it uses objects instead of handles.\n */\n/*! @defgroup event Event interface\n *  @brief The interface used by the platform-specific code to report events.\n *\n *  The event API is used by the platform-specific code to notify the shared\n *  code of events that can be translated into state changes and/or callback\n *  calls.\n */\n/*! @defgroup utility Utility functions\n *  @brief Various utility functions for internal use.\n *\n *  These functions are shared code and may be used by any part of GLFW\n *  Each platform may add its own utility functions, but those may only be\n *  called by the platform-specific code\n */\n\n\n//========================================================================\n// Helper macros\n//========================================================================\n\n// Checks for whether the library has been intitalized\n#define _GLFW_REQUIRE_INIT()                         \\\n    if (!_glfwInitialized)                           \\\n    {                                                \\\n        _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \\\n        return;                                      \\\n    }\n#define _GLFW_REQUIRE_INIT_OR_RETURN(x)              \\\n    if (!_glfwInitialized)                           \\\n    {                                                \\\n        _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \\\n        return x;                                    \\\n    }\n\n\n//========================================================================\n// Internal types\n//========================================================================\n\n/*! @brief Window and context configuration.\n *\n *  Parameters relating to the creation of the context and window but not\n *  directly related to the framebuffer.  This is used to pass window and\n *  context creation parameters from shared code to the platform API.\n */\nstruct _GLFWwndconfig\n{\n    int           width;\n    int           height;\n    const char*   title;\n    GLboolean     resizable;\n    GLboolean     visible;\n    GLboolean     decorated;\n    int           clientAPI;\n    int           glMajor;\n    int           glMinor;\n    GLboolean     glForward;\n    GLboolean     glDebug;\n    int           glProfile;\n    int           glRobustness;\n    _GLFWmonitor* monitor;\n    _GLFWwindow*  share;\n};\n\n\n/*! @brief Framebuffer configuration.\n *\n *  This describes buffers and their sizes.  It also contains\n *  a platform-specific ID used to map back to the backend API's object.\n *\n *  It is used to pass framebuffer parameters from shared code to the platform\n *  API and also to enumerate and select available framebuffer configs.\n */\nstruct _GLFWfbconfig\n{\n    int         redBits;\n    int         greenBits;\n    int         blueBits;\n    int         alphaBits;\n    int         depthBits;\n    int         stencilBits;\n    int         accumRedBits;\n    int         accumGreenBits;\n    int         accumBlueBits;\n    int         accumAlphaBits;\n    int         auxBuffers;\n    GLboolean   stereo;\n    int         samples;\n    GLboolean   sRGB;\n\n    // This is defined in the context API's platform.h\n    _GLFW_PLATFORM_FBCONFIG;\n};\n\n\n/*! @brief Window and context structure.\n */\nstruct _GLFWwindow\n{\n    struct _GLFWwindow* next;\n\n    // Window settings and state\n    GLboolean           iconified;\n    GLboolean           resizable;\n    GLboolean           decorated;\n    GLboolean           visible;\n    GLboolean           closed;\n    void*               userPointer;\n    GLFWvidmode         videoMode;\n    _GLFWmonitor*       monitor;\n\n    // Window input state\n    GLboolean           stickyKeys;\n    GLboolean           stickyMouseButtons;\n    double              cursorPosX, cursorPosY;\n    int                 cursorMode;\n    char                mouseButton[GLFW_MOUSE_BUTTON_LAST + 1];\n    char                key[GLFW_KEY_LAST + 1];\n\n    // OpenGL extensions and context attributes\n    int                 clientAPI;\n    int                 glMajor, glMinor, glRevision;\n    GLboolean           glForward, glDebug;\n    int                 glProfile;\n    int                 glRobustness;\n#if defined(_GLFW_USE_OPENGL)\n    PFNGLGETSTRINGIPROC GetStringi;\n#endif\n\n    struct {\n        GLFWwindowposfun        pos;\n        GLFWwindowsizefun       size;\n        GLFWwindowclosefun      close;\n        GLFWwindowrefreshfun    refresh;\n        GLFWwindowfocusfun      focus;\n        GLFWwindowiconifyfun    iconify;\n        GLFWframebuffersizefun  fbsize;\n        GLFWmousebuttonfun      mouseButton;\n        GLFWcursorposfun        cursorPos;\n        GLFWcursorenterfun      cursorEnter;\n        GLFWscrollfun           scroll;\n        GLFWkeyfun              key;\n        GLFWcharfun             character;\n    } callbacks;\n\n    // This is defined in the window API's platform.h\n    _GLFW_PLATFORM_WINDOW_STATE;\n    // This is defined in the context API's platform.h\n    _GLFW_PLATFORM_CONTEXT_STATE;\n};\n\n\n/*! @brief Monitor structure.\n */\nstruct _GLFWmonitor\n{\n    char*           name;\n\n    // Physical dimensions in millimeters.\n    int             widthMM, heightMM;\n\n    GLFWvidmode*    modes;\n    int             modeCount;\n    GLFWvidmode     currentMode;\n\n    GLFWgammaramp   originalRamp;\n    GLFWgammaramp   currentRamp;\n\n    // This is defined in the window API's platform.h\n    _GLFW_PLATFORM_MONITOR_STATE;\n};\n\n\n/*! @brief Library global data.\n */\nstruct _GLFWlibrary\n{\n    struct {\n        int         redBits;\n        int         greenBits;\n        int         blueBits;\n        int         alphaBits;\n        int         depthBits;\n        int         stencilBits;\n        int         accumRedBits;\n        int         accumGreenBits;\n        int         accumBlueBits;\n        int         accumAlphaBits;\n        int         auxBuffers;\n        GLboolean   stereo;\n        GLboolean   resizable;\n        GLboolean   visible;\n        GLboolean   decorated;\n        int         samples;\n        GLboolean   sRGB;\n        int         refreshRate;\n        int         clientAPI;\n        int         glMajor;\n        int         glMinor;\n        GLboolean   glForward;\n        GLboolean   glDebug;\n        int         glProfile;\n        int         glRobustness;\n    } hints;\n\n    double          cursorPosX, cursorPosY;\n\n    _GLFWwindow*    windowListHead;\n    _GLFWwindow*    focusedWindow;\n\n    _GLFWmonitor**  monitors;\n    int             monitorCount;\n    GLFWmonitorfun  monitorCallback;\n\n    // This is defined in the window API's platform.h\n    _GLFW_PLATFORM_LIBRARY_WINDOW_STATE;\n    // This is defined in the context API's platform.h\n    _GLFW_PLATFORM_LIBRARY_OPENGL_STATE;\n};\n\n\n//========================================================================\n// Global state shared between compilation units of GLFW\n//========================================================================\n\n/*! @brief Flag indicating whether GLFW has been successfully initialized.\n */\nextern GLboolean _glfwInitialized;\n\n/*! @brief All global data protected by @ref _glfwInitialized.\n *  This should only be touched after a call to @ref glfwInit that has not been\n *  followed by a call to @ref glfwTerminate.\n */\nextern _GLFWlibrary _glfw;\n\n\n//========================================================================\n// Platform API functions\n//========================================================================\n\n/*! @brief Initializes the platform-specific part of the library.\n *  @return `GL_TRUE` if successful, or `GL_FALSE` if an error occurred.\n *  @ingroup platform\n */\nint _glfwPlatformInit(void);\n\n/*! @brief Terminates the platform-specific part of the library.\n *  @ingroup platform\n */\nvoid _glfwPlatformTerminate(void);\n\n/*! @copydoc glfwGetVersionString\n *  @ingroup platform\n *\n *  @note The returned string must be available for the duration of the program.\n *\n *  @note The returned string must not change for the duration of the program.\n */\nconst char* _glfwPlatformGetVersionString(void);\n\n/*! @copydoc glfwSetCursorPos\n *  @ingroup platform\n */\nvoid _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos);\n\n/*! @brief Sets up the specified cursor mode for the specified window.\n *  @param[in] window The window whose cursor mode to change.\n *  @param[in] mode The desired cursor mode.\n *  @ingroup platform\n */\nvoid _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode);\n\n/*! @copydoc glfwGetMonitors\n *  @ingroup platform\n */\n_GLFWmonitor** _glfwPlatformGetMonitors(int* count);\n\n/*! @brief Checks whether two monitor objects represent the same monitor.\n *\n *  @param[in] first The first monitor.\n *  @param[in] second The second monitor.\n *  @return @c GL_TRUE if the monitor objects represent the same monitor, or @c\n *  GL_FALSE otherwise.\n *  @ingroup platform\n */\nGLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second);\n\n/*! @copydoc glfwGetMonitorPos\n *  @ingroup platform\n */\nvoid _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos);\n\n/*! @copydoc glfwGetVideoModes\n *  @ingroup platform\n */\nGLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count);\n\n/*! @ingroup platform\n */\nvoid _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode);\n\n/*! @copydoc glfwGetGammaRamp\n *  @ingroup platform\n */\nvoid _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp);\n\n/*! @copydoc glfwSetGammaRamp\n *  @ingroup platform\n */\nvoid _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp);\n\n/*! @copydoc glfwSetClipboardString\n *  @ingroup platform\n */\nvoid _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string);\n\n/*! @copydoc glfwGetClipboardString\n *  @ingroup platform\n *\n *  @note The returned string must be valid until the next call to @ref\n *  _glfwPlatformGetClipboardString or @ref _glfwPlatformSetClipboardString.\n */\nconst char* _glfwPlatformGetClipboardString(_GLFWwindow* window);\n\n/*! @copydoc glfwJoystickPresent\n *  @ingroup platform\n */\nint _glfwPlatformJoystickPresent(int joy);\n\n/*! @copydoc glfwGetJoystickAxes\n *  @ingroup platform\n */\nconst float* _glfwPlatformGetJoystickAxes(int joy, int* count);\n\n/*! @copydoc glfwGetJoystickButtons\n *  @ingroup platform\n */\nconst unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count);\n\n/*! @copydoc glfwGetJoystickName\n *  @ingroup platform\n */\nconst char* _glfwPlatformGetJoystickName(int joy);\n\n/*! @copydoc glfwGetTime\n *  @ingroup platform\n */\ndouble _glfwPlatformGetTime(void);\n\n/*! @copydoc glfwSetTime\n *  @ingroup platform\n */\nvoid _glfwPlatformSetTime(double time);\n\n/*! @ingroup platform\n */\nint _glfwPlatformCreateWindow(_GLFWwindow* window,\n                              const _GLFWwndconfig* wndconfig,\n                              const _GLFWfbconfig* fbconfig);\n\n/*! @ingroup platform\n */\nvoid _glfwPlatformDestroyWindow(_GLFWwindow* window);\n\n/*! @copydoc glfwSetWindowTitle\n *  @ingroup platform\n */\nvoid _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);\n\n/*! @copydoc glfwGetWindowPos\n *  @ingroup platform\n */\nvoid _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos);\n\n/*! @copydoc glfwSetWindowPos\n *  @ingroup platform\n */\nvoid _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos);\n\n/*! @copydoc glfwGetWindowSize\n *  @ingroup platform\n */\nvoid _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height);\n\n/*! @copydoc glfwSetWindowSize\n *  @ingroup platform\n */\nvoid _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);\n\n/*! @copydoc glfwGetFramebufferSize\n *  @ingroup platform\n */\nvoid _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height);\n\n/*! @copydoc glfwIconifyWindow\n *  @ingroup platform\n */\nvoid _glfwPlatformIconifyWindow(_GLFWwindow* window);\n\n/*! @copydoc glfwRestoreWindow\n *  @ingroup platform\n */\nvoid _glfwPlatformRestoreWindow(_GLFWwindow* window);\n\n/*! @copydoc glfwShowWindow\n *  @ingroup platform\n */\nvoid _glfwPlatformShowWindow(_GLFWwindow* window);\n\n/*! @copydoc glfwHideWindow\n *  @ingroup platform\n */\nvoid _glfwPlatformHideWindow(_GLFWwindow* window);\n\n/*! @copydoc glfwPollEvents\n *  @ingroup platform\n */\nvoid _glfwPlatformPollEvents(void);\n\n/*! @copydoc glfwWaitEvents\n *  @ingroup platform\n */\nvoid _glfwPlatformWaitEvents(void);\n\n/*! @copydoc glfwMakeContextCurrent\n *  @ingroup platform\n */\nvoid _glfwPlatformMakeContextCurrent(_GLFWwindow* window);\n\n/*! @copydoc glfwGetCurrentContext\n *  @ingroup platform\n */\n_GLFWwindow* _glfwPlatformGetCurrentContext(void);\n\n/*! @copydoc glfwSwapBuffers\n *  @ingroup platform\n */\nvoid _glfwPlatformSwapBuffers(_GLFWwindow* window);\n\n/*! @copydoc glfwSwapInterval\n *  @ingroup platform\n */\nvoid _glfwPlatformSwapInterval(int interval);\n\n/*! @ingroup platform\n */\nint _glfwPlatformExtensionSupported(const char* extension);\n\n/*! @copydoc glfwGetProcAddress\n *  @ingroup platform\n */\nGLFWglproc _glfwPlatformGetProcAddress(const char* procname);\n\n\n//========================================================================\n// Event API functions\n//========================================================================\n\n/*! @brief Notifies shared code of a window focus event.\n *  @param[in] window The window that received the event.\n *  @param[in] focused `GL_TRUE` if the window received focus, or `GL_FALSE`\n *  if it lost focus.\n *  @ingroup event\n */\nvoid _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused);\n\n/*! @brief Notifies shared code of a window movement event.\n *  @param[in] window The window that received the event.\n *  @param[in] xpos The new x-coordinate of the client area of the window.\n *  @param[in] ypos The new y-coordinate of the client area of the window.\n *  @ingroup event\n */\nvoid _glfwInputWindowPos(_GLFWwindow* window, int xpos, int ypos);\n\n/*! @brief Notifies shared code of a window resize event.\n *  @param[in] window The window that received the event.\n *  @param[in] width The new width of the client area of the window.\n *  @param[in] height The new height of the client area of the window.\n *  @ingroup event\n */\nvoid _glfwInputWindowSize(_GLFWwindow* window, int width, int height);\n\n/*! @brief Notifies shared code of a framebuffer resize event.\n *  @param[in] window The window that received the event.\n *  @param[in] width The new width, in pixels, of the framebuffer.\n *  @param[in] height The new height, in pixels, of the framebuffer.\n *  @ingroup event\n */\nvoid _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height);\n\n/*! @brief Notifies shared code of a window iconification event.\n *  @param[in] window The window that received the event.\n *  @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`\n *  if it was restored.\n *  @ingroup event\n */\nvoid _glfwInputWindowIconify(_GLFWwindow* window, int iconified);\n\n/*! @brief Notifies shared code of a window show/hide event.\n *  @param[in] window The window that received the event.\n *  @param[in] visible `GL_TRUE` if the window was shown, or `GL_FALSE` if it\n *  was hidden.\n *  @ingroup event\n */\nvoid _glfwInputWindowVisibility(_GLFWwindow* window, int visible);\n\n/*! @brief Notifies shared code of a window damage event.\n *  @param[in] window The window that received the event.\n */\nvoid _glfwInputWindowDamage(_GLFWwindow* window);\n\n/*! @brief Notifies shared code of a window close request event\n *  @param[in] window The window that received the event.\n *  @ingroup event\n */\nvoid _glfwInputWindowCloseRequest(_GLFWwindow* window);\n\n/*! @brief Notifies shared code of a physical key event.\n *  @param[in] window The window that received the event.\n *  @param[in] key The key that was pressed or released.\n *  @param[in] scancode The system-specific scan code of the key.\n *  @param[in] action @ref GLFW_PRESS or @ref GLFW_RELEASE.\n *  @param[in] mods The modifiers pressed when the event was generated.\n *  @ingroup event\n */\nvoid _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods);\n\n/*! @brief Notifies shared code of a Unicode character input event.\n *  @param[in] window The window that received the event.\n *  @param[in] character The Unicode code point of the input character.\n *  @ingroup event\n */\nvoid _glfwInputChar(_GLFWwindow* window, unsigned int character);\n\n/*! @brief Notifies shared code of a scroll event.\n *  @param[in] window The window that received the event.\n *  @param[in] x The scroll offset along the x-axis.\n *  @param[in] y The scroll offset along the y-axis.\n *  @ingroup event\n */\nvoid _glfwInputScroll(_GLFWwindow* window, double x, double y);\n\n/*! @brief Notifies shared code of a mouse button click event.\n *  @param[in] window The window that received the event.\n *  @param[in] button The button that was pressed or released.\n *  @param[in] action @ref GLFW_PRESS or @ref GLFW_RELEASE.\n *  @ingroup event\n */\nvoid _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods);\n\n/*! @brief Notifies shared code of a cursor motion event.\n *  @param[in] window The window that received the event.\n *  @param[in] x The new x-coordinate of the cursor, relative to the left edge\n *  of the client area of the window.\n *  @param[in] y The new y-coordinate of the cursor, relative to the top edge\n *  of the client area of the window.\n *  @ingroup event\n */\nvoid _glfwInputCursorMotion(_GLFWwindow* window, double x, double y);\n\n/*! @brief Notifies shared code of a cursor enter/leave event.\n *  @param[in] window The window that received the event.\n *  @param[in] entered `GL_TRUE` if the cursor entered the client area of the\n *  window, or `GL_FALSE` if it left it.\n *  @ingroup event\n */\nvoid _glfwInputCursorEnter(_GLFWwindow* window, int entered);\n\n/*! @ingroup event\n */\nvoid _glfwInputMonitorChange(void);\n\n/*! @brief Notifies shared code of an error.\n *  @param[in] error The error code most suitable for the error.\n *  @param[in] format The `printf` style format string of the error\n *  description.\n *  @ingroup event\n */\nvoid _glfwInputError(int error, const char* format, ...);\n\n\n//========================================================================\n// Utility functions\n//========================================================================\n\n/*! @ingroup utility\n */\nconst GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,\n                                        const GLFWvidmode* desired);\n\n/*! @brief Performs lexical comparison between two @ref GLFWvidmode structures.\n *  @ingroup utility\n */\nint _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);\n\n/*! @brief Splits a color depth into red, green and blue bit depths.\n *  @ingroup utility\n */\nvoid _glfwSplitBPP(int bpp, int* red, int* green, int* blue);\n\n/*! @brief Searches an extension string for the specified extension.\n *  @param[in] string The extension string to search.\n *  @param[in] extensions The extension to search for.\n *  @return `GL_TRUE` if the extension was found, or `GL_FALSE` otherwise.\n *  @ingroup utility\n */\nint _glfwStringInExtensionString(const char* string, const GLubyte* extensions);\n\n/*! @brief Chooses the framebuffer config that best matches the desired one.\n *  @param[in] desired The desired framebuffer config.\n *  @param[in] alternatives The framebuffer configs supported by the system.\n *  @param[in] count The number of entries in the alternatives array.\n *  @return The framebuffer config most closely matching the desired one, or @c\n *  NULL if none fulfilled the hard constraints of the desired values.\n *  @ingroup utility\n */\nconst _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,\n                                         const _GLFWfbconfig* alternatives,\n                                         unsigned int count);\n\n/*! @brief Retrieves the attributes of the current context.\n *  @return `GL_TRUE` if successful, or `GL_FALSE` if the context is unusable.\n *  @ingroup utility\n */\nGLboolean _glfwRefreshContextAttribs(void);\n\n/*! @brief Checks whether the desired context attributes are valid.\n *  @param[in] wndconfig The context attributes to check.\n *  @return `GL_TRUE` if the context attributes are valid, or `GL_FALSE`\n *  otherwise.\n *  @ingroup utility\n *\n *  This function checks things like whether the specified client API version\n *  exists and whether all relevant options have supported and non-conflicting\n *  values.\n */\nGLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig);\n\n/*! @brief Checks whether the current context fulfils the specified hard\n *  constraints.\n *  @param[in] wndconfig The desired context attributes.\n *  @return `GL_TRUE` if the context fulfils the hard constraints, or `GL_FALSE`\n *  otherwise.\n *  @ingroup utility\n */\nGLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig);\n\n/*! @ingroup utility\n */\nvoid _glfwAllocGammaRamp(GLFWgammaramp* ramp, unsigned int size);\n\n/*! @ingroup utility\n */\nvoid _glfwFreeGammaRamp(GLFWgammaramp* ramp);\n\n/*! @ingroup utility\n */\n_GLFWmonitor* _glfwCreateMonitor(const char* name, int widthMM, int heightMM);\n\n/*! @ingroup utility\n  */\nvoid _glfwDestroyMonitor(_GLFWmonitor* monitor);\n\n/*! @ingroup utility\n  */\nvoid _glfwDestroyMonitors(_GLFWmonitor** monitors, int count);\n\n#endif // _internal_h_\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/joystick.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI int glfwJoystickPresent(int joy)\n{\n    _GLFW_REQUIRE_INIT_OR_RETURN(0);\n\n    if (joy < 0 || joy > GLFW_JOYSTICK_LAST)\n    {\n        _glfwInputError(GLFW_INVALID_ENUM, NULL);\n        return 0;\n    }\n\n    return _glfwPlatformJoystickPresent(joy);\n}\n\nGLFWAPI const float* glfwGetJoystickAxes(int joy, int* count)\n{\n    *count = 0;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    if (joy < 0 || joy > GLFW_JOYSTICK_LAST)\n    {\n        _glfwInputError(GLFW_INVALID_ENUM, NULL);\n        return NULL;\n    }\n\n    return _glfwPlatformGetJoystickAxes(joy, count);\n}\n\nGLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count)\n{\n    *count = 0;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    if (joy < 0 || joy > GLFW_JOYSTICK_LAST)\n    {\n        _glfwInputError(GLFW_INVALID_ENUM, NULL);\n        return NULL;\n    }\n\n    return _glfwPlatformGetJoystickButtons(joy, count);\n}\n\nGLFWAPI const char* glfwGetJoystickName(int joy)\n{\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    if (joy < 0 || joy > GLFW_JOYSTICK_LAST)\n    {\n        _glfwInputError(GLFW_INVALID_ENUM, NULL);\n        return NULL;\n    }\n\n    return _glfwPlatformGetJoystickName(joy);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/monitor.c",
    "content": "//========================================================================\n// GLFW - An OpenGL framework\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <string.h>\n#include <stdlib.h>\n#include <limits.h>\n\n#if defined(_MSC_VER)\n #include <malloc.h>\n #define strdup _strdup\n#endif\n\n\n// Lexical comparison function for GLFW video modes, used by qsort\n//\nstatic int compareVideoModes(const void* firstPtr, const void* secondPtr)\n{\n    int firstBPP, secondBPP, firstSize, secondSize;\n    GLFWvidmode* first = (GLFWvidmode*) firstPtr;\n    GLFWvidmode* second = (GLFWvidmode*) secondPtr;\n\n    // First sort on color bits per pixel\n\n    firstBPP = first->redBits +\n               first->greenBits +\n               first->blueBits;\n    secondBPP = second->redBits +\n                second->greenBits +\n                second->blueBits;\n\n    if (firstBPP != secondBPP)\n        return firstBPP - secondBPP;\n\n    // Then sort on screen area, in pixels\n\n    firstSize = first->width * first->height;\n    secondSize = second->width * second->height;\n\n    if (firstSize != secondSize)\n        return firstSize - secondSize;\n\n    // Lastly sort on refresh rate\n\n    return first->refreshRate - second->refreshRate;\n}\n\n// Retrieves the available modes for the specified monitor\n//\nstatic int refreshVideoModes(_GLFWmonitor* monitor)\n{\n    int modeCount;\n    GLFWvidmode* modes;\n\n    if (monitor->modes)\n        return GL_TRUE;\n\n    modes = _glfwPlatformGetVideoModes(monitor, &modeCount);\n    if (!modes)\n        return GL_FALSE;\n\n    qsort(modes, modeCount, sizeof(GLFWvidmode), compareVideoModes);\n\n    free(monitor->modes);\n    monitor->modes = modes;\n    monitor->modeCount = modeCount;\n\n    return GL_TRUE;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                         GLFW event API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwInputMonitorChange(void)\n{\n    int i, j, monitorCount = _glfw.monitorCount;\n    _GLFWmonitor** monitors = _glfw.monitors;\n\n    _glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);\n\n    // Re-use still connected monitor objects\n\n    for (i = 0;  i < _glfw.monitorCount;  i++)\n    {\n        for (j = 0;  j < monitorCount;  j++)\n        {\n            if (_glfwPlatformIsSameMonitor(_glfw.monitors[i], monitors[j]))\n            {\n                _glfwDestroyMonitor(_glfw.monitors[i]);\n                _glfw.monitors[i] = monitors[j];\n                break;\n            }\n        }\n    }\n\n    // Find and report disconnected monitors (not in the new list)\n\n    for (i = 0;  i < monitorCount;  i++)\n    {\n        _GLFWwindow* window;\n\n        for (j = 0;  j < _glfw.monitorCount;  j++)\n        {\n            if (monitors[i] == _glfw.monitors[j])\n                break;\n        }\n\n        if (j < _glfw.monitorCount)\n            continue;\n\n        for (window = _glfw.windowListHead;  window;  window = window->next)\n        {\n            if (window->monitor == monitors[i])\n                window->monitor = NULL;\n        }\n\n        if (_glfw.monitorCallback)\n            _glfw.monitorCallback((GLFWmonitor*) monitors[i], GLFW_DISCONNECTED);\n    }\n\n    // Find and report newly connected monitors (not in the old list)\n    // Re-used monitor objects are then removed from the old list to avoid\n    // having them destroyed at the end of this function\n\n    for (i = 0;  i < _glfw.monitorCount;  i++)\n    {\n        for (j = 0;  j < monitorCount;  j++)\n        {\n            if (_glfw.monitors[i] == monitors[j])\n            {\n                monitors[j] = NULL;\n                break;\n            }\n        }\n\n        if (j < monitorCount)\n            continue;\n\n        if (_glfw.monitorCallback)\n            _glfw.monitorCallback((GLFWmonitor*) _glfw.monitors[i], GLFW_CONNECTED);\n    }\n\n    _glfwDestroyMonitors(monitors, monitorCount);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n_GLFWmonitor* _glfwCreateMonitor(const char* name, int widthMM, int heightMM)\n{\n    _GLFWmonitor* monitor = (_GLFWmonitor*) calloc(1, sizeof(_GLFWmonitor));\n    monitor->name = strdup(name);\n    monitor->widthMM = widthMM;\n    monitor->heightMM = heightMM;\n\n    return monitor;\n}\n\nvoid _glfwDestroyMonitor(_GLFWmonitor* monitor)\n{\n    if (monitor == NULL)\n        return;\n\n    _glfwFreeGammaRamp(&monitor->originalRamp);\n    _glfwFreeGammaRamp(&monitor->currentRamp);\n\n    free(monitor->modes);\n    free(monitor->name);\n    free(monitor);\n}\n\nvoid _glfwDestroyMonitors(_GLFWmonitor** monitors, int count)\n{\n    int i;\n\n    for (i = 0;  i < count;  i++)\n        _glfwDestroyMonitor(monitors[i]);\n\n    free(monitors);\n}\n\nconst GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,\n                                        const GLFWvidmode* desired)\n{\n    int i;\n    unsigned int sizeDiff, leastSizeDiff = UINT_MAX;\n    unsigned int rateDiff, leastRateDiff = UINT_MAX;\n    unsigned int colorDiff, leastColorDiff = UINT_MAX;\n    const GLFWvidmode* current;\n    const GLFWvidmode* closest = NULL;\n\n    if (!refreshVideoModes(monitor))\n        return NULL;\n\n    for (i = 0;  i < monitor->modeCount;  i++)\n    {\n        current = monitor->modes + i;\n\n        colorDiff = abs((current->redBits + current->greenBits + current->blueBits) -\n                        (desired->redBits + desired->greenBits + desired->blueBits));\n\n        sizeDiff = abs((current->width - desired->width) *\n                       (current->width - desired->width) +\n                       (current->height - desired->height) *\n                       (current->height - desired->height));\n\n        if (desired->refreshRate)\n            rateDiff = abs(current->refreshRate - desired->refreshRate);\n        else\n            rateDiff = UINT_MAX - current->refreshRate;\n\n        if ((colorDiff < leastColorDiff) ||\n            (colorDiff == leastColorDiff && sizeDiff < leastSizeDiff) ||\n            (colorDiff == leastColorDiff && sizeDiff == leastSizeDiff && rateDiff < leastRateDiff))\n        {\n            closest = current;\n            leastSizeDiff = sizeDiff;\n            leastRateDiff = rateDiff;\n            leastColorDiff = colorDiff;\n        }\n    }\n\n    return closest;\n}\n\nint _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second)\n{\n    return compareVideoModes(first, second);\n}\n\nvoid _glfwSplitBPP(int bpp, int* red, int* green, int* blue)\n{\n    int delta;\n\n    // We assume that by 32 the user really meant 24\n    if (bpp == 32)\n        bpp = 24;\n\n    // Convert \"bits per pixel\" to red, green & blue sizes\n\n    *red = *green = *blue = bpp / 3;\n    delta = bpp - (*red * 3);\n    if (delta >= 1)\n        *green = *green + 1;\n\n    if (delta == 2)\n        *red = *red + 1;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI GLFWmonitor** glfwGetMonitors(int* count)\n{\n    *count = 0;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    *count = _glfw.monitorCount;\n    return (GLFWmonitor**) _glfw.monitors;\n}\n\nGLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void)\n{\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return (GLFWmonitor*) _glfw.monitors[0];\n}\n\nGLFWAPI void glfwGetMonitorPos(GLFWmonitor* handle, int* xpos, int* ypos)\n{\n    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformGetMonitorPos(monitor, xpos, ypos);\n}\n\nGLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* handle, int* width, int* height)\n{\n    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (width)\n        *width = monitor->widthMM;\n    if (height)\n        *height = monitor->heightMM;\n}\n\nGLFWAPI const char* glfwGetMonitorName(GLFWmonitor* handle)\n{\n    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return monitor->name;\n}\n\nGLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun)\n{\n    GLFWmonitorfun previous;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = _glfw.monitorCallback;\n    _glfw.monitorCallback = cbfun;\n    return previous;\n}\n\nGLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count)\n{\n    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;\n\n    *count = 0;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    if (!refreshVideoModes(monitor))\n        return NULL;\n\n    *count = monitor->modeCount;\n    return monitor->modes;\n}\n\nGLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* handle)\n{\n    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    _glfwPlatformGetVideoMode(monitor, &monitor->currentMode);\n    return &monitor->currentMode;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/nsgl_context.m",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Cocoa/NSOpenGL\n// API Version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <pthread.h>\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialize OpenGL support\n//\nint _glfwInitContextAPI(void)\n{\n    if (pthread_key_create(&_glfw.nsgl.current, NULL) != 0)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"NSOpenGL: Failed to create context TLS\");\n        return GL_FALSE;\n    }\n\n    _glfw.nsgl.framework =\n        CFBundleGetBundleWithIdentifier(CFSTR(\"com.apple.opengl\"));\n    if (_glfw.nsgl.framework == NULL)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"NSGL: Failed to locate OpenGL framework\");\n        return GL_FALSE;\n    }\n\n    return GL_TRUE;\n}\n\n// Terminate OpenGL support\n//\nvoid _glfwTerminateContextAPI(void)\n{\n    pthread_key_delete(_glfw.nsgl.current);\n}\n\n// Create the OpenGL context\n//\nint _glfwCreateContext(_GLFWwindow* window,\n                       const _GLFWwndconfig* wndconfig,\n                       const _GLFWfbconfig* fbconfig)\n{\n    unsigned int attributeCount = 0;\n\n    // Mac OS X needs non-zero color size, so set resonable values\n    int colorBits = fbconfig->redBits + fbconfig->greenBits + fbconfig->blueBits;\n    if (colorBits == 0)\n        colorBits = 24;\n    else if (colorBits < 15)\n        colorBits = 15;\n\n    if (wndconfig->clientAPI == GLFW_OPENGL_ES_API)\n    {\n        _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                        \"NSOpenGL: This API does not support OpenGL ES\");\n        return GL_FALSE;\n    }\n\n#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070\n    // Fail if any OpenGL version above 2.1 other than 3.2 was requested\n    if (wndconfig->glMajor > 3 ||\n        (wndconfig->glMajor == 3 && wndconfig->glMinor != 2))\n    {\n        _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                        \"NSOpenGL: The targeted version of Mac OS X does not \"\n                        \"support any OpenGL version above 2.1 except 3.2\");\n        return GL_FALSE;\n    }\n\n    if (wndconfig->glMajor > 2)\n    {\n        if (!wndconfig->glForward)\n        {\n            _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                            \"NSOpenGL: The targeted version of Mac OS X only \"\n                            \"supports OpenGL 3.2 contexts if they are \"\n                            \"forward-compatible\");\n            return GL_FALSE;\n        }\n\n        if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE)\n        {\n            _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                            \"NSOpenGL: The targeted version of Mac OS X only \"\n                            \"supports OpenGL 3.2 contexts if they use the \"\n                            \"core profile\");\n            return GL_FALSE;\n        }\n    }\n#else\n    // Fail if OpenGL 3.0 or above was requested\n    if (wndconfig->glMajor > 2)\n    {\n        _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                        \"NSOpenGL: The targeted version of Mac OS X does not \"\n                        \"support OpenGL version 3.0 or above\");\n        return GL_FALSE;\n    }\n#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/\n\n    // Fail if a robustness strategy was requested\n    if (wndconfig->glRobustness)\n    {\n        _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                        \"NSOpenGL: Mac OS X does not support OpenGL robustness \"\n                        \"strategies\");\n        return GL_FALSE;\n    }\n\n#define ADD_ATTR(x) { attributes[attributeCount++] = x; }\n#define ADD_ATTR2(x, y) { ADD_ATTR(x); ADD_ATTR(y); }\n\n    // Arbitrary array size here\n    NSOpenGLPixelFormatAttribute attributes[40];\n\n    ADD_ATTR(NSOpenGLPFADoubleBuffer);\n    ADD_ATTR(NSOpenGLPFAClosestPolicy);\n\n#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070\n    if (wndconfig->glMajor > 2)\n        ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core);\n#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/\n\n    ADD_ATTR2(NSOpenGLPFAColorSize, colorBits);\n\n    if (fbconfig->alphaBits > 0)\n        ADD_ATTR2(NSOpenGLPFAAlphaSize, fbconfig->alphaBits);\n\n    if (fbconfig->depthBits > 0)\n        ADD_ATTR2(NSOpenGLPFADepthSize, fbconfig->depthBits);\n\n    if (fbconfig->stencilBits > 0)\n        ADD_ATTR2(NSOpenGLPFAStencilSize, fbconfig->stencilBits);\n\n    int accumBits = fbconfig->accumRedBits + fbconfig->accumGreenBits +\n                    fbconfig->accumBlueBits + fbconfig->accumAlphaBits;\n\n    if (accumBits > 0)\n        ADD_ATTR2(NSOpenGLPFAAccumSize, accumBits);\n\n    if (fbconfig->auxBuffers > 0)\n        ADD_ATTR2(NSOpenGLPFAAuxBuffers, fbconfig->auxBuffers);\n\n    if (fbconfig->stereo)\n        ADD_ATTR(NSOpenGLPFAStereo);\n\n    if (fbconfig->samples > 0)\n    {\n        ADD_ATTR2(NSOpenGLPFASampleBuffers, 1);\n        ADD_ATTR2(NSOpenGLPFASamples, fbconfig->samples);\n    }\n\n    // NOTE: All NSOpenGLPixelFormats on the relevant cards support sRGB\n    // frambuffer, so there's no need (and no way) to request it\n\n    ADD_ATTR(0);\n\n#undef ADD_ATTR\n#undef ADD_ATTR2\n\n    window->nsgl.pixelFormat =\n        [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];\n    if (window->nsgl.pixelFormat == nil)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"NSOpenGL: Failed to create OpenGL pixel format\");\n        return GL_FALSE;\n    }\n\n    NSOpenGLContext* share = NULL;\n\n    if (wndconfig->share)\n        share = wndconfig->share->nsgl.context;\n\n    window->nsgl.context =\n        [[NSOpenGLContext alloc] initWithFormat:window->nsgl.pixelFormat\n                                   shareContext:share];\n    if (window->nsgl.context == nil)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"NSOpenGL: Failed to create OpenGL context\");\n        return GL_FALSE;\n    }\n\n    return GL_TRUE;\n}\n\n// Destroy the OpenGL context\n//\nvoid _glfwDestroyContext(_GLFWwindow* window)\n{\n    [window->nsgl.pixelFormat release];\n    window->nsgl.pixelFormat = nil;\n\n    [window->nsgl.context release];\n    window->nsgl.context = nil;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformMakeContextCurrent(_GLFWwindow* window)\n{\n    if (window)\n        [window->nsgl.context makeCurrentContext];\n    else\n        [NSOpenGLContext clearCurrentContext];\n\n    pthread_setspecific(_glfw.nsgl.current, window);\n}\n\n_GLFWwindow* _glfwPlatformGetCurrentContext(void)\n{\n    return (_GLFWwindow*) pthread_getspecific(_glfw.nsgl.current);\n}\n\nvoid _glfwPlatformSwapBuffers(_GLFWwindow* window)\n{\n    // ARP appears to be unnecessary, but this is future-proof\n    [window->nsgl.context flushBuffer];\n}\n\nvoid _glfwPlatformSwapInterval(int interval)\n{\n    _GLFWwindow* window = _glfwPlatformGetCurrentContext();\n\n    GLint sync = interval;\n    [window->nsgl.context setValues:&sync forParameter:NSOpenGLCPSwapInterval];\n}\n\nint _glfwPlatformExtensionSupported(const char* extension)\n{\n    // There are no NSGL extensions\n    return GL_FALSE;\n}\n\nGLFWglproc _glfwPlatformGetProcAddress(const char* procname)\n{\n    CFStringRef symbolName = CFStringCreateWithCString(kCFAllocatorDefault,\n                                                       procname,\n                                                       kCFStringEncodingASCII);\n\n    GLFWglproc symbol = CFBundleGetFunctionPointerForName(_glfw.nsgl.framework,\n                                                          symbolName);\n\n    CFRelease(symbolName);\n\n    return symbol;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW native API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI id glfwGetNSGLContext(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(nil);\n    return window->nsgl.context;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/nsgl_platform.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    NSOpenGL\n// API Version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#ifndef _nsgl_platform_h_\n#define _nsgl_platform_h_\n\n\n#define _GLFW_PLATFORM_FBCONFIG\n#define _GLFW_PLATFORM_CONTEXT_STATE        _GLFWcontextNSGL nsgl\n#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryNSGL nsgl\n\n\n//========================================================================\n// GLFW platform specific types\n//========================================================================\n\n//------------------------------------------------------------------------\n// Platform-specific OpenGL context structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWcontextNSGL\n{\n    id           pixelFormat;\n    id\t         context;\n} _GLFWcontextNSGL;\n\n\n//------------------------------------------------------------------------\n// Platform-specific library global data for NSGL\n//------------------------------------------------------------------------\ntypedef struct _GLFWlibraryNSGL\n{\n    // dlopen handle for dynamically loading OpenGL extension entry points\n    void*           framework;\n\n    // TLS key for per-thread current context/window\n    pthread_key_t   current;\n\n} _GLFWlibraryNSGL;\n\n\n#endif // _nsgl_platform_h_\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/time.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI double glfwGetTime(void)\n{\n    _GLFW_REQUIRE_INIT_OR_RETURN(0.0);\n    return _glfwPlatformGetTime();\n}\n\nGLFWAPI void glfwSetTime(double time)\n{\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformSetTime(time);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/wgl_context.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Win32/WGL\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdlib.h>\n#include <malloc.h>\n#include <assert.h>\n\n\n// Initialize WGL-specific extensions\n// This function is called once before initial context creation, i.e. before\n// any WGL extensions could be present.  This is done in order to have both\n// extension variable clearing and loading in the same place, hopefully\n// decreasing the possibility of forgetting to add one without the other.\n//\nstatic void initWGLExtensions(_GLFWwindow* window)\n{\n    // This needs to include every function pointer loaded below\n    window->wgl.SwapIntervalEXT = NULL;\n    window->wgl.GetPixelFormatAttribivARB = NULL;\n    window->wgl.GetExtensionsStringARB = NULL;\n    window->wgl.GetExtensionsStringEXT = NULL;\n    window->wgl.CreateContextAttribsARB = NULL;\n\n    // This needs to include every extension used below except for\n    // WGL_ARB_extensions_string and WGL_EXT_extensions_string\n    window->wgl.ARB_multisample = GL_FALSE;\n    window->wgl.ARB_framebuffer_sRGB = GL_FALSE;\n    window->wgl.ARB_create_context = GL_FALSE;\n    window->wgl.ARB_create_context_profile = GL_FALSE;\n    window->wgl.EXT_create_context_es2_profile = GL_FALSE;\n    window->wgl.ARB_create_context_robustness = GL_FALSE;\n    window->wgl.EXT_swap_control = GL_FALSE;\n    window->wgl.ARB_pixel_format = GL_FALSE;\n\n    window->wgl.GetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)\n        wglGetProcAddress(\"wglGetExtensionsStringEXT\");\n    if (!window->wgl.GetExtensionsStringEXT)\n    {\n        window->wgl.GetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)\n            wglGetProcAddress(\"wglGetExtensionsStringARB\");\n        if (!window->wgl.GetExtensionsStringARB)\n            return;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"WGL_ARB_multisample\"))\n        window->wgl.ARB_multisample = GL_TRUE;\n\n    if (_glfwPlatformExtensionSupported(\"WGL_ARB_framebuffer_sRGB\"))\n        window->wgl.ARB_framebuffer_sRGB = GL_TRUE;\n\n    if (_glfwPlatformExtensionSupported(\"WGL_ARB_create_context\"))\n    {\n        window->wgl.CreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)\n            wglGetProcAddress(\"wglCreateContextAttribsARB\");\n\n        if (window->wgl.CreateContextAttribsARB)\n            window->wgl.ARB_create_context = GL_TRUE;\n    }\n\n    if (window->wgl.ARB_create_context)\n    {\n        if (_glfwPlatformExtensionSupported(\"WGL_ARB_create_context_profile\"))\n            window->wgl.ARB_create_context_profile = GL_TRUE;\n    }\n\n    if (window->wgl.ARB_create_context &&\n        window->wgl.ARB_create_context_profile)\n    {\n        if (_glfwPlatformExtensionSupported(\"WGL_EXT_create_context_es2_profile\"))\n            window->wgl.EXT_create_context_es2_profile = GL_TRUE;\n    }\n\n    if (window->wgl.ARB_create_context)\n    {\n        if (_glfwPlatformExtensionSupported(\"WGL_ARB_create_context_robustness\"))\n            window->wgl.ARB_create_context_robustness = GL_TRUE;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"WGL_EXT_swap_control\"))\n    {\n        window->wgl.SwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)\n            wglGetProcAddress(\"wglSwapIntervalEXT\");\n\n        if (window->wgl.SwapIntervalEXT)\n            window->wgl.EXT_swap_control = GL_TRUE;\n    }\n\n    if (_glfwPlatformExtensionSupported(\"WGL_ARB_pixel_format\"))\n    {\n        window->wgl.GetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)\n            wglGetProcAddress(\"wglGetPixelFormatAttribivARB\");\n\n        if (window->wgl.GetPixelFormatAttribivARB)\n            window->wgl.ARB_pixel_format = GL_TRUE;\n    }\n}\n\n// Returns the specified attribute of the specified pixel format\n// NOTE: Do not call this unless we have found WGL_ARB_pixel_format\n//\nstatic int getPixelFormatAttrib(_GLFWwindow* window, int pixelFormat, int attrib)\n{\n    int value = 0;\n\n    if (!window->wgl.GetPixelFormatAttribivARB(window->wgl.dc,\n                                               pixelFormat,\n                                               0, 1, &attrib, &value))\n    {\n        // NOTE: We should probably handle this error somehow\n        return 0;\n    }\n\n    return value;\n}\n\n// Return a list of available and usable framebuffer configs\n//\nstatic GLboolean choosePixelFormat(_GLFWwindow* window,\n                                   const _GLFWfbconfig* desired,\n                                   int* result)\n{\n    _GLFWfbconfig* usableConfigs;\n    const _GLFWfbconfig* closest;\n    int i, nativeCount, usableCount;\n\n    if (window->wgl.ARB_pixel_format)\n    {\n        nativeCount = getPixelFormatAttrib(window,\n                                         1,\n                                         WGL_NUMBER_PIXEL_FORMATS_ARB);\n    }\n    else\n    {\n        nativeCount = DescribePixelFormat(window->wgl.dc,\n                                          1,\n                                          sizeof(PIXELFORMATDESCRIPTOR),\n                                          NULL);\n    }\n\n    if (!nativeCount)\n    {\n        _glfwInputError(GLFW_API_UNAVAILABLE, \"WGL: No pixel formats found\");\n        return GL_FALSE;\n    }\n\n    usableConfigs = (_GLFWfbconfig*) calloc(nativeCount, sizeof(_GLFWfbconfig));\n    usableCount = 0;\n\n    for (i = 0;  i < nativeCount;  i++)\n    {\n        const int n = i + 1;\n        _GLFWfbconfig* u = usableConfigs + usableCount;\n\n        if (window->wgl.ARB_pixel_format)\n        {\n            // Get pixel format attributes through WGL_ARB_pixel_format\n            if (!getPixelFormatAttrib(window, n, WGL_SUPPORT_OPENGL_ARB) ||\n                !getPixelFormatAttrib(window, n, WGL_DRAW_TO_WINDOW_ARB) ||\n                !getPixelFormatAttrib(window, n, WGL_DOUBLE_BUFFER_ARB))\n            {\n                continue;\n            }\n\n            if (getPixelFormatAttrib(window, n, WGL_PIXEL_TYPE_ARB) !=\n                WGL_TYPE_RGBA_ARB)\n            {\n                continue;\n            }\n\n            if (getPixelFormatAttrib(window, n, WGL_ACCELERATION_ARB) ==\n                 WGL_NO_ACCELERATION_ARB)\n            {\n                continue;\n            }\n\n            u->redBits = getPixelFormatAttrib(window, n, WGL_RED_BITS_ARB);\n            u->greenBits = getPixelFormatAttrib(window, n, WGL_GREEN_BITS_ARB);\n            u->blueBits = getPixelFormatAttrib(window, n, WGL_BLUE_BITS_ARB);\n            u->alphaBits = getPixelFormatAttrib(window, n, WGL_ALPHA_BITS_ARB);\n\n            u->depthBits = getPixelFormatAttrib(window, n, WGL_DEPTH_BITS_ARB);\n            u->stencilBits = getPixelFormatAttrib(window, n, WGL_STENCIL_BITS_ARB);\n\n            u->accumRedBits = getPixelFormatAttrib(window, n, WGL_ACCUM_RED_BITS_ARB);\n            u->accumGreenBits = getPixelFormatAttrib(window, n, WGL_ACCUM_GREEN_BITS_ARB);\n            u->accumBlueBits = getPixelFormatAttrib(window, n, WGL_ACCUM_BLUE_BITS_ARB);\n            u->accumAlphaBits = getPixelFormatAttrib(window, n, WGL_ACCUM_ALPHA_BITS_ARB);\n\n            u->auxBuffers = getPixelFormatAttrib(window, n, WGL_AUX_BUFFERS_ARB);\n            u->stereo = getPixelFormatAttrib(window, n, WGL_STEREO_ARB);\n\n            if (window->wgl.ARB_multisample)\n                u->samples = getPixelFormatAttrib(window, n, WGL_SAMPLES_ARB);\n\n            if (window->wgl.ARB_framebuffer_sRGB)\n                u->sRGB = getPixelFormatAttrib(window, n, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB);\n        }\n        else\n        {\n            PIXELFORMATDESCRIPTOR pfd;\n\n            // Get pixel format attributes through old-fashioned PFDs\n\n            if (!DescribePixelFormat(window->wgl.dc,\n                                     n,\n                                     sizeof(PIXELFORMATDESCRIPTOR),\n                                     &pfd))\n            {\n                continue;\n            }\n\n            if (!(pfd.dwFlags & PFD_DRAW_TO_WINDOW) ||\n                !(pfd.dwFlags & PFD_SUPPORT_OPENGL) ||\n                !(pfd.dwFlags & PFD_DOUBLEBUFFER))\n            {\n                continue;\n            }\n\n            if (!(pfd.dwFlags & PFD_GENERIC_ACCELERATED) &&\n                (pfd.dwFlags & PFD_GENERIC_FORMAT))\n            {\n                continue;\n            }\n\n            if (pfd.iPixelType != PFD_TYPE_RGBA)\n                continue;\n\n            u->redBits = pfd.cRedBits;\n            u->greenBits = pfd.cGreenBits;\n            u->blueBits = pfd.cBlueBits;\n            u->alphaBits = pfd.cAlphaBits;\n\n            u->depthBits = pfd.cDepthBits;\n            u->stencilBits = pfd.cStencilBits;\n\n            u->accumRedBits = pfd.cAccumRedBits;\n            u->accumGreenBits = pfd.cAccumGreenBits;\n            u->accumBlueBits = pfd.cAccumBlueBits;\n            u->accumAlphaBits = pfd.cAccumAlphaBits;\n\n            u->auxBuffers = pfd.cAuxBuffers;\n            u->stereo = (pfd.dwFlags & PFD_STEREO) ? GL_TRUE : GL_FALSE;\n        }\n\n        u->wgl = n;\n        usableCount++;\n    }\n\n    closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);\n    if (!closest)\n    {\n        free(usableConfigs);\n        return GL_FALSE;\n    }\n\n    *result = closest->wgl;\n    free(usableConfigs);\n\n    return GL_TRUE;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialize WGL\n//\nint _glfwInitContextAPI(void)\n{\n    _glfw.wgl.current = TlsAlloc();\n    if (_glfw.wgl.current == TLS_OUT_OF_INDEXES)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"WGL: Failed to allocate TLS index\");\n        return GL_FALSE;\n    }\n\n    _glfw.wgl.hasTLS = GL_TRUE;\n\n    return GL_TRUE;\n}\n\n// Terminate WGL\n//\nvoid _glfwTerminateContextAPI(void)\n{\n    if (_glfw.wgl.hasTLS)\n        TlsFree(_glfw.wgl.current);\n}\n\n#define setWGLattrib(attribName, attribValue) \\\n{ \\\n    attribs[index++] = attribName; \\\n    attribs[index++] = attribValue; \\\n    assert(index < sizeof(attribs) / sizeof(attribs[0])); \\\n}\n\n// Prepare for creation of the OpenGL context\n//\nint _glfwCreateContext(_GLFWwindow* window,\n                       const _GLFWwndconfig* wndconfig,\n                       const _GLFWfbconfig* fbconfig)\n{\n    int attribs[40];\n    int pixelFormat = 0;\n    PIXELFORMATDESCRIPTOR pfd;\n    HGLRC share = NULL;\n\n    if (wndconfig->share)\n        share = wndconfig->share->wgl.context;\n\n    window->wgl.dc = GetDC(window->win32.handle);\n    if (!window->wgl.dc)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to retrieve DC for window\");\n        return GL_FALSE;\n    }\n\n    if (!choosePixelFormat(window, fbconfig, &pixelFormat))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"WGL: Failed to find a suitable pixel format\");\n        return GL_FALSE;\n    }\n\n    if (!DescribePixelFormat(window->wgl.dc, pixelFormat, sizeof(pfd), &pfd))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to retrieve PFD for selected pixel \"\n                        \"format\");\n        return GL_FALSE;\n    }\n\n    if (!SetPixelFormat(window->wgl.dc, pixelFormat, &pfd))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to set selected pixel format\");\n        return GL_FALSE;\n    }\n\n    if (window->wgl.ARB_create_context)\n    {\n        int index = 0, mask = 0, flags = 0, strategy = 0;\n\n        if (wndconfig->clientAPI == GLFW_OPENGL_API)\n        {\n            if (wndconfig->glForward)\n                flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;\n\n            if (wndconfig->glDebug)\n                flags |= WGL_CONTEXT_DEBUG_BIT_ARB;\n\n            if (wndconfig->glProfile)\n            {\n                if (wndconfig->glProfile == GLFW_OPENGL_CORE_PROFILE)\n                    mask |= WGL_CONTEXT_CORE_PROFILE_BIT_ARB;\n                else if (wndconfig->glProfile == GLFW_OPENGL_COMPAT_PROFILE)\n                    mask |= WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;\n            }\n        }\n        else\n            mask |= WGL_CONTEXT_ES2_PROFILE_BIT_EXT;\n\n        if (wndconfig->glRobustness)\n        {\n            if (window->wgl.ARB_create_context_robustness)\n            {\n                if (wndconfig->glRobustness == GLFW_NO_RESET_NOTIFICATION)\n                    strategy = WGL_NO_RESET_NOTIFICATION_ARB;\n                else if (wndconfig->glRobustness == GLFW_LOSE_CONTEXT_ON_RESET)\n                    strategy = WGL_LOSE_CONTEXT_ON_RESET_ARB;\n\n                flags |= WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB;\n            }\n        }\n\n        if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0)\n        {\n            setWGLattrib(WGL_CONTEXT_MAJOR_VERSION_ARB, wndconfig->glMajor);\n            setWGLattrib(WGL_CONTEXT_MINOR_VERSION_ARB, wndconfig->glMinor);\n        }\n\n        if (flags)\n            setWGLattrib(WGL_CONTEXT_FLAGS_ARB, flags);\n\n        if (mask)\n            setWGLattrib(WGL_CONTEXT_PROFILE_MASK_ARB, mask);\n\n        if (strategy)\n            setWGLattrib(WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB, strategy);\n\n        setWGLattrib(0, 0);\n\n        window->wgl.context = window->wgl.CreateContextAttribsARB(window->wgl.dc,\n                                                                  share,\n                                                                  attribs);\n        if (!window->wgl.context)\n        {\n            _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                            \"WGL: Failed to create OpenGL context\");\n            return GL_FALSE;\n        }\n    }\n    else\n    {\n        window->wgl.context = wglCreateContext(window->wgl.dc);\n        if (!window->wgl.context)\n        {\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"WGL: Failed to create OpenGL context\");\n            return GL_FALSE;\n        }\n\n        if (share)\n        {\n            if (!wglShareLists(share, window->wgl.context))\n            {\n                _glfwInputError(GLFW_PLATFORM_ERROR,\n                                \"WGL: Failed to enable sharing with specified \"\n                                \"OpenGL context\");\n                return GL_FALSE;\n            }\n        }\n    }\n\n    _glfwPlatformMakeContextCurrent(window);\n    initWGLExtensions(window);\n\n    return GL_TRUE;\n}\n\n#undef setWGLattrib\n\n// Destroy the OpenGL context\n//\nvoid _glfwDestroyContext(_GLFWwindow* window)\n{\n    if (window->wgl.context)\n    {\n        wglDeleteContext(window->wgl.context);\n        window->wgl.context = NULL;\n    }\n\n    if (window->wgl.dc)\n    {\n        ReleaseDC(window->win32.handle, window->wgl.dc);\n        window->wgl.dc = NULL;\n    }\n}\n\n// Analyzes the specified context for possible recreation\n//\nint _glfwAnalyzeContext(const _GLFWwindow* window,\n                        const _GLFWwndconfig* wndconfig,\n                        const _GLFWfbconfig* fbconfig)\n{\n    GLboolean required = GL_FALSE;\n\n    if (wndconfig->clientAPI == GLFW_OPENGL_API)\n    {\n        if (wndconfig->glForward)\n        {\n            if (!window->wgl.ARB_create_context)\n            {\n                _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                                \"WGL: A forward compatible OpenGL context \"\n                                \"requested but WGL_ARB_create_context is \"\n                                \"unavailable\");\n                return _GLFW_RECREATION_IMPOSSIBLE;\n            }\n\n            required = GL_TRUE;\n        }\n\n        if (wndconfig->glProfile)\n        {\n            if (!window->wgl.ARB_create_context_profile)\n            {\n                _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                                \"WGL: OpenGL profile requested but \"\n                                \"WGL_ARB_create_context_profile is unavailable\");\n                return _GLFW_RECREATION_IMPOSSIBLE;\n            }\n\n            required = GL_TRUE;\n        }\n    }\n    else\n    {\n        if (!window->wgl.ARB_create_context ||\n            !window->wgl.ARB_create_context_profile ||\n            !window->wgl.EXT_create_context_es2_profile)\n        {\n            _glfwInputError(GLFW_VERSION_UNAVAILABLE,\n                            \"WGL: OpenGL ES requested but \"\n                            \"WGL_ARB_create_context_es2_profile is unavailable\");\n            return _GLFW_RECREATION_IMPOSSIBLE;\n        }\n\n        required = GL_TRUE;\n    }\n\n    if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0)\n    {\n        if (window->wgl.ARB_create_context)\n            required = GL_TRUE;\n    }\n\n    if (wndconfig->glDebug)\n    {\n        if (window->wgl.ARB_create_context)\n            required = GL_TRUE;\n    }\n\n    if (fbconfig->samples > 0)\n    {\n        // We want FSAA, but can we get it?\n        // FSAA is not a hard constraint, so otherwise we just don't care\n\n        if (window->wgl.ARB_multisample && window->wgl.ARB_pixel_format)\n        {\n            // We appear to have both the extension and the means to ask for it\n            required = GL_TRUE;\n        }\n    }\n\n    if (required)\n        return _GLFW_RECREATION_REQUIRED;\n\n    return _GLFW_RECREATION_NOT_NEEDED;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformMakeContextCurrent(_GLFWwindow* window)\n{\n    if (window)\n        wglMakeCurrent(window->wgl.dc, window->wgl.context);\n    else\n        wglMakeCurrent(NULL, NULL);\n\n    TlsSetValue(_glfw.wgl.current, window);\n}\n\n_GLFWwindow* _glfwPlatformGetCurrentContext(void)\n{\n    return TlsGetValue(_glfw.wgl.current);\n}\n\nvoid _glfwPlatformSwapBuffers(_GLFWwindow* window)\n{\n    SwapBuffers(window->wgl.dc);\n}\n\nvoid _glfwPlatformSwapInterval(int interval)\n{\n    _GLFWwindow* window = _glfwPlatformGetCurrentContext();\n\n    if (_glfwIsCompositionEnabled())\n    {\n        // Don't enabled vsync when desktop compositing is enabled, as it leads\n        // to frame jitter\n        return;\n    }\n\n    if (window->wgl.EXT_swap_control)\n        window->wgl.SwapIntervalEXT(interval);\n}\n\nint _glfwPlatformExtensionSupported(const char* extension)\n{\n    const GLubyte* extensions;\n\n    _GLFWwindow* window = _glfwPlatformGetCurrentContext();\n\n    if (window->wgl.GetExtensionsStringEXT != NULL)\n    {\n        extensions = (GLubyte*) window->wgl.GetExtensionsStringEXT();\n        if (extensions != NULL)\n        {\n            if (_glfwStringInExtensionString(extension, extensions))\n                return GL_TRUE;\n        }\n    }\n\n    if (window->wgl.GetExtensionsStringARB != NULL)\n    {\n        extensions = (GLubyte*) window->wgl.GetExtensionsStringARB(window->wgl.dc);\n        if (extensions != NULL)\n        {\n            if (_glfwStringInExtensionString(extension, extensions))\n                return GL_TRUE;\n        }\n    }\n\n    return GL_FALSE;\n}\n\nGLFWglproc _glfwPlatformGetProcAddress(const char* procname)\n{\n    return (GLFWglproc) wglGetProcAddress(procname);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW native API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return window->wgl.context;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/wgl_platform.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    WGL\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#ifndef _wgl_platform_h_\n#define _wgl_platform_h_\n\n// This path may need to be changed if you build GLFW using your own setup\n// We ship and use our own copy of wglext.h since GLFW uses fairly new\n// extensions and not all operating systems come with an up-to-date version\n#include \"../deps/GL/wglext.h\"\n\n\n#define _GLFW_PLATFORM_FBCONFIG             int             wgl\n#define _GLFW_PLATFORM_CONTEXT_STATE        _GLFWcontextWGL wgl\n#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryWGL wgl\n\n\n//========================================================================\n// GLFW platform specific types\n//========================================================================\n\n//------------------------------------------------------------------------\n// Platform-specific OpenGL context structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWcontextWGL\n{\n    // Platform specific window resources\n    HDC       dc;              // Private GDI device context\n    HGLRC     context;         // Permanent rendering context\n\n    // Platform specific extensions (context specific)\n    PFNWGLSWAPINTERVALEXTPROC           SwapIntervalEXT;\n    PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB;\n    PFNWGLGETEXTENSIONSSTRINGEXTPROC    GetExtensionsStringEXT;\n    PFNWGLGETEXTENSIONSSTRINGARBPROC    GetExtensionsStringARB;\n    PFNWGLCREATECONTEXTATTRIBSARBPROC   CreateContextAttribsARB;\n    GLboolean                           EXT_swap_control;\n    GLboolean                           ARB_multisample;\n    GLboolean                           ARB_framebuffer_sRGB;\n    GLboolean                           ARB_pixel_format;\n    GLboolean                           ARB_create_context;\n    GLboolean                           ARB_create_context_profile;\n    GLboolean                           EXT_create_context_es2_profile;\n    GLboolean                           ARB_create_context_robustness;\n} _GLFWcontextWGL;\n\n\n//------------------------------------------------------------------------\n// Platform-specific library global data for WGL\n//------------------------------------------------------------------------\ntypedef struct _GLFWlibraryWGL\n{\n    GLboolean   hasTLS;\n    DWORD       current;\n\n} _GLFWlibraryWGL;\n\n\n#endif // _wgl_platform_h_\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/win32_clipboard.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Win32\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <limits.h>\n#include <string.h>\n#include <stdlib.h>\n#include <malloc.h>\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)\n{\n    WCHAR* wideString;\n    HANDLE stringHandle;\n    size_t wideSize;\n\n    wideString = _glfwCreateWideStringFromUTF8(string);\n    if (!wideString)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to convert clipboard string to \"\n                        \"wide string\");\n        return;\n    }\n\n    wideSize = (wcslen(wideString) + 1) * sizeof(WCHAR);\n\n    stringHandle = GlobalAlloc(GMEM_MOVEABLE, wideSize);\n    if (!stringHandle)\n    {\n        free(wideString);\n\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to allocate global handle for clipboard\");\n        return;\n    }\n\n    memcpy(GlobalLock(stringHandle), wideString, wideSize);\n    GlobalUnlock(stringHandle);\n\n    if (!OpenClipboard(window->win32.handle))\n    {\n        GlobalFree(stringHandle);\n        free(wideString);\n\n        _glfwInputError(GLFW_PLATFORM_ERROR, \"Win32: Failed to open clipboard\");\n        return;\n    }\n\n    EmptyClipboard();\n    SetClipboardData(CF_UNICODETEXT, stringHandle);\n    CloseClipboard();\n\n    free(wideString);\n}\n\nconst char* _glfwPlatformGetClipboardString(_GLFWwindow* window)\n{\n    HANDLE stringHandle;\n\n    if (!IsClipboardFormatAvailable(CF_UNICODETEXT))\n    {\n        _glfwInputError(GLFW_FORMAT_UNAVAILABLE, NULL);\n        return NULL;\n    }\n\n    if (!OpenClipboard(window->win32.handle))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR, \"Win32: Failed to open clipboard\");\n        return NULL;\n    }\n\n    stringHandle = GetClipboardData(CF_UNICODETEXT);\n    if (!stringHandle)\n    {\n        CloseClipboard();\n\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to retrieve clipboard data\");\n        return NULL;\n    }\n\n    free(_glfw.win32.clipboardString);\n    _glfw.win32.clipboardString =\n        _glfwCreateUTF8FromWideString(GlobalLock(stringHandle));\n\n    GlobalUnlock(stringHandle);\n    CloseClipboard();\n\n    if (!_glfw.win32.clipboardString)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to convert wide string to UTF-8\");\n        return NULL;\n    }\n\n    return _glfw.win32.clipboardString;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/win32_gamma.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Win32\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <limits.h>\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)\n{\n    HDC dc;\n    WORD values[768];\n    DISPLAY_DEVICE display;\n\n    ZeroMemory(&display, sizeof(DISPLAY_DEVICE));\n    display.cb = sizeof(DISPLAY_DEVICE);\n    EnumDisplayDevices(monitor->win32.name, 0, &display, 0);\n\n    dc = CreateDC(L\"DISPLAY\", display.DeviceString, NULL, NULL);\n    GetDeviceGammaRamp(dc, values);\n    DeleteDC(dc);\n\n    _glfwAllocGammaRamp(ramp, 256);\n\n    memcpy(ramp->red,   values +   0, 256 * sizeof(unsigned short));\n    memcpy(ramp->green, values + 256, 256 * sizeof(unsigned short));\n    memcpy(ramp->blue,  values + 512, 256 * sizeof(unsigned short));\n}\n\nvoid _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)\n{\n    HDC dc;\n    WORD values[768];\n    DISPLAY_DEVICE display;\n\n    if (ramp->size != 256)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Gamma ramp size must be 256\");\n        return;\n    }\n\n    memcpy(values +   0, ramp->red,   256 * sizeof(unsigned short));\n    memcpy(values + 256, ramp->green, 256 * sizeof(unsigned short));\n    memcpy(values + 512, ramp->blue,  256 * sizeof(unsigned short));\n\n    ZeroMemory(&display, sizeof(DISPLAY_DEVICE));\n    display.cb = sizeof(DISPLAY_DEVICE);\n    EnumDisplayDevices(monitor->win32.name, 0, &display, 0);\n\n    dc = CreateDC(L\"DISPLAY\", display.DeviceString, NULL, NULL);\n    SetDeviceGammaRamp(dc, values);\n    DeleteDC(dc);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/win32_init.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Win32/WGL\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdlib.h>\n#include <malloc.h>\n\n#ifdef __BORLANDC__\n// With the Borland C++ compiler, we want to disable FPU exceptions\n#include <float.h>\n#endif // __BORLANDC__\n\n\n#if defined(_GLFW_BUILD_DLL)\n\n// GLFW DLL entry point\n//\nBOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)\n{\n    return TRUE;\n}\n\n#endif // _GLFW_BUILD_DLL\n\n// Load necessary libraries (DLLs)\n//\nstatic GLboolean initLibraries(void)\n{\n#ifndef _GLFW_NO_DLOAD_WINMM\n    // winmm.dll (for joystick and timer support)\n\n    _glfw.win32.winmm.instance = LoadLibrary(L\"winmm.dll\");\n    if (!_glfw.win32.winmm.instance)\n        return GL_FALSE;\n\n    _glfw.win32.winmm.joyGetDevCaps = (JOYGETDEVCAPS_T)\n        GetProcAddress(_glfw.win32.winmm.instance, \"joyGetDevCapsW\");\n    _glfw.win32.winmm.joyGetPos = (JOYGETPOS_T)\n        GetProcAddress(_glfw.win32.winmm.instance, \"joyGetPos\");\n    _glfw.win32.winmm.joyGetPosEx = (JOYGETPOSEX_T)\n        GetProcAddress(_glfw.win32.winmm.instance, \"joyGetPosEx\");\n    _glfw.win32.winmm.timeGetTime = (TIMEGETTIME_T)\n        GetProcAddress(_glfw.win32.winmm.instance, \"timeGetTime\");\n\n    if (!_glfw.win32.winmm.joyGetDevCaps ||\n        !_glfw.win32.winmm.joyGetPos ||\n        !_glfw.win32.winmm.joyGetPosEx ||\n        !_glfw.win32.winmm.timeGetTime)\n    {\n        return GL_FALSE;\n    }\n#endif // _GLFW_NO_DLOAD_WINMM\n\n    _glfw.win32.user32.instance = LoadLibrary(L\"user32.dll\");\n    if (_glfw.win32.user32.instance)\n    {\n        _glfw.win32.user32.SetProcessDPIAware = (SETPROCESSDPIAWARE_T)\n            GetProcAddress(_glfw.win32.user32.instance, \"SetProcessDPIAware\");\n    }\n\n    _glfw.win32.dwmapi.instance = LoadLibrary(L\"dwmapi.dll\");\n    if (_glfw.win32.dwmapi.instance)\n    {\n        _glfw.win32.dwmapi.DwmIsCompositionEnabled = (DWMISCOMPOSITIONENABLED_T)\n            GetProcAddress(_glfw.win32.dwmapi.instance, \"DwmIsCompositionEnabled\");\n    }\n\n    return GL_TRUE;\n}\n\n// Unload used libraries (DLLs)\n//\nstatic void freeLibraries(void)\n{\n#ifndef _GLFW_NO_DLOAD_WINMM\n    if (_glfw.win32.winmm.instance != NULL)\n    {\n        FreeLibrary(_glfw.win32.winmm.instance);\n        _glfw.win32.winmm.instance = NULL;\n    }\n#endif // _GLFW_NO_DLOAD_WINMM\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Returns whether desktop compositing is enabled\n//\nBOOL _glfwIsCompositionEnabled(void)\n{\n    BOOL enabled;\n\n    if (!_glfw_DwmIsCompositionEnabled)\n        return FALSE;\n\n    if (_glfw_DwmIsCompositionEnabled(&enabled) != S_OK)\n        return FALSE;\n\n    return enabled;\n}\n\n// Returns a wide string version of the specified UTF-8 string\n//\nWCHAR* _glfwCreateWideStringFromUTF8(const char* source)\n{\n    WCHAR* target;\n    int length;\n\n    length = MultiByteToWideChar(CP_UTF8, 0, source, -1, NULL, 0);\n    if (!length)\n        return NULL;\n\n    target = (WCHAR*) malloc(sizeof(WCHAR) * (length + 1));\n\n    if (!MultiByteToWideChar(CP_UTF8, 0, source, -1, target, length + 1))\n    {\n        free(target);\n        return NULL;\n    }\n\n    return target;\n}\n\n// Returns a UTF-8 string version of the specified wide string\n//\nchar* _glfwCreateUTF8FromWideString(const WCHAR* source)\n{\n    char* target;\n    int length;\n\n    length = WideCharToMultiByte(CP_UTF8, 0, source, -1, NULL, 0, NULL, NULL);\n    if (!length)\n        return NULL;\n\n    target = (char*) malloc(length + 1);\n\n    if (!WideCharToMultiByte(CP_UTF8, 0, source, -1, target, length + 1, NULL, NULL))\n    {\n        free(target);\n        return NULL;\n    }\n\n    return target;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformInit(void)\n{\n    // To make SetForegroundWindow work as we want, we need to fiddle\n    // with the FOREGROUNDLOCKTIMEOUT system setting (we do this as early\n    // as possible in the hope of still being the foreground process)\n    SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0,\n                         &_glfw.win32.foregroundLockTimeout, 0);\n    SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, UIntToPtr(0),\n                         SPIF_SENDCHANGE);\n\n    if (!initLibraries())\n        return GL_FALSE;\n\n    if (_glfw_SetProcessDPIAware)\n        _glfw_SetProcessDPIAware();\n\n#ifdef __BORLANDC__\n    // With the Borland C++ compiler, we want to disable FPU exceptions\n    // (this is recommended for OpenGL applications under Windows)\n    _control87(MCW_EM, MCW_EM);\n#endif\n\n    if (!_glfwInitContextAPI())\n        return GL_FALSE;\n\n    _glfwInitTimer();\n\n    _glfwInitJoysticks();\n\n    return GL_TRUE;\n}\n\nvoid _glfwPlatformTerminate(void)\n{\n    if (_glfw.win32.classAtom)\n    {\n        UnregisterClass(_GLFW_WNDCLASSNAME, GetModuleHandle(NULL));\n        _glfw.win32.classAtom = 0;\n    }\n\n    _glfwTerminateContextAPI();\n\n    _glfwTerminateJoysticks();\n\n    freeLibraries();\n\n    // Restore previous FOREGROUNDLOCKTIMEOUT system setting\n    SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0,\n                         UIntToPtr(_glfw.win32.foregroundLockTimeout),\n                         SPIF_SENDCHANGE);\n}\n\nconst char* _glfwPlatformGetVersionString(void)\n{\n    const char* version = _GLFW_VERSION_FULL \" Win32\"\n#if defined(_GLFW_WGL)\n        \" WGL\"\n#elif defined(_GLFW_EGL)\n        \" EGL\"\n#endif\n#if defined(__MINGW32__)\n        \" MinGW\"\n#elif defined(_MSC_VER)\n        \" VisualC \"\n#elif defined(__BORLANDC__)\n        \" BorlandC\"\n#endif\n#if !defined(_GLFW_NO_DLOAD_WINMM)\n        \" LoadLibrary(winmm)\"\n#endif\n#if defined(_GLFW_BUILD_DLL)\n        \" DLL\"\n#endif\n        ;\n\n    return version;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/win32_joystick.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Win32\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdlib.h>\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Calculate normalized joystick position\n//\nstatic float calcJoystickPos(DWORD pos, DWORD min, DWORD max)\n{\n    float fpos = (float) pos;\n    float fmin = (float) min;\n    float fmax = (float) max;\n\n    return (2.f * (fpos - fmin) / (fmax - fmin)) - 1.f;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialize joystick interface\n//\nvoid _glfwInitJoysticks(void)\n{\n}\n\n// Close all opened joystick handles\n//\nvoid _glfwTerminateJoysticks(void)\n{\n    int i;\n\n    for (i = 0;  i < GLFW_JOYSTICK_LAST;  i++)\n        free(_glfw.win32.joystick[i].name);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformJoystickPresent(int joy)\n{\n    JOYINFO ji;\n\n    if (_glfw_joyGetPos(joy, &ji) != JOYERR_NOERROR)\n        return GL_FALSE;\n\n    return GL_TRUE;\n}\n\nconst float* _glfwPlatformGetJoystickAxes(int joy, int* count)\n{\n    JOYCAPS jc;\n    JOYINFOEX ji;\n    float* axes = _glfw.win32.joystick[joy].axes;\n\n    if (_glfw_joyGetDevCaps(joy, &jc, sizeof(JOYCAPS)) != JOYERR_NOERROR)\n        return NULL;\n\n    ji.dwSize = sizeof(JOYINFOEX);\n    ji.dwFlags = JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ |\n                 JOY_RETURNR | JOY_RETURNU | JOY_RETURNV;\n    if (_glfw_joyGetPosEx(joy, &ji) != JOYERR_NOERROR)\n        return NULL;\n\n    axes[(*count)++] = calcJoystickPos(ji.dwXpos, jc.wXmin, jc.wXmax);\n    axes[(*count)++] = -calcJoystickPos(ji.dwYpos, jc.wYmin, jc.wYmax);\n\n    if (jc.wCaps & JOYCAPS_HASZ)\n        axes[(*count)++] = calcJoystickPos(ji.dwZpos, jc.wZmin, jc.wZmax);\n\n    if (jc.wCaps & JOYCAPS_HASR)\n        axes[(*count)++] = calcJoystickPos(ji.dwRpos, jc.wRmin, jc.wRmax);\n\n    if (jc.wCaps & JOYCAPS_HASU)\n        axes[(*count)++] = calcJoystickPos(ji.dwUpos, jc.wUmin, jc.wUmax);\n\n    if (jc.wCaps & JOYCAPS_HASV)\n        axes[(*count)++] = -calcJoystickPos(ji.dwVpos, jc.wVmin, jc.wVmax);\n\n    return axes;\n}\n\nconst unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)\n{\n    JOYCAPS jc;\n    JOYINFOEX ji;\n    unsigned char* buttons = _glfw.win32.joystick[joy].buttons;\n\n    if (_glfw_joyGetDevCaps(joy, &jc, sizeof(JOYCAPS)) != JOYERR_NOERROR)\n        return NULL;\n\n    ji.dwSize = sizeof(JOYINFOEX);\n    ji.dwFlags = JOY_RETURNBUTTONS | JOY_RETURNPOV;\n    if (_glfw_joyGetPosEx(joy, &ji) != JOYERR_NOERROR)\n        return NULL;\n\n    while (*count < (int) jc.wNumButtons)\n    {\n        buttons[*count] = (unsigned char)\n            (ji.dwButtons & (1UL << *count) ? GLFW_PRESS : GLFW_RELEASE);\n        (*count)++;\n    }\n\n    // Virtual buttons - Inject data from hats\n    // Each hat is exposed as 4 buttons which exposes 8 directions with\n    // concurrent button presses\n    // NOTE: this API exposes only one hat\n\n    if ((jc.wCaps & JOYCAPS_HASPOV) && (jc.wCaps & JOYCAPS_POV4DIR))\n    {\n        int i, value = ji.dwPOV / 100 / 45;\n\n        // Bit fields of button presses for each direction, including nil\n        const int directions[9] = { 1, 3, 2, 6, 4, 12, 8, 9, 0 };\n\n        if (value < 0 || value > 8)\n            value = 8;\n\n        for (i = 0;  i < 4;  i++)\n        {\n            if (directions[value] & (1 << i))\n                buttons[(*count)++] = GLFW_PRESS;\n            else\n                buttons[(*count)++] = GLFW_RELEASE;\n        }\n    }\n\n    return buttons;\n}\n\nconst char* _glfwPlatformGetJoystickName(int joy)\n{\n    JOYCAPS jc;\n\n    if (_glfw_joyGetDevCaps(joy, &jc, sizeof(JOYCAPS)) != JOYERR_NOERROR)\n        return NULL;\n\n    free(_glfw.win32.joystick[joy].name);\n    _glfw.win32.joystick[joy].name = _glfwCreateUTF8FromWideString(jc.szPname);\n\n    return _glfw.win32.joystick[joy].name;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/win32_monitor.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11 (Unix)\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdlib.h>\n#include <string.h>\n#include <limits.h>\n#include <malloc.h>\n\n// These constants are missing on MinGW\n#ifndef EDS_ROTATEDMODE\n #define EDS_ROTATEDMODE 0x00000004\n#endif\n#ifndef DISPLAY_DEVICE_ACTIVE\n #define DISPLAY_DEVICE_ACTIVE 0x00000001\n#endif\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Change the current video mode\n//\nGLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)\n{\n    GLFWvidmode current;\n    const GLFWvidmode* best;\n    DEVMODE dm;\n\n    best = _glfwChooseVideoMode(monitor, desired);\n\n    _glfwPlatformGetVideoMode(monitor, &current);\n    if (_glfwCompareVideoModes(&current, best) == 0)\n        return GL_TRUE;\n\n    ZeroMemory(&dm, sizeof(dm));\n    dm.dmSize = sizeof(DEVMODE);\n    dm.dmFields           = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL |\n                            DM_DISPLAYFREQUENCY;\n    dm.dmPelsWidth        = best->width;\n    dm.dmPelsHeight       = best->height;\n    dm.dmBitsPerPel       = best->redBits + best->greenBits + best->blueBits;\n    dm.dmDisplayFrequency = best->refreshRate;\n\n    if (dm.dmBitsPerPel < 15 || dm.dmBitsPerPel >= 24)\n        dm.dmBitsPerPel = 32;\n\n    if (ChangeDisplaySettingsEx(monitor->win32.name,\n                                &dm,\n                                NULL,\n                                CDS_FULLSCREEN,\n                                NULL) != DISP_CHANGE_SUCCESSFUL)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR, \"Win32: Failed to set video mode\");\n        return GL_FALSE;\n    }\n\n    return GL_TRUE;\n}\n\n// Restore the previously saved (original) video mode\n//\nvoid _glfwRestoreVideoMode(_GLFWmonitor* monitor)\n{\n    ChangeDisplaySettingsEx(monitor->win32.name,\n                            NULL, NULL, CDS_FULLSCREEN, NULL);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n_GLFWmonitor** _glfwPlatformGetMonitors(int* count)\n{\n    int size = 0, found = 0;\n    _GLFWmonitor** monitors = NULL;\n    DWORD adapterIndex = 0;\n    int primaryIndex = 0;\n\n    *count = 0;\n\n    for (;;)\n    {\n        DISPLAY_DEVICE adapter, display;\n        char* name;\n        HDC dc;\n\n        ZeroMemory(&adapter, sizeof(DISPLAY_DEVICE));\n        adapter.cb = sizeof(DISPLAY_DEVICE);\n\n        if (!EnumDisplayDevices(NULL, adapterIndex, &adapter, 0))\n            break;\n\n        adapterIndex++;\n\n        if ((adapter.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) ||\n            !(adapter.StateFlags & DISPLAY_DEVICE_ACTIVE))\n        {\n            continue;\n        }\n\n        if (found == size)\n        {\n            if (size)\n                size *= 2;\n            else\n                size = 4;\n\n            monitors = (_GLFWmonitor**) realloc(monitors, sizeof(_GLFWmonitor*) * size);\n        }\n\n        ZeroMemory(&display, sizeof(DISPLAY_DEVICE));\n        display.cb = sizeof(DISPLAY_DEVICE);\n\n        EnumDisplayDevices(adapter.DeviceName, 0, &display, 0);\n        dc = CreateDC(L\"DISPLAY\", display.DeviceString, NULL, NULL);\n\n        if (adapter.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)\n            primaryIndex = found;\n\n        name = _glfwCreateUTF8FromWideString(display.DeviceString);\n        if (!name)\n        {\n            _glfwDestroyMonitors(monitors, found);\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"Failed to convert string to UTF-8\");\n\n            free(monitors);\n            return NULL;\n        }\n\n        monitors[found] = _glfwCreateMonitor(name,\n                                             GetDeviceCaps(dc, HORZSIZE),\n                                             GetDeviceCaps(dc, VERTSIZE));\n\n        free(name);\n        DeleteDC(dc);\n\n        wcscpy(monitors[found]->win32.name, adapter.DeviceName);\n        found++;\n    }\n\n    if (primaryIndex > 0)\n    {\n        _GLFWmonitor* temp = monitors[0];\n        monitors[0] = monitors[primaryIndex];\n        monitors[primaryIndex] = temp;\n    }\n\n    *count = found;\n    return monitors;\n}\n\nGLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)\n{\n    return wcscmp(first->win32.name, second->win32.name) == 0;\n}\n\nvoid _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)\n{\n    DEVMODE settings;\n    ZeroMemory(&settings, sizeof(DEVMODE));\n    settings.dmSize = sizeof(DEVMODE);\n\n    EnumDisplaySettingsEx(monitor->win32.name,\n                          ENUM_CURRENT_SETTINGS,\n                          &settings,\n                          EDS_ROTATEDMODE);\n\n    if (xpos)\n        *xpos = settings.dmPosition.x;\n    if (ypos)\n        *ypos = settings.dmPosition.y;\n}\n\nGLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)\n{\n    int modeIndex = 0, count = 0;\n    GLFWvidmode* result = NULL;\n\n    *found = 0;\n\n    for (;;)\n    {\n        int i;\n        GLFWvidmode mode;\n        DEVMODE dm;\n\n        ZeroMemory(&dm, sizeof(DEVMODE));\n        dm.dmSize = sizeof(DEVMODE);\n\n        if (!EnumDisplaySettings(monitor->win32.name, modeIndex, &dm))\n            break;\n\n        modeIndex++;\n\n        if (dm.dmBitsPerPel < 15)\n        {\n            // Skip modes with less than 15 BPP\n            continue;\n        }\n\n        mode.width  = dm.dmPelsWidth;\n        mode.height = dm.dmPelsHeight;\n        mode.refreshRate = dm.dmDisplayFrequency;\n        _glfwSplitBPP(dm.dmBitsPerPel,\n                      &mode.redBits,\n                      &mode.greenBits,\n                      &mode.blueBits);\n\n        for (i = 0;  i < *found;  i++)\n        {\n            if (_glfwCompareVideoModes(result + i, &mode) == 0)\n                break;\n        }\n\n        if (i < *found)\n        {\n            // This is a duplicate, so skip it\n            continue;\n        }\n\n        if (*found == count)\n        {\n            if (count)\n                count *= 2;\n            else\n                count = 128;\n\n            result = (GLFWvidmode*) realloc(result, count * sizeof(GLFWvidmode));\n        }\n\n        result[*found] = mode;\n        (*found)++;\n    }\n\n    return result;\n}\n\nvoid _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)\n{\n    DEVMODE dm;\n\n    ZeroMemory(&dm, sizeof(DEVMODE));\n    dm.dmSize = sizeof(DEVMODE);\n\n    EnumDisplaySettings(monitor->win32.name, ENUM_CURRENT_SETTINGS, &dm);\n\n    mode->width  = dm.dmPelsWidth;\n    mode->height = dm.dmPelsHeight;\n    mode->refreshRate = dm.dmDisplayFrequency;\n    _glfwSplitBPP(dm.dmBitsPerPel,\n                  &mode->redBits,\n                  &mode->greenBits,\n                  &mode->blueBits);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/win32_platform.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Win32\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#ifndef _win32_platform_h_\n#define _win32_platform_h_\n\n\n// We don't need all the fancy stuff\n#ifndef NOMINMAX\n #define NOMINMAX\n#endif\n\n#ifndef VC_EXTRALEAN\n #define VC_EXTRALEAN\n#endif\n\n#ifndef WIN32_LEAN_AND_MEAN\n #define WIN32_LEAN_AND_MEAN\n#endif\n\n// This is a workaround for the fact that glfw3.h needs to export APIENTRY (to\n// correctly declare a GL_ARB_debug_output callback, for example) but windows.h\n// thinks it is the only one that gets to do so\n#undef APIENTRY\n\n// GLFW on Windows is Unicode only and does not work in MBCS mode\n#ifndef UNICODE\n #define UNICODE\n#endif\n\n// GLFW requires Windows XP\n#ifndef WINVER\n #define WINVER 0x0501\n#endif\n\n#include <windows.h>\n#include <mmsystem.h>\n#include <dbt.h>\n\n\n//========================================================================\n// Hack: Define things that some windows.h variants don't\n//========================================================================\n\n#ifndef WM_MOUSEHWHEEL\n #define WM_MOUSEHWHEEL 0x020E\n#endif\n#ifndef WM_DWMCOMPOSITIONCHANGED\n #define WM_DWMCOMPOSITIONCHANGED 0x031E\n#endif\n\n\n//========================================================================\n// DLLs that are loaded at glfwInit()\n//========================================================================\n\n// winmm.dll function pointer typedefs\n#ifndef _GLFW_NO_DLOAD_WINMM\ntypedef MMRESULT (WINAPI * JOYGETDEVCAPS_T) (UINT,LPJOYCAPS,UINT);\ntypedef MMRESULT (WINAPI * JOYGETPOS_T) (UINT,LPJOYINFO);\ntypedef MMRESULT (WINAPI * JOYGETPOSEX_T) (UINT,LPJOYINFOEX);\ntypedef DWORD (WINAPI * TIMEGETTIME_T) (void);\n#endif // _GLFW_NO_DLOAD_WINMM\n\n\n// winmm.dll shortcuts\n#ifndef _GLFW_NO_DLOAD_WINMM\n #define _glfw_joyGetDevCaps _glfw.win32.winmm.joyGetDevCaps\n #define _glfw_joyGetPos     _glfw.win32.winmm.joyGetPos\n #define _glfw_joyGetPosEx   _glfw.win32.winmm.joyGetPosEx\n #define _glfw_timeGetTime   _glfw.win32.winmm.timeGetTime\n#else\n #define _glfw_joyGetDevCaps joyGetDevCaps\n #define _glfw_joyGetPos     joyGetPos\n #define _glfw_joyGetPosEx   joyGetPosEx\n #define _glfw_timeGetTime   timeGetTime\n#endif // _GLFW_NO_DLOAD_WINMM\n\n// user32.dll function pointer typedefs\ntypedef BOOL (WINAPI * SETPROCESSDPIAWARE_T)(void);\n#define _glfw_SetProcessDPIAware _glfw.win32.user32.SetProcessDPIAware\n\n// dwmapi.dll function pointer typedefs\ntypedef HRESULT (WINAPI * DWMISCOMPOSITIONENABLED_T)(BOOL*);\n#define _glfw_DwmIsCompositionEnabled _glfw.win32.dwmapi.DwmIsCompositionEnabled\n\n\n// We use versioned window class names in order not to cause conflicts\n// between applications using different versions of GLFW\n#define _GLFW_WNDCLASSNAME L\"GLFW30\"\n\n#define _GLFW_RECREATION_NOT_NEEDED 0\n#define _GLFW_RECREATION_REQUIRED   1\n#define _GLFW_RECREATION_IMPOSSIBLE 2\n\n\n#if defined(_GLFW_WGL)\n #include \"wgl_platform.h\"\n#elif defined(_GLFW_EGL)\n #define _GLFW_EGL_NATIVE_WINDOW  window->win32.handle\n #define _GLFW_EGL_NATIVE_DISPLAY EGL_DEFAULT_DISPLAY\n #include \"egl_platform.h\"\n#else\n #error \"No supported context creation API selected\"\n#endif\n\n#define _GLFW_PLATFORM_WINDOW_STATE         _GLFWwindowWin32  win32\n#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryWin32 win32\n#define _GLFW_PLATFORM_MONITOR_STATE        _GLFWmonitorWin32 win32\n\n\n//========================================================================\n// GLFW platform specific types\n//========================================================================\n\n\n//------------------------------------------------------------------------\n// Platform-specific window structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWwindowWin32\n{\n    // Platform specific window resources\n    HWND                handle;    // Window handle\n    DWORD               dwStyle;   // Window styles used for window creation\n    DWORD               dwExStyle; // --\"--\n\n    // Various platform specific internal variables\n    GLboolean           cursorCentered;\n    GLboolean           cursorInside;\n    GLboolean           cursorHidden;\n    double              oldCursorX, oldCursorY;\n} _GLFWwindowWin32;\n\n\n//------------------------------------------------------------------------\n// Platform-specific library global data for Win32\n//------------------------------------------------------------------------\ntypedef struct _GLFWlibraryWin32\n{\n    ATOM                classAtom;\n    DWORD               foregroundLockTimeout;\n    char*               clipboardString;\n\n    // Timer data\n    struct {\n        GLboolean       hasPC;\n        double          resolution;\n        unsigned int    t0_32;\n        __int64         t0_64;\n    } timer;\n\n#ifndef _GLFW_NO_DLOAD_WINMM\n    // winmm.dll\n    struct {\n        HINSTANCE       instance;\n        JOYGETDEVCAPS_T joyGetDevCaps;\n        JOYGETPOS_T     joyGetPos;\n        JOYGETPOSEX_T   joyGetPosEx;\n        TIMEGETTIME_T   timeGetTime;\n    } winmm;\n#endif // _GLFW_NO_DLOAD_WINMM\n\n    // user32.dll\n    struct {\n        HINSTANCE       instance;\n        SETPROCESSDPIAWARE_T SetProcessDPIAware;\n    } user32;\n\n    // dwmapi.dll\n    struct {\n        HINSTANCE       instance;\n        DWMISCOMPOSITIONENABLED_T DwmIsCompositionEnabled;\n    } dwmapi;\n\n    struct {\n        float           axes[6];\n        unsigned char   buttons[36]; // 32 buttons plus one hat\n        char*           name;\n    } joystick[GLFW_JOYSTICK_LAST + 1];\n\n} _GLFWlibraryWin32;\n\n\n//------------------------------------------------------------------------\n// Platform-specific monitor structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWmonitorWin32\n{\n    // This size matches the static size of DISPLAY_DEVICE.DeviceName\n    WCHAR               name[32];\n\n} _GLFWmonitorWin32;\n\n\n//========================================================================\n// Prototypes for platform specific internal functions\n//========================================================================\n\n// Desktop compositing\nBOOL _glfwIsCompositionEnabled(void);\n\n// Wide strings\nWCHAR* _glfwCreateWideStringFromUTF8(const char* source);\nchar* _glfwCreateUTF8FromWideString(const WCHAR* source);\n\n// Time\nvoid _glfwInitTimer(void);\n\n// Joystick input\nvoid _glfwInitJoysticks(void);\nvoid _glfwTerminateJoysticks(void);\n\n// OpenGL support\nint _glfwInitContextAPI(void);\nvoid _glfwTerminateContextAPI(void);\nint _glfwCreateContext(_GLFWwindow* window,\n                       const _GLFWwndconfig* wndconfig,\n                       const _GLFWfbconfig* fbconfig);\nvoid _glfwDestroyContext(_GLFWwindow* window);\nint _glfwAnalyzeContext(const _GLFWwindow* window,\n                        const _GLFWwndconfig* wndconfig,\n                        const _GLFWfbconfig* fbconfig);\n\n// Fullscreen support\nGLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);\nvoid _glfwRestoreVideoMode(_GLFWmonitor* monitor);\n\n\n#endif // _win32_platform_h_\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/win32_time.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Win32\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialise timer\n//\nvoid _glfwInitTimer(void)\n{\n    __int64 freq;\n\n    if (QueryPerformanceFrequency((LARGE_INTEGER*) &freq))\n    {\n        _glfw.win32.timer.hasPC = GL_TRUE;\n        _glfw.win32.timer.resolution = 1.0 / (double) freq;\n        QueryPerformanceCounter((LARGE_INTEGER*) &_glfw.win32.timer.t0_64);\n    }\n    else\n    {\n        _glfw.win32.timer.hasPC = GL_FALSE;\n        _glfw.win32.timer.resolution = 0.001; // winmm resolution is 1 ms\n        _glfw.win32.timer.t0_32 = _glfw_timeGetTime();\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\ndouble _glfwPlatformGetTime(void)\n{\n    double t;\n    __int64 t_64;\n\n    if (_glfw.win32.timer.hasPC)\n    {\n        QueryPerformanceCounter((LARGE_INTEGER*) &t_64);\n        t =  (double)(t_64 - _glfw.win32.timer.t0_64);\n    }\n    else\n        t = (double)(_glfw_timeGetTime() - _glfw.win32.timer.t0_32);\n\n    return t * _glfw.win32.timer.resolution;\n}\n\nvoid _glfwPlatformSetTime(double t)\n{\n    __int64 t_64;\n\n    if (_glfw.win32.timer.hasPC)\n    {\n        QueryPerformanceCounter((LARGE_INTEGER*) &t_64);\n        _glfw.win32.timer.t0_64 = t_64 - (__int64) (t / _glfw.win32.timer.resolution);\n    }\n    else\n        _glfw.win32.timer.t0_32 = _glfw_timeGetTime() - (int)(t * 1000.0);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/win32_window.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Win32/WGL\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdlib.h>\n#include <malloc.h>\n#include <windowsx.h>\n\n#define _GLFW_KEY_INVALID -2\n\n\n// Updates the cursor clip rect\n//\nstatic void updateClipRect(_GLFWwindow* window)\n{\n    RECT clipRect;\n    GetClientRect(window->win32.handle, &clipRect);\n    ClientToScreen(window->win32.handle, (POINT*) &clipRect.left);\n    ClientToScreen(window->win32.handle, (POINT*) &clipRect.right);\n    ClipCursor(&clipRect);\n}\n\n// Hide mouse cursor\n//\nstatic void hideCursor(_GLFWwindow* window)\n{\n    POINT pos;\n\n    ReleaseCapture();\n    ClipCursor(NULL);\n\n    if (window->win32.cursorHidden)\n    {\n        ShowCursor(TRUE);\n        window->win32.cursorHidden = GL_FALSE;\n    }\n\n    if (GetCursorPos(&pos))\n    {\n        if (WindowFromPoint(pos) == window->win32.handle)\n            SetCursor(NULL);\n    }\n}\n\n// Capture mouse cursor\n//\nstatic void captureCursor(_GLFWwindow* window)\n{\n    if (!window->win32.cursorHidden)\n    {\n        ShowCursor(FALSE);\n        window->win32.cursorHidden = GL_TRUE;\n    }\n\n    updateClipRect(window);\n    SetCapture(window->win32.handle);\n}\n\n// Show mouse cursor\n//\nstatic void showCursor(_GLFWwindow* window)\n{\n    POINT pos;\n\n    ReleaseCapture();\n    ClipCursor(NULL);\n\n    if (window->win32.cursorHidden)\n    {\n        ShowCursor(TRUE);\n        window->win32.cursorHidden = GL_FALSE;\n    }\n\n    if (GetCursorPos(&pos))\n    {\n        if (WindowFromPoint(pos) == window->win32.handle)\n            SetCursor(LoadCursor(NULL, IDC_ARROW));\n    }\n}\n\n// Retrieves and translates modifier keys\n//\nstatic int getKeyMods(void)\n{\n    int mods = 0;\n\n    if (GetKeyState(VK_SHIFT) & (1 << 31))\n        mods |= GLFW_MOD_SHIFT;\n    if (GetKeyState(VK_CONTROL) & (1 << 31))\n        mods |= GLFW_MOD_CONTROL;\n    if (GetKeyState(VK_MENU) & (1 << 31))\n        mods |= GLFW_MOD_ALT;\n    if ((GetKeyState(VK_LWIN) | GetKeyState(VK_RWIN)) & (1 << 31))\n        mods |= GLFW_MOD_SUPER;\n\n    return mods;\n}\n\n// Retrieves and translates modifier keys\n//\nstatic int getAsyncKeyMods(void)\n{\n    int mods = 0;\n\n    if (GetAsyncKeyState(VK_SHIFT) & (1 << 31))\n        mods |= GLFW_MOD_SHIFT;\n    if (GetAsyncKeyState(VK_CONTROL) & (1 << 31))\n        mods |= GLFW_MOD_CONTROL;\n    if (GetAsyncKeyState(VK_MENU) & (1 << 31))\n        mods |= GLFW_MOD_ALT;\n    if ((GetAsyncKeyState(VK_LWIN) | GetAsyncKeyState(VK_RWIN)) & (1 << 31))\n        mods |= GLFW_MOD_SUPER;\n\n    return mods;\n}\n\n// Translates a Windows key to the corresponding GLFW key\n//\nstatic int translateKey(WPARAM wParam, LPARAM lParam)\n{\n    // Check for numeric keypad keys\n    // NOTE: This way we always force \"NumLock = ON\", which is intentional since\n    // the returned key code should correspond to a physical location.\n    if ((HIWORD(lParam) & 0x100) == 0)\n    {\n        switch (MapVirtualKey(HIWORD(lParam) & 0xFF, 1))\n        {\n            case VK_INSERT:   return GLFW_KEY_KP_0;\n            case VK_END:      return GLFW_KEY_KP_1;\n            case VK_DOWN:     return GLFW_KEY_KP_2;\n            case VK_NEXT:     return GLFW_KEY_KP_3;\n            case VK_LEFT:     return GLFW_KEY_KP_4;\n            case VK_CLEAR:    return GLFW_KEY_KP_5;\n            case VK_RIGHT:    return GLFW_KEY_KP_6;\n            case VK_HOME:     return GLFW_KEY_KP_7;\n            case VK_UP:       return GLFW_KEY_KP_8;\n            case VK_PRIOR:    return GLFW_KEY_KP_9;\n            case VK_DIVIDE:   return GLFW_KEY_KP_DIVIDE;\n            case VK_MULTIPLY: return GLFW_KEY_KP_MULTIPLY;\n            case VK_SUBTRACT: return GLFW_KEY_KP_SUBTRACT;\n            case VK_ADD:      return GLFW_KEY_KP_ADD;\n            case VK_DELETE:   return GLFW_KEY_KP_DECIMAL;\n            default:          break;\n        }\n    }\n\n    // Check which key was pressed or released\n    switch (wParam)\n    {\n        // The SHIFT keys require special handling\n        case VK_SHIFT:\n        {\n            // Compare scan code for this key with that of VK_RSHIFT in\n            // order to determine which shift key was pressed (left or\n            // right)\n            const DWORD scancode = MapVirtualKey(VK_RSHIFT, 0);\n            if ((DWORD) ((lParam & 0x01ff0000) >> 16) == scancode)\n                return GLFW_KEY_RIGHT_SHIFT;\n\n            return GLFW_KEY_LEFT_SHIFT;\n        }\n\n        // The CTRL keys require special handling\n        case VK_CONTROL:\n        {\n            MSG next;\n            DWORD time;\n\n            // Is this an extended key (i.e. right key)?\n            if (lParam & 0x01000000)\n                return GLFW_KEY_RIGHT_CONTROL;\n\n            // Here is a trick: \"Alt Gr\" sends LCTRL, then RALT. We only\n            // want the RALT message, so we try to see if the next message\n            // is a RALT message. In that case, this is a false LCTRL!\n            time = GetMessageTime();\n\n            if (PeekMessage(&next, NULL, 0, 0, PM_NOREMOVE))\n            {\n                if (next.message == WM_KEYDOWN ||\n                    next.message == WM_SYSKEYDOWN ||\n                    next.message == WM_KEYUP ||\n                    next.message == WM_SYSKEYUP)\n                {\n                    if (next.wParam == VK_MENU &&\n                        (next.lParam & 0x01000000) &&\n                        next.time == time)\n                    {\n                        // Next message is a RALT down message, which\n                        // means that this is not a proper LCTRL message\n                        return _GLFW_KEY_INVALID;\n                    }\n                }\n            }\n\n            return GLFW_KEY_LEFT_CONTROL;\n        }\n\n        // The ALT keys require special handling\n        case VK_MENU:\n        {\n            // Is this an extended key (i.e. right key)?\n            if (lParam & 0x01000000)\n                return GLFW_KEY_RIGHT_ALT;\n\n            return GLFW_KEY_LEFT_ALT;\n        }\n\n        // The ENTER keys require special handling\n        case VK_RETURN:\n        {\n            // Is this an extended key (i.e. right key)?\n            if (lParam & 0x01000000)\n                return GLFW_KEY_KP_ENTER;\n\n            return GLFW_KEY_ENTER;\n        }\n\n        // Funcion keys (non-printable keys)\n        case VK_ESCAPE:        return GLFW_KEY_ESCAPE;\n        case VK_TAB:           return GLFW_KEY_TAB;\n        case VK_BACK:          return GLFW_KEY_BACKSPACE;\n        case VK_HOME:          return GLFW_KEY_HOME;\n        case VK_END:           return GLFW_KEY_END;\n        case VK_PRIOR:         return GLFW_KEY_PAGE_UP;\n        case VK_NEXT:          return GLFW_KEY_PAGE_DOWN;\n        case VK_INSERT:        return GLFW_KEY_INSERT;\n        case VK_DELETE:        return GLFW_KEY_DELETE;\n        case VK_LEFT:          return GLFW_KEY_LEFT;\n        case VK_UP:            return GLFW_KEY_UP;\n        case VK_RIGHT:         return GLFW_KEY_RIGHT;\n        case VK_DOWN:          return GLFW_KEY_DOWN;\n        case VK_F1:            return GLFW_KEY_F1;\n        case VK_F2:            return GLFW_KEY_F2;\n        case VK_F3:            return GLFW_KEY_F3;\n        case VK_F4:            return GLFW_KEY_F4;\n        case VK_F5:            return GLFW_KEY_F5;\n        case VK_F6:            return GLFW_KEY_F6;\n        case VK_F7:            return GLFW_KEY_F7;\n        case VK_F8:            return GLFW_KEY_F8;\n        case VK_F9:            return GLFW_KEY_F9;\n        case VK_F10:           return GLFW_KEY_F10;\n        case VK_F11:           return GLFW_KEY_F11;\n        case VK_F12:           return GLFW_KEY_F12;\n        case VK_F13:           return GLFW_KEY_F13;\n        case VK_F14:           return GLFW_KEY_F14;\n        case VK_F15:           return GLFW_KEY_F15;\n        case VK_F16:           return GLFW_KEY_F16;\n        case VK_F17:           return GLFW_KEY_F17;\n        case VK_F18:           return GLFW_KEY_F18;\n        case VK_F19:           return GLFW_KEY_F19;\n        case VK_F20:           return GLFW_KEY_F20;\n        case VK_F21:           return GLFW_KEY_F21;\n        case VK_F22:           return GLFW_KEY_F22;\n        case VK_F23:           return GLFW_KEY_F23;\n        case VK_F24:           return GLFW_KEY_F24;\n        case VK_NUMLOCK:       return GLFW_KEY_NUM_LOCK;\n        case VK_CAPITAL:       return GLFW_KEY_CAPS_LOCK;\n        case VK_SNAPSHOT:      return GLFW_KEY_PRINT_SCREEN;\n        case VK_SCROLL:        return GLFW_KEY_SCROLL_LOCK;\n        case VK_PAUSE:         return GLFW_KEY_PAUSE;\n        case VK_LWIN:          return GLFW_KEY_LEFT_SUPER;\n        case VK_RWIN:          return GLFW_KEY_RIGHT_SUPER;\n        case VK_APPS:          return GLFW_KEY_MENU;\n\n        // Numeric keypad\n        case VK_NUMPAD0:       return GLFW_KEY_KP_0;\n        case VK_NUMPAD1:       return GLFW_KEY_KP_1;\n        case VK_NUMPAD2:       return GLFW_KEY_KP_2;\n        case VK_NUMPAD3:       return GLFW_KEY_KP_3;\n        case VK_NUMPAD4:       return GLFW_KEY_KP_4;\n        case VK_NUMPAD5:       return GLFW_KEY_KP_5;\n        case VK_NUMPAD6:       return GLFW_KEY_KP_6;\n        case VK_NUMPAD7:       return GLFW_KEY_KP_7;\n        case VK_NUMPAD8:       return GLFW_KEY_KP_8;\n        case VK_NUMPAD9:       return GLFW_KEY_KP_9;\n        case VK_DIVIDE:        return GLFW_KEY_KP_DIVIDE;\n        case VK_MULTIPLY:      return GLFW_KEY_KP_MULTIPLY;\n        case VK_SUBTRACT:      return GLFW_KEY_KP_SUBTRACT;\n        case VK_ADD:           return GLFW_KEY_KP_ADD;\n        case VK_DECIMAL:       return GLFW_KEY_KP_DECIMAL;\n\n        // Printable keys are mapped according to US layout\n        case VK_SPACE:         return GLFW_KEY_SPACE;\n        case 0x30:             return GLFW_KEY_0;\n        case 0x31:             return GLFW_KEY_1;\n        case 0x32:             return GLFW_KEY_2;\n        case 0x33:             return GLFW_KEY_3;\n        case 0x34:             return GLFW_KEY_4;\n        case 0x35:             return GLFW_KEY_5;\n        case 0x36:             return GLFW_KEY_6;\n        case 0x37:             return GLFW_KEY_7;\n        case 0x38:             return GLFW_KEY_8;\n        case 0x39:             return GLFW_KEY_9;\n        case 0x41:             return GLFW_KEY_A;\n        case 0x42:             return GLFW_KEY_B;\n        case 0x43:             return GLFW_KEY_C;\n        case 0x44:             return GLFW_KEY_D;\n        case 0x45:             return GLFW_KEY_E;\n        case 0x46:             return GLFW_KEY_F;\n        case 0x47:             return GLFW_KEY_G;\n        case 0x48:             return GLFW_KEY_H;\n        case 0x49:             return GLFW_KEY_I;\n        case 0x4A:             return GLFW_KEY_J;\n        case 0x4B:             return GLFW_KEY_K;\n        case 0x4C:             return GLFW_KEY_L;\n        case 0x4D:             return GLFW_KEY_M;\n        case 0x4E:             return GLFW_KEY_N;\n        case 0x4F:             return GLFW_KEY_O;\n        case 0x50:             return GLFW_KEY_P;\n        case 0x51:             return GLFW_KEY_Q;\n        case 0x52:             return GLFW_KEY_R;\n        case 0x53:             return GLFW_KEY_S;\n        case 0x54:             return GLFW_KEY_T;\n        case 0x55:             return GLFW_KEY_U;\n        case 0x56:             return GLFW_KEY_V;\n        case 0x57:             return GLFW_KEY_W;\n        case 0x58:             return GLFW_KEY_X;\n        case 0x59:             return GLFW_KEY_Y;\n        case 0x5A:             return GLFW_KEY_Z;\n        case 0xBD:             return GLFW_KEY_MINUS;\n        case 0xBB:             return GLFW_KEY_EQUAL;\n        case 0xDB:             return GLFW_KEY_LEFT_BRACKET;\n        case 0xDD:             return GLFW_KEY_RIGHT_BRACKET;\n        case 0xDC:             return GLFW_KEY_BACKSLASH;\n        case 0xBA:             return GLFW_KEY_SEMICOLON;\n        case 0xDE:             return GLFW_KEY_APOSTROPHE;\n        case 0xC0:             return GLFW_KEY_GRAVE_ACCENT;\n        case 0xBC:             return GLFW_KEY_COMMA;\n        case 0xBE:             return GLFW_KEY_PERIOD;\n        case 0xBF:             return GLFW_KEY_SLASH;\n        case 0xDF:             return GLFW_KEY_WORLD_1;\n        case 0xE2:             return GLFW_KEY_WORLD_2;\n        default:               break;\n    }\n\n    // No matching translation was found\n    return GLFW_KEY_UNKNOWN;\n}\n\n// Window callback function (handles window events)\n//\nstatic LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,\n                                   WPARAM wParam, LPARAM lParam)\n{\n    _GLFWwindow* window = (_GLFWwindow*) GetWindowLongPtr(hWnd, 0);\n\n    switch (uMsg)\n    {\n        case WM_CREATE:\n        {\n            CREATESTRUCT* cs = (CREATESTRUCT*) lParam;\n            SetWindowLongPtr(hWnd, 0, (LONG_PTR) cs->lpCreateParams);\n            break;\n        }\n\n        case WM_ACTIVATE:\n        {\n            // Window was (de)focused and/or (de)iconified\n\n            BOOL focused = LOWORD(wParam) != WA_INACTIVE;\n            BOOL iconified = HIWORD(wParam) ? TRUE : FALSE;\n\n            if (focused && iconified)\n            {\n                // This is a workaround for window iconification using the\n                // taskbar leading to windows being told they're focused and\n                // iconified and then never told they're defocused\n                focused = FALSE;\n            }\n\n            if (!focused && _glfw.focusedWindow == window)\n            {\n                // The window was defocused (or iconified, see above)\n\n                if (window->cursorMode != GLFW_CURSOR_NORMAL)\n                    showCursor(window);\n\n                if (window->monitor)\n                {\n                    if (!iconified)\n                    {\n                        // Iconify the (on top, borderless, oddly positioned)\n                        // window or the user will be annoyed\n                        _glfwPlatformIconifyWindow(window);\n                    }\n\n                    _glfwRestoreVideoMode(window->monitor);\n                }\n            }\n            else if (focused && _glfw.focusedWindow != window)\n            {\n                // The window was focused\n\n                if (window->cursorMode == GLFW_CURSOR_DISABLED)\n                    captureCursor(window);\n                else if (window->cursorMode == GLFW_CURSOR_HIDDEN)\n                    hideCursor(window);\n\n                if (window->monitor)\n                    _glfwSetVideoMode(window->monitor, &window->videoMode);\n            }\n\n            _glfwInputWindowFocus(window, focused);\n            _glfwInputWindowIconify(window, iconified);\n            return 0;\n        }\n\n        case WM_SHOWWINDOW:\n        {\n            _glfwInputWindowVisibility(window, wParam ? GL_TRUE : GL_FALSE);\n            break;\n        }\n\n        case WM_SYSCOMMAND:\n        {\n            switch (wParam & 0xfff0)\n            {\n                case SC_SCREENSAVE:\n                case SC_MONITORPOWER:\n                {\n                    if (window->monitor)\n                    {\n                        // We are running in fullscreen mode, so disallow\n                        // screen saver and screen blanking\n                        return 0;\n                    }\n                    else\n                        break;\n                }\n\n                // User trying to access application menu using ALT?\n                case SC_KEYMENU:\n                    return 0;\n            }\n            break;\n        }\n\n        case WM_CLOSE:\n        {\n            _glfwInputWindowCloseRequest(window);\n            return 0;\n        }\n\n        case WM_KEYDOWN:\n        case WM_SYSKEYDOWN:\n        {\n            const int scancode = (lParam >> 16) & 0xff;\n            const int key = translateKey(wParam, lParam);\n            if (key == _GLFW_KEY_INVALID)\n                break;\n\n            _glfwInputKey(window, key, scancode, GLFW_PRESS, getKeyMods());\n            break;\n        }\n\n        case WM_CHAR:\n        {\n            _glfwInputChar(window, (unsigned int) wParam);\n            return 0;\n        }\n\n        case WM_UNICHAR:\n        {\n            // This message is not sent by Windows, but is sent by some\n            // third-party input method engines\n\n            if (wParam == UNICODE_NOCHAR)\n            {\n                // Returning TRUE here announces support for this message\n                return TRUE;\n            }\n\n            _glfwInputChar(window, (unsigned int) wParam);\n            return FALSE;\n        }\n\n        case WM_KEYUP:\n        case WM_SYSKEYUP:\n        {\n            const int mods = getKeyMods();\n            const int scancode = (lParam >> 16) & 0xff;\n            const int key = translateKey(wParam, lParam);\n            if (key == _GLFW_KEY_INVALID)\n                break;\n\n            if (wParam == VK_SHIFT)\n            {\n                // Release both Shift keys on Shift up event, as only one event\n                // is sent even if both keys are released\n                _glfwInputKey(window, GLFW_KEY_LEFT_SHIFT, scancode, GLFW_RELEASE, mods);\n                _glfwInputKey(window, GLFW_KEY_RIGHT_SHIFT, scancode, GLFW_RELEASE, mods);\n            }\n            else if (wParam == VK_SNAPSHOT)\n            {\n                // Key down is not reported for the print screen key\n                _glfwInputKey(window, key, scancode, GLFW_PRESS, mods);\n                _glfwInputKey(window, key, scancode, GLFW_RELEASE, mods);\n            }\n            else\n                _glfwInputKey(window, key, scancode, GLFW_RELEASE, mods);\n\n            break;\n        }\n\n        case WM_LBUTTONDOWN:\n        case WM_RBUTTONDOWN:\n        case WM_MBUTTONDOWN:\n        case WM_XBUTTONDOWN:\n        {\n            const int mods = getKeyMods();\n\n            SetCapture(hWnd);\n\n            if (uMsg == WM_LBUTTONDOWN)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_LEFT, GLFW_PRESS, mods);\n            else if (uMsg == WM_RBUTTONDOWN)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_RIGHT, GLFW_PRESS, mods);\n            else if (uMsg == WM_MBUTTONDOWN)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_MIDDLE, GLFW_PRESS, mods);\n            else\n            {\n                if (HIWORD(wParam) == XBUTTON1)\n                    _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_4, GLFW_PRESS, mods);\n                else if (HIWORD(wParam) == XBUTTON2)\n                    _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_5, GLFW_PRESS, mods);\n\n                return TRUE;\n            }\n\n            return 0;\n        }\n\n        case WM_LBUTTONUP:\n        case WM_RBUTTONUP:\n        case WM_MBUTTONUP:\n        case WM_XBUTTONUP:\n        {\n            const int mods = getKeyMods();\n\n            ReleaseCapture();\n\n            if (uMsg == WM_LBUTTONUP)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_LEFT, GLFW_RELEASE, mods);\n            else if (uMsg == WM_RBUTTONUP)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_RIGHT, GLFW_RELEASE, mods);\n            else if (uMsg == WM_MBUTTONUP)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_MIDDLE, GLFW_RELEASE, mods);\n            else\n            {\n                if (HIWORD(wParam) == XBUTTON1)\n                    _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_4, GLFW_RELEASE, mods);\n                else if (HIWORD(wParam) == XBUTTON2)\n                    _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_5, GLFW_RELEASE, mods);\n\n                return TRUE;\n            }\n\n            return 0;\n        }\n\n        case WM_MOUSEMOVE:\n        {\n            const int newCursorX = GET_X_LPARAM(lParam);\n            const int newCursorY = GET_Y_LPARAM(lParam);\n\n            if (newCursorX != window->win32.oldCursorX ||\n                newCursorY != window->win32.oldCursorY)\n            {\n                double x, y;\n\n                if (window->cursorMode == GLFW_CURSOR_DISABLED)\n                {\n                    if (_glfw.focusedWindow != window)\n                        return 0;\n\n                    x = newCursorX - window->win32.oldCursorX;\n                    y = newCursorY - window->win32.oldCursorY;\n                }\n                else\n                {\n                    x = newCursorX;\n                    y = newCursorY;\n                }\n\n                window->win32.oldCursorX = newCursorX;\n                window->win32.oldCursorY = newCursorY;\n                window->win32.cursorCentered = GL_FALSE;\n\n                _glfwInputCursorMotion(window, x, y);\n            }\n\n            if (!window->win32.cursorInside)\n            {\n                TRACKMOUSEEVENT tme;\n                ZeroMemory(&tme, sizeof(tme));\n                tme.cbSize = sizeof(tme);\n                tme.dwFlags = TME_LEAVE;\n                tme.hwndTrack = window->win32.handle;\n                TrackMouseEvent(&tme);\n\n                window->win32.cursorInside = GL_TRUE;\n                _glfwInputCursorEnter(window, GL_TRUE);\n            }\n\n            return 0;\n        }\n\n        case WM_MOUSELEAVE:\n        {\n            window->win32.cursorInside = GL_FALSE;\n            _glfwInputCursorEnter(window, GL_FALSE);\n            return 0;\n        }\n\n        case WM_MOUSEWHEEL:\n        {\n            _glfwInputScroll(window, 0.0, (SHORT) HIWORD(wParam) / (double) WHEEL_DELTA);\n            return 0;\n        }\n\n        case WM_MOUSEHWHEEL:\n        {\n            // This message is only sent on Windows Vista and later\n            _glfwInputScroll(window, (SHORT) HIWORD(wParam) / (double) WHEEL_DELTA, 0.0);\n            return 0;\n        }\n\n        case WM_SIZE:\n        {\n            if (window->cursorMode == GLFW_CURSOR_DISABLED)\n                updateClipRect(window);\n\n            _glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam));\n            _glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam));\n            return 0;\n        }\n\n        case WM_MOVE:\n        {\n            if (window->cursorMode == GLFW_CURSOR_DISABLED)\n                updateClipRect(window);\n\n            _glfwInputWindowPos(window, LOWORD(lParam), HIWORD(lParam));\n            return 0;\n        }\n\n        case WM_PAINT:\n        {\n            _glfwInputWindowDamage(window);\n            break;\n        }\n\n        case WM_SETCURSOR:\n        {\n            if (window->cursorMode == GLFW_CURSOR_HIDDEN &&\n                window->win32.handle == GetForegroundWindow() &&\n                LOWORD(lParam) == HTCLIENT)\n            {\n                SetCursor(NULL);\n                return TRUE;\n            }\n\n            break;\n        }\n\n        case WM_DEVICECHANGE:\n        {\n            if (DBT_DEVNODES_CHANGED == wParam)\n            {\n                _glfwInputMonitorChange();\n                return TRUE;\n            }\n            break;\n        }\n\n        case WM_DWMCOMPOSITIONCHANGED:\n        {\n            if (_glfwIsCompositionEnabled())\n            {\n                _GLFWwindow* previous = _glfwPlatformGetCurrentContext();\n                _glfwPlatformMakeContextCurrent(window);\n                _glfwPlatformSwapInterval(0);\n                _glfwPlatformMakeContextCurrent(previous);\n            }\n\n            // TODO: Restore vsync if compositing was disabled\n            break;\n        }\n    }\n\n    return DefWindowProc(hWnd, uMsg, wParam, lParam);\n}\n\n// Translate client window size to full window size (including window borders)\n//\nstatic void getFullWindowSize(_GLFWwindow* window,\n                              int clientWidth, int clientHeight,\n                              int* fullWidth, int* fullHeight)\n{\n    RECT rect = { 0, 0, clientWidth, clientHeight };\n    AdjustWindowRectEx(&rect, window->win32.dwStyle,\n                       FALSE, window->win32.dwExStyle);\n    *fullWidth = rect.right - rect.left;\n    *fullHeight = rect.bottom - rect.top;\n}\n\n// Registers the GLFW window class\n//\nstatic ATOM registerWindowClass(void)\n{\n    WNDCLASS wc;\n    ATOM classAtom;\n\n    // Set window class parameters\n    wc.style         = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;\n    wc.lpfnWndProc   = (WNDPROC) windowProc;\n    wc.cbClsExtra    = 0;                           // No extra class data\n    wc.cbWndExtra    = sizeof(void*) + sizeof(int); // Make room for one pointer\n    wc.hInstance     = GetModuleHandle(NULL);\n    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);\n    wc.hbrBackground = NULL;                        // No background\n    wc.lpszMenuName  = NULL;                        // No menu\n    wc.lpszClassName = _GLFW_WNDCLASSNAME;\n\n    // Load user-provided icon if available\n    wc.hIcon = LoadIcon(GetModuleHandle(NULL), L\"GLFW_ICON\");\n    if (!wc.hIcon)\n    {\n        // No user-provided icon found, load default icon\n        wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);\n    }\n\n    classAtom = RegisterClass(&wc);\n    if (!classAtom)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to register window class\");\n        return 0;\n    }\n\n    return classAtom;\n}\n\n// Creates the GLFW window and rendering context\n//\nstatic int createWindow(_GLFWwindow* window,\n                        const _GLFWwndconfig* wndconfig,\n                        const _GLFWfbconfig* fbconfig)\n{\n    int xpos, ypos, fullWidth, fullHeight;\n    WCHAR* wideTitle;\n\n    window->win32.dwStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN;\n    window->win32.dwExStyle = WS_EX_APPWINDOW;\n\n    if (window->monitor)\n    {\n        window->win32.dwStyle |= WS_POPUP;\n\n        _glfwPlatformGetMonitorPos(wndconfig->monitor, &xpos, &ypos);\n        fullWidth  = wndconfig->width;\n        fullHeight = wndconfig->height;\n    }\n    else\n    {\n        if (wndconfig->decorated)\n        {\n            window->win32.dwStyle |= WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;\n\n            if (wndconfig->resizable)\n            {\n                window->win32.dwStyle |= WS_MAXIMIZEBOX | WS_SIZEBOX;\n                window->win32.dwExStyle |= WS_EX_WINDOWEDGE;\n            }\n        }\n        else\n            window->win32.dwStyle |= WS_POPUP;\n\n        xpos = CW_USEDEFAULT;\n        ypos = CW_USEDEFAULT;\n\n        getFullWindowSize(window,\n                        wndconfig->width, wndconfig->height,\n                        &fullWidth, &fullHeight);\n    }\n\n    wideTitle = _glfwCreateWideStringFromUTF8(wndconfig->title);\n    if (!wideTitle)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to convert title to wide string\");\n        return GL_FALSE;\n    }\n\n    window->win32.handle = CreateWindowEx(window->win32.dwExStyle,\n                                          _GLFW_WNDCLASSNAME,\n                                          wideTitle,\n                                          window->win32.dwStyle,\n                                          xpos, ypos,\n                                          fullWidth, fullHeight,\n                                          NULL, // No parent window\n                                          NULL, // No window menu\n                                          GetModuleHandle(NULL),\n                                          window); // Pass object to WM_CREATE\n\n    free(wideTitle);\n\n    if (!window->win32.handle)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR, \"Win32: Failed to create window\");\n        return GL_FALSE;\n    }\n\n    if (!_glfwCreateContext(window, wndconfig, fbconfig))\n        return GL_FALSE;\n\n    return GL_TRUE;\n}\n\n// Destroys the GLFW window and rendering context\n//\nstatic void destroyWindow(_GLFWwindow* window)\n{\n    _glfwDestroyContext(window);\n\n    if (window->win32.handle)\n    {\n        DestroyWindow(window->win32.handle);\n        window->win32.handle = NULL;\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformCreateWindow(_GLFWwindow* window,\n                              const _GLFWwndconfig* wndconfig,\n                              const _GLFWfbconfig* fbconfig)\n{\n    int status;\n\n    if (!_glfw.win32.classAtom)\n    {\n        _glfw.win32.classAtom = registerWindowClass();\n        if (!_glfw.win32.classAtom)\n            return GL_FALSE;\n    }\n\n    if (!createWindow(window, wndconfig, fbconfig))\n        return GL_FALSE;\n\n    status = _glfwAnalyzeContext(window, wndconfig, fbconfig);\n\n    if (status == _GLFW_RECREATION_IMPOSSIBLE)\n        return GL_FALSE;\n\n    if (status == _GLFW_RECREATION_REQUIRED)\n    {\n        // Some window hints require us to re-create the context using WGL\n        // extensions retrieved through the current context, as we cannot check\n        // for WGL extensions or retrieve WGL entry points before we have a\n        // current context (actually until we have implicitly loaded the ICD)\n\n        // Yes, this is strange, and yes, this is the proper way on Win32\n\n        // As Windows only allows you to set the pixel format once for a\n        // window, we need to destroy the current window and create a new one\n        // to be able to use the new pixel format\n\n        // Technically, it may be possible to keep the old window around if\n        // we're just creating an OpenGL 3.0+ context with the same pixel\n        // format, but it's not worth the added code complexity\n\n        // First we clear the current context (the one we just created)\n        // This is usually done by glfwDestroyWindow, but as we're not doing\n        // full window destruction, it's duplicated here\n        _glfwPlatformMakeContextCurrent(NULL);\n\n        // Next destroy the Win32 window and WGL context (without resetting or\n        // destroying the GLFW window object)\n        destroyWindow(window);\n\n        // ...and then create them again, this time with better APIs\n        if (!createWindow(window, wndconfig, fbconfig))\n            return GL_FALSE;\n    }\n\n    if (window->monitor)\n    {\n        if (!_glfwSetVideoMode(window->monitor, &window->videoMode))\n            return GL_FALSE;\n\n        // Place the window above all topmost windows\n        _glfwPlatformShowWindow(window);\n        SetWindowPos(window->win32.handle, HWND_TOPMOST, 0,0,0,0,\n                     SWP_NOMOVE | SWP_NOSIZE);\n    }\n\n    return GL_TRUE;\n}\n\nvoid _glfwPlatformDestroyWindow(_GLFWwindow* window)\n{\n    destroyWindow(window);\n\n    if (window->monitor)\n        _glfwRestoreVideoMode(window->monitor);\n}\n\nvoid _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)\n{\n    WCHAR* wideTitle = _glfwCreateWideStringFromUTF8(title);\n    if (!wideTitle)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"Win32: Failed to convert title to wide string\");\n        return;\n    }\n\n    SetWindowText(window->win32.handle, wideTitle);\n    free(wideTitle);\n}\n\nvoid _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)\n{\n    POINT pos = { 0, 0 };\n    ClientToScreen(window->win32.handle, &pos);\n\n    if (xpos)\n        *xpos = pos.x;\n    if (ypos)\n        *ypos = pos.y;\n}\n\nvoid _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)\n{\n    RECT rect = { xpos, ypos, xpos, ypos };\n    AdjustWindowRectEx(&rect, window->win32.dwStyle,\n                       FALSE, window->win32.dwExStyle);\n    SetWindowPos(window->win32.handle, NULL, rect.left, rect.top, 0, 0,\n                 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE);\n}\n\nvoid _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)\n{\n    RECT area;\n    GetClientRect(window->win32.handle, &area);\n\n    if (width)\n        *width = area.right;\n    if (height)\n        *height = area.bottom;\n}\n\nvoid _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)\n{\n    if (window->monitor)\n    {\n        GLFWvidmode mode;\n        _glfwSetVideoMode(window->monitor, &window->videoMode);\n        _glfwPlatformGetVideoMode(window->monitor, &mode);\n\n        SetWindowPos(window->win32.handle, HWND_TOP,\n                     0, 0, mode.width, mode.height,\n                     SWP_NOMOVE);\n    }\n    else\n    {\n        int fullWidth, fullHeight;\n        getFullWindowSize(window, width, height, &fullWidth, &fullHeight);\n\n        SetWindowPos(window->win32.handle, HWND_TOP,\n                     0, 0, fullWidth, fullHeight,\n                     SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOZORDER);\n    }\n}\n\nvoid _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)\n{\n    _glfwPlatformGetWindowSize(window, width, height);\n}\n\nvoid _glfwPlatformIconifyWindow(_GLFWwindow* window)\n{\n    ShowWindow(window->win32.handle, SW_MINIMIZE);\n}\n\nvoid _glfwPlatformRestoreWindow(_GLFWwindow* window)\n{\n    ShowWindow(window->win32.handle, SW_RESTORE);\n}\n\nvoid _glfwPlatformShowWindow(_GLFWwindow* window)\n{\n    ShowWindow(window->win32.handle, SW_SHOWNORMAL);\n    BringWindowToTop(window->win32.handle);\n    SetForegroundWindow(window->win32.handle);\n    SetFocus(window->win32.handle);\n}\n\nvoid _glfwPlatformHideWindow(_GLFWwindow* window)\n{\n    ShowWindow(window->win32.handle, SW_HIDE);\n}\n\nvoid _glfwPlatformPollEvents(void)\n{\n    MSG msg;\n    _GLFWwindow* window;\n\n    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))\n    {\n        if (msg.message == WM_QUIT)\n        {\n            // Treat WM_QUIT as a close on all windows\n\n            window = _glfw.windowListHead;\n            while (window)\n            {\n                _glfwInputWindowCloseRequest(window);\n                window = window->next;\n            }\n        }\n        else\n        {\n            TranslateMessage(&msg);\n            DispatchMessage(&msg);\n        }\n    }\n\n    window = _glfw.focusedWindow;\n    if (window)\n    {\n        // LSHIFT/RSHIFT fixup (keys tend to \"stick\" without this fix)\n        // This is the only async event handling in GLFW, but it solves some\n        // nasty problems\n        {\n            const int mods = getAsyncKeyMods();\n\n            // Get current state of left and right shift keys\n            const int lshiftDown = (GetAsyncKeyState(VK_LSHIFT) >> 15) & 1;\n            const int rshiftDown = (GetAsyncKeyState(VK_RSHIFT) >> 15) & 1;\n\n            // See if this differs from our belief of what has happened\n            // (we only have to check for lost key up events)\n            if (!lshiftDown && window->key[GLFW_KEY_LEFT_SHIFT] == 1)\n                _glfwInputKey(window, GLFW_KEY_LEFT_SHIFT, 0, GLFW_RELEASE, mods);\n\n            if (!rshiftDown && window->key[GLFW_KEY_RIGHT_SHIFT] == 1)\n                _glfwInputKey(window, GLFW_KEY_RIGHT_SHIFT, 0, GLFW_RELEASE, mods);\n        }\n\n        // Did the cursor move in an focused window that has captured the cursor\n        if (window->cursorMode == GLFW_CURSOR_DISABLED &&\n            !window->win32.cursorCentered)\n        {\n            int width, height;\n            _glfwPlatformGetWindowSize(window, &width, &height);\n            _glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0);\n            window->win32.cursorCentered = GL_TRUE;\n        }\n    }\n}\n\nvoid _glfwPlatformWaitEvents(void)\n{\n    WaitMessage();\n\n    _glfwPlatformPollEvents();\n}\n\nvoid _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos)\n{\n    POINT pos = { (int) xpos, (int) ypos };\n    ClientToScreen(window->win32.handle, &pos);\n    SetCursorPos(pos.x, pos.y);\n\n    window->win32.oldCursorX = xpos;\n    window->win32.oldCursorY = ypos;\n}\n\nvoid _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)\n{\n    switch (mode)\n    {\n        case GLFW_CURSOR_NORMAL:\n            showCursor(window);\n            break;\n        case GLFW_CURSOR_HIDDEN:\n            hideCursor(window);\n            break;\n        case GLFW_CURSOR_DISABLED:\n            captureCursor(window);\n            break;\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW native API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI HWND glfwGetWin32Window(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return window->win32.handle;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/window.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    Any\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n// Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <string.h>\n#include <stdlib.h>\n#if defined(_MSC_VER)\n #include <malloc.h>\n#endif\n\n\n// Return the maxiumum of the specified values\n//\nstatic int Max(int a, int b)\n{\n    return (a > b) ? a : b;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                         GLFW event API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused)\n{\n    if (focused)\n    {\n        if (_glfw.focusedWindow != window)\n        {\n            _glfw.focusedWindow = window;\n\n            if (window->callbacks.focus)\n                window->callbacks.focus((GLFWwindow*) window, focused);\n        }\n    }\n    else\n    {\n        if (_glfw.focusedWindow == window)\n        {\n            int i;\n\n            _glfw.focusedWindow = NULL;\n\n            if (window->callbacks.focus)\n                window->callbacks.focus((GLFWwindow*) window, focused);\n\n            // Release all pressed keyboard keys\n            for (i = 0;  i <= GLFW_KEY_LAST;  i++)\n            {\n                if (window->key[i] == GLFW_PRESS)\n                    _glfwInputKey(window, i, 0, GLFW_RELEASE, 0);\n            }\n\n            // Release all pressed mouse buttons\n            for (i = 0;  i <= GLFW_MOUSE_BUTTON_LAST;  i++)\n            {\n                if (window->mouseButton[i] == GLFW_PRESS)\n                    _glfwInputMouseClick(window, i, GLFW_RELEASE, 0);\n            }\n        }\n    }\n}\n\nvoid _glfwInputWindowPos(_GLFWwindow* window, int x, int y)\n{\n    if (window->callbacks.pos)\n        window->callbacks.pos((GLFWwindow*) window, x, y);\n}\n\nvoid _glfwInputWindowSize(_GLFWwindow* window, int width, int height)\n{\n    if (window->callbacks.size)\n        window->callbacks.size((GLFWwindow*) window, width, height);\n}\n\nvoid _glfwInputWindowIconify(_GLFWwindow* window, int iconified)\n{\n    if (window->iconified == iconified)\n        return;\n\n    window->iconified = iconified;\n\n    if (window->callbacks.iconify)\n        window->callbacks.iconify((GLFWwindow*) window, iconified);\n}\n\nvoid _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height)\n{\n    if (window->callbacks.fbsize)\n        window->callbacks.fbsize((GLFWwindow*) window, width, height);\n}\n\nvoid _glfwInputWindowVisibility(_GLFWwindow* window, int visible)\n{\n    window->visible = visible;\n}\n\nvoid _glfwInputWindowDamage(_GLFWwindow* window)\n{\n    if (window->callbacks.refresh)\n        window->callbacks.refresh((GLFWwindow*) window);\n}\n\nvoid _glfwInputWindowCloseRequest(_GLFWwindow* window)\n{\n        window->closed = GL_TRUE;\n\n    if (window->callbacks.close)\n        window->callbacks.close((GLFWwindow*) window);\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW public API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,\n                                     const char* title,\n                                     GLFWmonitor* monitor,\n                                     GLFWwindow* share)\n{\n    _GLFWfbconfig fbconfig;\n    _GLFWwndconfig wndconfig;\n    _GLFWwindow* window;\n    _GLFWwindow* previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    if (width <= 0 || height <= 0)\n    {\n        _glfwInputError(GLFW_INVALID_VALUE, \"Invalid window size\");\n        return GL_FALSE;\n    }\n\n    // Set up desired framebuffer config\n    fbconfig.redBits        = Max(_glfw.hints.redBits, 0);\n    fbconfig.greenBits      = Max(_glfw.hints.greenBits, 0);\n    fbconfig.blueBits       = Max(_glfw.hints.blueBits, 0);\n    fbconfig.alphaBits      = Max(_glfw.hints.alphaBits, 0);\n    fbconfig.depthBits      = Max(_glfw.hints.depthBits, 0);\n    fbconfig.stencilBits    = Max(_glfw.hints.stencilBits, 0);\n    fbconfig.accumRedBits   = Max(_glfw.hints.accumRedBits, 0);\n    fbconfig.accumGreenBits = Max(_glfw.hints.accumGreenBits, 0);\n    fbconfig.accumBlueBits  = Max(_glfw.hints.accumBlueBits, 0);\n    fbconfig.accumAlphaBits = Max(_glfw.hints.accumAlphaBits, 0);\n    fbconfig.auxBuffers     = Max(_glfw.hints.auxBuffers, 0);\n    fbconfig.stereo         = _glfw.hints.stereo ? GL_TRUE : GL_FALSE;\n    fbconfig.samples        = Max(_glfw.hints.samples, 0);\n    fbconfig.sRGB           = _glfw.hints.sRGB ? GL_TRUE : GL_FALSE;\n\n    // Set up desired window config\n    wndconfig.width         = width;\n    wndconfig.height        = height;\n    wndconfig.title         = title;\n    wndconfig.resizable     = _glfw.hints.resizable ? GL_TRUE : GL_FALSE;\n    wndconfig.visible       = _glfw.hints.visible ? GL_TRUE : GL_FALSE;\n    wndconfig.decorated     = _glfw.hints.decorated ? GL_TRUE : GL_FALSE;\n    wndconfig.clientAPI     = _glfw.hints.clientAPI;\n    wndconfig.glMajor       = _glfw.hints.glMajor;\n    wndconfig.glMinor       = _glfw.hints.glMinor;\n    wndconfig.glForward     = _glfw.hints.glForward ? GL_TRUE : GL_FALSE;\n    wndconfig.glDebug       = _glfw.hints.glDebug ? GL_TRUE : GL_FALSE;\n    wndconfig.glProfile     = _glfw.hints.glProfile;\n    wndconfig.glRobustness  = _glfw.hints.glRobustness;\n    wndconfig.monitor       = (_GLFWmonitor*) monitor;\n    wndconfig.share         = (_GLFWwindow*) share;\n\n    // Check the OpenGL bits of the window config\n    if (!_glfwIsValidContextConfig(&wndconfig))\n        return GL_FALSE;\n\n    window = (_GLFWwindow*) calloc(1, sizeof(_GLFWwindow));\n    window->next = _glfw.windowListHead;\n    _glfw.windowListHead = window;\n\n    if (wndconfig.monitor)\n    {\n        wndconfig.resizable = GL_TRUE;\n        wndconfig.visible   = GL_TRUE;\n\n        // Set up desired video mode\n        window->videoMode.width       = width;\n        window->videoMode.height      = height;\n        window->videoMode.redBits     = Max(_glfw.hints.redBits, 0);\n        window->videoMode.greenBits   = Max(_glfw.hints.greenBits, 0);\n        window->videoMode.blueBits    = Max(_glfw.hints.blueBits, 0);\n        window->videoMode.refreshRate = Max(_glfw.hints.refreshRate, 0);\n    }\n\n    window->monitor     = wndconfig.monitor;\n    window->resizable   = wndconfig.resizable;\n    window->decorated   = wndconfig.decorated;\n    window->cursorMode  = GLFW_CURSOR_NORMAL;\n\n    // Save the currently current context so it can be restored later\n    previous = (_GLFWwindow*) glfwGetCurrentContext();\n\n    // Open the actual window and create its context\n    if (!_glfwPlatformCreateWindow(window, &wndconfig, &fbconfig))\n    {\n        glfwDestroyWindow((GLFWwindow*) window);\n        glfwMakeContextCurrent((GLFWwindow*) previous);\n        return GL_FALSE;\n    }\n\n    glfwMakeContextCurrent((GLFWwindow*) window);\n\n    // Retrieve the actual (as opposed to requested) context attributes\n    if (!_glfwRefreshContextAttribs())\n    {\n        glfwDestroyWindow((GLFWwindow*) window);\n        glfwMakeContextCurrent((GLFWwindow*) previous);\n        return GL_FALSE;\n    }\n\n    // Verify the context against the requested parameters\n    if (!_glfwIsValidContext(&wndconfig))\n    {\n        glfwDestroyWindow((GLFWwindow*) window);\n        glfwMakeContextCurrent((GLFWwindow*) previous);\n        return GL_FALSE;\n    }\n\n    // Clearing the front buffer to black to avoid garbage pixels left over\n    // from previous uses of our bit of VRAM\n    glClear(GL_COLOR_BUFFER_BIT);\n    _glfwPlatformSwapBuffers(window);\n\n    // Restore the previously current context (or NULL)\n    glfwMakeContextCurrent((GLFWwindow*) previous);\n\n    if (wndconfig.monitor == NULL && wndconfig.visible)\n        glfwShowWindow((GLFWwindow*) window);\n\n    return (GLFWwindow*) window;\n}\n\nvoid glfwDefaultWindowHints(void)\n{\n    _GLFW_REQUIRE_INIT();\n\n    memset(&_glfw.hints, 0, sizeof(_glfw.hints));\n\n    // The default is OpenGL with minimum version 1.0\n    _glfw.hints.clientAPI = GLFW_OPENGL_API;\n    _glfw.hints.glMajor = 1;\n    _glfw.hints.glMinor = 0;\n\n    // The default is a visible, resizable window with decorations\n    _glfw.hints.resizable = GL_TRUE;\n    _glfw.hints.visible   = GL_TRUE;\n    _glfw.hints.decorated = GL_TRUE;\n\n    // The default is 24 bits of color, 24 bits of depth and 8 bits of stencil\n    _glfw.hints.redBits     = 8;\n    _glfw.hints.greenBits   = 8;\n    _glfw.hints.blueBits    = 8;\n    _glfw.hints.depthBits   = 24;\n    _glfw.hints.stencilBits = 8;\n}\n\nGLFWAPI void glfwWindowHint(int target, int hint)\n{\n    _GLFW_REQUIRE_INIT();\n\n    switch (target)\n    {\n        case GLFW_RED_BITS:\n            _glfw.hints.redBits = hint;\n            break;\n        case GLFW_GREEN_BITS:\n            _glfw.hints.greenBits = hint;\n            break;\n        case GLFW_BLUE_BITS:\n            _glfw.hints.blueBits = hint;\n            break;\n        case GLFW_ALPHA_BITS:\n            _glfw.hints.alphaBits = hint;\n            break;\n        case GLFW_DEPTH_BITS:\n            _glfw.hints.depthBits = hint;\n            break;\n        case GLFW_STENCIL_BITS:\n            _glfw.hints.stencilBits = hint;\n            break;\n        case GLFW_ACCUM_RED_BITS:\n            _glfw.hints.accumRedBits = hint;\n            break;\n        case GLFW_ACCUM_GREEN_BITS:\n            _glfw.hints.accumGreenBits = hint;\n            break;\n        case GLFW_ACCUM_BLUE_BITS:\n            _glfw.hints.accumBlueBits = hint;\n            break;\n        case GLFW_ACCUM_ALPHA_BITS:\n            _glfw.hints.accumAlphaBits = hint;\n            break;\n        case GLFW_AUX_BUFFERS:\n            _glfw.hints.auxBuffers = hint;\n            break;\n        case GLFW_STEREO:\n            _glfw.hints.stereo = hint;\n            break;\n        case GLFW_REFRESH_RATE:\n            _glfw.hints.refreshRate = hint;\n            break;\n        case GLFW_RESIZABLE:\n            _glfw.hints.resizable = hint;\n            break;\n        case GLFW_DECORATED:\n            _glfw.hints.decorated = hint;\n            break;\n        case GLFW_VISIBLE:\n            _glfw.hints.visible = hint;\n            break;\n        case GLFW_SAMPLES:\n            _glfw.hints.samples = hint;\n            break;\n        case GLFW_SRGB_CAPABLE:\n            _glfw.hints.sRGB = hint;\n            break;\n        case GLFW_CLIENT_API:\n            _glfw.hints.clientAPI = hint;\n            break;\n        case GLFW_CONTEXT_VERSION_MAJOR:\n            _glfw.hints.glMajor = hint;\n            break;\n        case GLFW_CONTEXT_VERSION_MINOR:\n            _glfw.hints.glMinor = hint;\n            break;\n        case GLFW_CONTEXT_ROBUSTNESS:\n            _glfw.hints.glRobustness = hint;\n            break;\n        case GLFW_OPENGL_FORWARD_COMPAT:\n            _glfw.hints.glForward = hint;\n            break;\n        case GLFW_OPENGL_DEBUG_CONTEXT:\n            _glfw.hints.glDebug = hint;\n            break;\n        case GLFW_OPENGL_PROFILE:\n            _glfw.hints.glProfile = hint;\n            break;\n        default:\n            _glfwInputError(GLFW_INVALID_ENUM, NULL);\n            break;\n    }\n}\n\nGLFWAPI void glfwDestroyWindow(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    // Allow closing of NULL (to match the behavior of free)\n    if (window == NULL)\n        return;\n\n    // Clear all callbacks to avoid exposing a half torn-down window object\n    memset(&window->callbacks, 0, sizeof(window->callbacks));\n\n    // The window's context must not be current on another thread when the\n    // window is destroyed\n    if (window == _glfwPlatformGetCurrentContext())\n        _glfwPlatformMakeContextCurrent(NULL);\n\n    // Clear the focused window pointer if this is the focused window\n    if (window == _glfw.focusedWindow)\n        _glfw.focusedWindow = NULL;\n\n    _glfwPlatformDestroyWindow(window);\n\n    // Unlink window from global linked list\n    {\n        _GLFWwindow** prev = &_glfw.windowListHead;\n\n        while (*prev != window)\n            prev = &((*prev)->next);\n\n        *prev = window->next;\n    }\n\n    free(window);\n}\n\nGLFWAPI int glfwWindowShouldClose(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(0);\n    return window->closed;\n}\n\nGLFWAPI void glfwSetWindowShouldClose(GLFWwindow* handle, int value)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT();\n    window->closed = value;\n}\n\nGLFWAPI void glfwSetWindowTitle(GLFWwindow* handle, const char* title)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformSetWindowTitle(window, title);\n}\n\nGLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformGetWindowPos(window, xpos, ypos);\n}\n\nGLFWAPI void glfwSetWindowPos(GLFWwindow* handle, int xpos, int ypos)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (window->monitor)\n    {\n        _glfwInputError(GLFW_INVALID_VALUE,\n                        \"Fullscreen windows cannot be positioned\");\n        return;\n    }\n\n    _glfwPlatformSetWindowPos(window, xpos, ypos);\n}\n\nGLFWAPI void glfwGetWindowSize(GLFWwindow* handle, int* width, int* height)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformGetWindowSize(window, width, height);\n}\n\nGLFWAPI void glfwSetWindowSize(GLFWwindow* handle, int width, int height)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (window->iconified)\n        return;\n\n    if (window->monitor)\n    {\n        window->videoMode.width  = width;\n        window->videoMode.height = height;\n    }\n\n    _glfwPlatformSetWindowSize(window, width, height);\n}\n\nGLFWAPI void glfwGetFramebufferSize(GLFWwindow* handle, int* width, int* height)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    _glfwPlatformGetFramebufferSize(window, width, height);\n}\n\nGLFWAPI void glfwIconifyWindow(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (window->iconified)\n        return;\n\n    _glfwPlatformIconifyWindow(window);\n}\n\nGLFWAPI void glfwRestoreWindow(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (!window->iconified)\n        return;\n\n    _glfwPlatformRestoreWindow(window);\n}\n\nGLFWAPI void glfwShowWindow(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (window->monitor)\n        return;\n\n    _glfwPlatformShowWindow(window);\n}\n\nGLFWAPI void glfwHideWindow(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT();\n\n    if (window->monitor)\n        return;\n\n    _glfwPlatformHideWindow(window);\n}\n\nGLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(0);\n\n    switch (attrib)\n    {\n        case GLFW_FOCUSED:\n            return window == _glfw.focusedWindow;\n        case GLFW_ICONIFIED:\n            return window->iconified;\n        case GLFW_RESIZABLE:\n            return window->resizable;\n        case GLFW_DECORATED:\n            return window->decorated;\n        case GLFW_VISIBLE:\n            return window->visible;\n        case GLFW_CLIENT_API:\n            return window->clientAPI;\n        case GLFW_CONTEXT_VERSION_MAJOR:\n            return window->glMajor;\n        case GLFW_CONTEXT_VERSION_MINOR:\n            return window->glMinor;\n        case GLFW_CONTEXT_REVISION:\n            return window->glRevision;\n        case GLFW_CONTEXT_ROBUSTNESS:\n            return window->glRobustness;\n        case GLFW_OPENGL_FORWARD_COMPAT:\n            return window->glForward;\n        case GLFW_OPENGL_DEBUG_CONTEXT:\n            return window->glDebug;\n        case GLFW_OPENGL_PROFILE:\n            return window->glProfile;\n    }\n\n    _glfwInputError(GLFW_INVALID_ENUM, NULL);\n    return 0;\n}\n\nGLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return (GLFWmonitor*) window->monitor;\n}\n\nGLFWAPI void glfwSetWindowUserPointer(GLFWwindow* handle, void* pointer)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT();\n    window->userPointer = pointer;\n}\n\nGLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return window->userPointer;\n}\n\nGLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* handle,\n                                                  GLFWwindowposfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWwindowposfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.pos;\n    window->callbacks.pos = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* handle,\n                                                    GLFWwindowsizefun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWwindowsizefun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.size;\n    window->callbacks.size = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* handle,\n                                                      GLFWwindowclosefun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWwindowclosefun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.close;\n    window->callbacks.close = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* handle,\n                                                          GLFWwindowrefreshfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWwindowrefreshfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.refresh;\n    window->callbacks.refresh = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* handle,\n                                                      GLFWwindowfocusfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWwindowfocusfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.focus;\n    window->callbacks.focus = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* handle,\n                                                          GLFWwindowiconifyfun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWwindowiconifyfun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.iconify;\n    window->callbacks.iconify = cbfun;\n    return previous;\n}\n\nGLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* handle,\n                                                              GLFWframebuffersizefun cbfun)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    GLFWframebuffersizefun previous;\n\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n\n    previous = window->callbacks.fbsize;\n    window->callbacks.fbsize = cbfun;\n    return previous;\n}\n\nGLFWAPI void glfwPollEvents(void)\n{\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformPollEvents();\n}\n\nGLFWAPI void glfwWaitEvents(void)\n{\n    _GLFW_REQUIRE_INIT();\n    _glfwPlatformWaitEvents();\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_clipboard.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <stdio.h>\n#include <limits.h>\n#include <string.h>\n#include <stdlib.h>\n\n\n// Returns whether the event is a selection event\n//\nstatic Bool isSelectionMessage(Display* display, XEvent* event, XPointer pointer)\n{\n    return event->type == SelectionRequest ||\n           event->type == SelectionNotify ||\n           event->type == SelectionClear;\n}\n\n// Set the specified property to the selection converted to the requested target\n//\nstatic Atom writeTargetToProperty(const XSelectionRequestEvent* request)\n{\n    int i;\n    const Atom formats[] = { _glfw.x11.UTF8_STRING,\n                             _glfw.x11.COMPOUND_STRING,\n                             XA_STRING };\n    const int formatCount = sizeof(formats) / sizeof(formats[0]);\n\n    if (request->property == None)\n    {\n        // The requestor is a legacy client (ICCCM section 2.2)\n        // We don't support legacy clients, so fail here\n        return None;\n    }\n\n    if (request->target == _glfw.x11.TARGETS)\n    {\n        // The list of supported targets was requested\n\n        const Atom targets[] = { _glfw.x11.TARGETS,\n                                 _glfw.x11.MULTIPLE,\n                                 _glfw.x11.UTF8_STRING,\n                                 _glfw.x11.COMPOUND_STRING,\n                                 XA_STRING };\n\n        XChangeProperty(_glfw.x11.display,\n                        request->requestor,\n                        request->property,\n                        XA_ATOM,\n                        32,\n                        PropModeReplace,\n                        (unsigned char*) targets,\n                        sizeof(targets) / sizeof(targets[0]));\n\n        return request->property;\n    }\n\n    if (request->target == _glfw.x11.MULTIPLE)\n    {\n        // Multiple conversions were requested\n\n        Atom* targets;\n        unsigned long i, count;\n\n        count = _glfwGetWindowProperty(request->requestor,\n                                       request->property,\n                                       _glfw.x11.ATOM_PAIR,\n                                       (unsigned char**) &targets);\n\n        for (i = 0;  i < count;  i += 2)\n        {\n            int j;\n\n            for (j = 0;  j < formatCount;  j++)\n            {\n                if (targets[i] == formats[j])\n                    break;\n            }\n\n            if (j < formatCount)\n            {\n                XChangeProperty(_glfw.x11.display,\n                                request->requestor,\n                                targets[i + 1],\n                                targets[i],\n                                8,\n                                PropModeReplace,\n                                (unsigned char*) _glfw.x11.selection.string,\n                                strlen(_glfw.x11.selection.string));\n            }\n            else\n                targets[i + 1] = None;\n        }\n\n        XChangeProperty(_glfw.x11.display,\n                        request->requestor,\n                        request->property,\n                        _glfw.x11.ATOM_PAIR,\n                        32,\n                        PropModeReplace,\n                        (unsigned char*) targets,\n                        count);\n\n        XFree(targets);\n\n        return request->property;\n    }\n\n    if (request->target == _glfw.x11.SAVE_TARGETS)\n    {\n        // The request is a check whether we support SAVE_TARGETS\n        // It should be handled as a no-op side effect target\n\n        XChangeProperty(_glfw.x11.display,\n                        request->requestor,\n                        request->property,\n                        XInternAtom(_glfw.x11.display, \"NULL\", False),\n                        32,\n                        PropModeReplace,\n                        NULL,\n                        0);\n\n        return request->property;\n    }\n\n    // Conversion to a data target was requested\n\n    for (i = 0;  i < formatCount;  i++)\n    {\n        if (request->target == formats[i])\n        {\n            // The requested target is one we support\n\n            XChangeProperty(_glfw.x11.display,\n                            request->requestor,\n                            request->property,\n                            request->target,\n                            8,\n                            PropModeReplace,\n                            (unsigned char*) _glfw.x11.selection.string,\n                            strlen(_glfw.x11.selection.string));\n\n            return request->property;\n        }\n    }\n\n    // The requested target is not supported\n\n    return None;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwHandleSelectionClear(XEvent* event)\n{\n    free(_glfw.x11.selection.string);\n    _glfw.x11.selection.string = NULL;\n}\n\nvoid _glfwHandleSelectionRequest(XEvent* event)\n{\n    const XSelectionRequestEvent* request = &event->xselectionrequest;\n\n    XEvent response;\n    memset(&response, 0, sizeof(response));\n\n    response.xselection.property = writeTargetToProperty(request);\n    response.xselection.type = SelectionNotify;\n    response.xselection.display = request->display;\n    response.xselection.requestor = request->requestor;\n    response.xselection.selection = request->selection;\n    response.xselection.target = request->target;\n    response.xselection.time = request->time;\n\n    XSendEvent(_glfw.x11.display, request->requestor, False, 0, &response);\n}\n\nvoid _glfwPushSelectionToManager(_GLFWwindow* window)\n{\n    XConvertSelection(_glfw.x11.display,\n                      _glfw.x11.CLIPBOARD_MANAGER,\n                      _glfw.x11.SAVE_TARGETS,\n                      None,\n                      window->x11.handle,\n                      CurrentTime);\n\n    for (;;)\n    {\n        XEvent event;\n\n        if (!XCheckIfEvent(_glfw.x11.display, &event, isSelectionMessage, NULL))\n            continue;\n\n        switch (event.type)\n        {\n            case SelectionRequest:\n                _glfwHandleSelectionRequest(&event);\n                break;\n\n            case SelectionClear:\n                _glfwHandleSelectionClear(&event);\n                break;\n\n            case SelectionNotify:\n            {\n                if (event.xselection.target == _glfw.x11.SAVE_TARGETS)\n                {\n                    // This means one of two things; either the selection was\n                    // not owned, which means there is no clipboard manager, or\n                    // the transfer to the clipboard manager has completed\n                    // In either case, it means we are done here\n                    return;\n                }\n\n                break;\n            }\n        }\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)\n{\n    free(_glfw.x11.selection.string);\n    _glfw.x11.selection.string = strdup(string);\n\n    XSetSelectionOwner(_glfw.x11.display,\n                       _glfw.x11.CLIPBOARD,\n                       window->x11.handle, CurrentTime);\n\n    if (XGetSelectionOwner(_glfw.x11.display, _glfw.x11.CLIPBOARD) !=\n        window->x11.handle)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"X11: Failed to become owner of the clipboard selection\");\n    }\n}\n\nconst char* _glfwPlatformGetClipboardString(_GLFWwindow* window)\n{\n    int i;\n    const Atom formats[] = { _glfw.x11.UTF8_STRING,\n                             _glfw.x11.COMPOUND_STRING,\n                             XA_STRING };\n    const int formatCount = sizeof(formats) / sizeof(formats[0]);\n\n    if (_glfwFindWindowByHandle(XGetSelectionOwner(_glfw.x11.display,\n                                                   _glfw.x11.CLIPBOARD)))\n    {\n        // Instead of doing a large number of X round-trips just to put this\n        // string into a window property and then read it back, just return it\n        return _glfw.x11.selection.string;\n    }\n\n    free(_glfw.x11.selection.string);\n    _glfw.x11.selection.string = NULL;\n\n    for (i = 0;  i < formatCount;  i++)\n    {\n        char* data;\n        XEvent event;\n\n        XConvertSelection(_glfw.x11.display,\n                          _glfw.x11.CLIPBOARD,\n                          formats[i],\n                          _glfw.x11.GLFW_SELECTION,\n                          window->x11.handle, CurrentTime);\n\n        // XCheckTypedEvent is used instead of XIfEvent in order not to lock\n        // other threads out from the display during the entire wait period\n        while (!XCheckTypedEvent(_glfw.x11.display, SelectionNotify, &event))\n            ;\n\n        if (event.xselection.property == None)\n            continue;\n\n        if (_glfwGetWindowProperty(event.xselection.requestor,\n                                   event.xselection.property,\n                                   event.xselection.target,\n                                   (unsigned char**) &data))\n        {\n            _glfw.x11.selection.string = strdup(data);\n        }\n\n        XFree(data);\n\n        XDeleteProperty(_glfw.x11.display,\n                        event.xselection.requestor,\n                        event.xselection.property);\n\n        if (_glfw.x11.selection.string)\n            break;\n    }\n\n    if (_glfw.x11.selection.string == NULL)\n    {\n        _glfwInputError(GLFW_FORMAT_UNAVAILABLE,\n                        \"X11: Failed to convert selection to string\");\n    }\n\n    return _glfw.x11.selection.string;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_gamma.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <limits.h>\n#include <string.h>\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Detect gamma ramp support\n//\nvoid _glfwInitGammaRamp(void)\n{\n    // RandR gamma support is only available with version 1.2 and above\n    if (_glfw.x11.randr.available &&\n        (_glfw.x11.randr.versionMajor > 1 ||\n         (_glfw.x11.randr.versionMajor == 1 &&\n          _glfw.x11.randr.versionMinor >= 2)))\n    {\n        // FIXME: Assumes that all monitors have the same size gamma tables\n        // This is reasonable as I suspect the that if they did differ, it\n        // would imply that setting the gamma size to an arbitary size is\n        // possible as well.\n        XRRScreenResources* rr = XRRGetScreenResources(_glfw.x11.display,\n                                                       _glfw.x11.root);\n\n        if (XRRGetCrtcGammaSize(_glfw.x11.display, rr->crtcs[0]) == 0)\n        {\n            // This is probably older Nvidia RandR with broken gamma support\n            // Flag it as useless and try Xf86VidMode below, if available\n            _glfw.x11.randr.gammaBroken = GL_TRUE;\n        }\n\n        XRRFreeScreenResources(rr);\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nvoid _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)\n{\n    if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken)\n    {\n        const size_t size = XRRGetCrtcGammaSize(_glfw.x11.display,\n                                                monitor->x11.crtc);\n        XRRCrtcGamma* gamma = XRRGetCrtcGamma(_glfw.x11.display,\n                                              monitor->x11.crtc);\n\n        _glfwAllocGammaRamp(ramp, size);\n\n        memcpy(ramp->red, gamma->red, size * sizeof(unsigned short));\n        memcpy(ramp->green, gamma->green, size * sizeof(unsigned short));\n        memcpy(ramp->blue, gamma->blue, size * sizeof(unsigned short));\n\n        XRRFreeGamma(gamma);\n    }\n    else if (_glfw.x11.vidmode.available)\n    {\n        int size;\n        XF86VidModeGetGammaRampSize(_glfw.x11.display, _glfw.x11.screen, &size);\n\n        _glfwAllocGammaRamp(ramp, size);\n\n        XF86VidModeGetGammaRamp(_glfw.x11.display,\n                                _glfw.x11.screen,\n                                ramp->size, ramp->red, ramp->green, ramp->blue);\n    }\n}\n\nvoid _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)\n{\n    if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken)\n    {\n        XRRCrtcGamma* gamma = XRRAllocGamma(ramp->size);\n\n        memcpy(gamma->red, ramp->red, ramp->size * sizeof(unsigned short));\n        memcpy(gamma->green, ramp->green, ramp->size * sizeof(unsigned short));\n        memcpy(gamma->blue, ramp->blue, ramp->size * sizeof(unsigned short));\n\n        XRRSetCrtcGamma(_glfw.x11.display, monitor->x11.crtc, gamma);\n        XRRFreeGamma(gamma);\n    }\n    else if (_glfw.x11.vidmode.available)\n    {\n        XF86VidModeSetGammaRamp(_glfw.x11.display,\n                                _glfw.x11.screen,\n                                ramp->size,\n                                (unsigned short*) ramp->red,\n                                (unsigned short*) ramp->green,\n                                (unsigned short*) ramp->blue);\n    }\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_init.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11/GLX\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <X11/Xresource.h>\n\n#include <stdlib.h>\n#include <string.h>\n#include <limits.h>\n\n\n// Translate an X11 key code to a GLFW key code.\n//\nstatic int translateKey(int keyCode)\n{\n    int keySym;\n\n    // Valid key code range is  [8,255], according to the XLib manual\n    if (keyCode < 8 || keyCode > 255)\n        return GLFW_KEY_UNKNOWN;\n\n    // Try secondary keysym, for numeric keypad keys\n    // Note: This way we always force \"NumLock = ON\", which is intentional\n    // since the returned key code should correspond to a physical\n    // location.\n    keySym = XkbKeycodeToKeysym(_glfw.x11.display, keyCode, 1, 0);\n    switch (keySym)\n    {\n        case XK_KP_0:           return GLFW_KEY_KP_0;\n        case XK_KP_1:           return GLFW_KEY_KP_1;\n        case XK_KP_2:           return GLFW_KEY_KP_2;\n        case XK_KP_3:           return GLFW_KEY_KP_3;\n        case XK_KP_4:           return GLFW_KEY_KP_4;\n        case XK_KP_5:           return GLFW_KEY_KP_5;\n        case XK_KP_6:           return GLFW_KEY_KP_6;\n        case XK_KP_7:           return GLFW_KEY_KP_7;\n        case XK_KP_8:           return GLFW_KEY_KP_8;\n        case XK_KP_9:           return GLFW_KEY_KP_9;\n        case XK_KP_Separator:\n        case XK_KP_Decimal:     return GLFW_KEY_KP_DECIMAL;\n        case XK_KP_Equal:       return GLFW_KEY_KP_EQUAL;\n        case XK_KP_Enter:       return GLFW_KEY_KP_ENTER;\n        default:                break;\n    }\n\n    // Now try pimary keysym for function keys (non-printable keys). These\n    // should not be layout dependent (i.e. US layout and international\n    // layouts should give the same result).\n    keySym = XkbKeycodeToKeysym(_glfw.x11.display, keyCode, 0, 0);\n    switch (keySym)\n    {\n        case XK_Escape:         return GLFW_KEY_ESCAPE;\n        case XK_Tab:            return GLFW_KEY_TAB;\n        case XK_Shift_L:        return GLFW_KEY_LEFT_SHIFT;\n        case XK_Shift_R:        return GLFW_KEY_RIGHT_SHIFT;\n        case XK_Control_L:      return GLFW_KEY_LEFT_CONTROL;\n        case XK_Control_R:      return GLFW_KEY_RIGHT_CONTROL;\n        case XK_Meta_L:\n        case XK_Alt_L:          return GLFW_KEY_LEFT_ALT;\n        case XK_Mode_switch: // Mapped to Alt_R on many keyboards\n        case XK_ISO_Level3_Shift: // AltGr on at least some machines\n        case XK_Meta_R:\n        case XK_Alt_R:          return GLFW_KEY_RIGHT_ALT;\n        case XK_Super_L:        return GLFW_KEY_LEFT_SUPER;\n        case XK_Super_R:        return GLFW_KEY_RIGHT_SUPER;\n        case XK_Menu:           return GLFW_KEY_MENU;\n        case XK_Num_Lock:       return GLFW_KEY_NUM_LOCK;\n        case XK_Caps_Lock:      return GLFW_KEY_CAPS_LOCK;\n        case XK_Print:          return GLFW_KEY_PRINT_SCREEN;\n        case XK_Scroll_Lock:    return GLFW_KEY_SCROLL_LOCK;\n        case XK_Pause:          return GLFW_KEY_PAUSE;\n        case XK_Delete:         return GLFW_KEY_DELETE;\n        case XK_BackSpace:      return GLFW_KEY_BACKSPACE;\n        case XK_Return:         return GLFW_KEY_ENTER;\n        case XK_Home:           return GLFW_KEY_HOME;\n        case XK_End:            return GLFW_KEY_END;\n        case XK_Page_Up:        return GLFW_KEY_PAGE_UP;\n        case XK_Page_Down:      return GLFW_KEY_PAGE_DOWN;\n        case XK_Insert:         return GLFW_KEY_INSERT;\n        case XK_Left:           return GLFW_KEY_LEFT;\n        case XK_Right:          return GLFW_KEY_RIGHT;\n        case XK_Down:           return GLFW_KEY_DOWN;\n        case XK_Up:             return GLFW_KEY_UP;\n        case XK_F1:             return GLFW_KEY_F1;\n        case XK_F2:             return GLFW_KEY_F2;\n        case XK_F3:             return GLFW_KEY_F3;\n        case XK_F4:             return GLFW_KEY_F4;\n        case XK_F5:             return GLFW_KEY_F5;\n        case XK_F6:             return GLFW_KEY_F6;\n        case XK_F7:             return GLFW_KEY_F7;\n        case XK_F8:             return GLFW_KEY_F8;\n        case XK_F9:             return GLFW_KEY_F9;\n        case XK_F10:            return GLFW_KEY_F10;\n        case XK_F11:            return GLFW_KEY_F11;\n        case XK_F12:            return GLFW_KEY_F12;\n        case XK_F13:            return GLFW_KEY_F13;\n        case XK_F14:            return GLFW_KEY_F14;\n        case XK_F15:            return GLFW_KEY_F15;\n        case XK_F16:            return GLFW_KEY_F16;\n        case XK_F17:            return GLFW_KEY_F17;\n        case XK_F18:            return GLFW_KEY_F18;\n        case XK_F19:            return GLFW_KEY_F19;\n        case XK_F20:            return GLFW_KEY_F20;\n        case XK_F21:            return GLFW_KEY_F21;\n        case XK_F22:            return GLFW_KEY_F22;\n        case XK_F23:            return GLFW_KEY_F23;\n        case XK_F24:            return GLFW_KEY_F24;\n        case XK_F25:            return GLFW_KEY_F25;\n\n        // Numeric keypad\n        case XK_KP_Divide:      return GLFW_KEY_KP_DIVIDE;\n        case XK_KP_Multiply:    return GLFW_KEY_KP_MULTIPLY;\n        case XK_KP_Subtract:    return GLFW_KEY_KP_SUBTRACT;\n        case XK_KP_Add:         return GLFW_KEY_KP_ADD;\n\n        // These should have been detected in secondary keysym test above!\n        case XK_KP_Insert:      return GLFW_KEY_KP_0;\n        case XK_KP_End:         return GLFW_KEY_KP_1;\n        case XK_KP_Down:        return GLFW_KEY_KP_2;\n        case XK_KP_Page_Down:   return GLFW_KEY_KP_3;\n        case XK_KP_Left:        return GLFW_KEY_KP_4;\n        case XK_KP_Right:       return GLFW_KEY_KP_6;\n        case XK_KP_Home:        return GLFW_KEY_KP_7;\n        case XK_KP_Up:          return GLFW_KEY_KP_8;\n        case XK_KP_Page_Up:     return GLFW_KEY_KP_9;\n        case XK_KP_Delete:      return GLFW_KEY_KP_DECIMAL;\n        case XK_KP_Equal:       return GLFW_KEY_KP_EQUAL;\n        case XK_KP_Enter:       return GLFW_KEY_KP_ENTER;\n\n        // Last resort: Check for printable keys (should not happen if the XKB\n        // extension is available). This will give a layout dependent mapping\n        // (which is wrong, and we may miss some keys, especially on non-US\n        // keyboards), but it's better than nothing...\n        case XK_a:              return GLFW_KEY_A;\n        case XK_b:              return GLFW_KEY_B;\n        case XK_c:              return GLFW_KEY_C;\n        case XK_d:              return GLFW_KEY_D;\n        case XK_e:              return GLFW_KEY_E;\n        case XK_f:              return GLFW_KEY_F;\n        case XK_g:              return GLFW_KEY_G;\n        case XK_h:              return GLFW_KEY_H;\n        case XK_i:              return GLFW_KEY_I;\n        case XK_j:              return GLFW_KEY_J;\n        case XK_k:              return GLFW_KEY_K;\n        case XK_l:              return GLFW_KEY_L;\n        case XK_m:              return GLFW_KEY_M;\n        case XK_n:              return GLFW_KEY_N;\n        case XK_o:              return GLFW_KEY_O;\n        case XK_p:              return GLFW_KEY_P;\n        case XK_q:              return GLFW_KEY_Q;\n        case XK_r:              return GLFW_KEY_R;\n        case XK_s:              return GLFW_KEY_S;\n        case XK_t:              return GLFW_KEY_T;\n        case XK_u:              return GLFW_KEY_U;\n        case XK_v:              return GLFW_KEY_V;\n        case XK_w:              return GLFW_KEY_W;\n        case XK_x:              return GLFW_KEY_X;\n        case XK_y:              return GLFW_KEY_Y;\n        case XK_z:              return GLFW_KEY_Z;\n        case XK_1:              return GLFW_KEY_1;\n        case XK_2:              return GLFW_KEY_2;\n        case XK_3:              return GLFW_KEY_3;\n        case XK_4:              return GLFW_KEY_4;\n        case XK_5:              return GLFW_KEY_5;\n        case XK_6:              return GLFW_KEY_6;\n        case XK_7:              return GLFW_KEY_7;\n        case XK_8:              return GLFW_KEY_8;\n        case XK_9:              return GLFW_KEY_9;\n        case XK_0:              return GLFW_KEY_0;\n        case XK_space:          return GLFW_KEY_SPACE;\n        case XK_minus:          return GLFW_KEY_MINUS;\n        case XK_equal:          return GLFW_KEY_EQUAL;\n        case XK_bracketleft:    return GLFW_KEY_LEFT_BRACKET;\n        case XK_bracketright:   return GLFW_KEY_RIGHT_BRACKET;\n        case XK_backslash:      return GLFW_KEY_BACKSLASH;\n        case XK_semicolon:      return GLFW_KEY_SEMICOLON;\n        case XK_apostrophe:     return GLFW_KEY_APOSTROPHE;\n        case XK_grave:          return GLFW_KEY_GRAVE_ACCENT;\n        case XK_comma:          return GLFW_KEY_COMMA;\n        case XK_period:         return GLFW_KEY_PERIOD;\n        case XK_slash:          return GLFW_KEY_SLASH;\n        case XK_less:           return GLFW_KEY_WORLD_1; // At least in some layouts...\n        default:                break;\n    }\n\n    // No matching translation was found\n    return GLFW_KEY_UNKNOWN;\n}\n\n// Update the key code LUT\n//\nstatic void updateKeyCodeLUT(void)\n{\n    int i, keyCode, keyCodeGLFW;\n    char name[XkbKeyNameLength + 1];\n    XkbDescPtr descr;\n\n    // Clear the LUT\n    for (keyCode = 0;  keyCode < 256;  keyCode++)\n        _glfw.x11.keyCodeLUT[keyCode] = GLFW_KEY_UNKNOWN;\n\n    // Use XKB to determine physical key locations independently of the current\n    // keyboard layout\n\n    // Get keyboard description\n    descr = XkbGetKeyboard(_glfw.x11.display,\n                            XkbAllComponentsMask,\n                            XkbUseCoreKbd);\n\n    // Find the X11 key code -> GLFW key code mapping\n    for (keyCode = descr->min_key_code; keyCode <= descr->max_key_code; ++keyCode)\n    {\n        // Get the key name\n        for (i = 0;  i < XkbKeyNameLength;  i++)\n            name[i] = descr->names->keys[keyCode].name[i];\n\n        name[XkbKeyNameLength] = 0;\n\n        // Map the key name to a GLFW key code. Note: We only map printable\n        // keys here, and we use the US keyboard layout. The rest of the\n        // keys (function keys) are mapped using traditional KeySym\n        // translations.\n        if (strcmp(name, \"TLDE\") == 0) keyCodeGLFW = GLFW_KEY_GRAVE_ACCENT;\n        else if (strcmp(name, \"AE01\") == 0) keyCodeGLFW = GLFW_KEY_1;\n        else if (strcmp(name, \"AE02\") == 0) keyCodeGLFW = GLFW_KEY_2;\n        else if (strcmp(name, \"AE03\") == 0) keyCodeGLFW = GLFW_KEY_3;\n        else if (strcmp(name, \"AE04\") == 0) keyCodeGLFW = GLFW_KEY_4;\n        else if (strcmp(name, \"AE05\") == 0) keyCodeGLFW = GLFW_KEY_5;\n        else if (strcmp(name, \"AE06\") == 0) keyCodeGLFW = GLFW_KEY_6;\n        else if (strcmp(name, \"AE07\") == 0) keyCodeGLFW = GLFW_KEY_7;\n        else if (strcmp(name, \"AE08\") == 0) keyCodeGLFW = GLFW_KEY_8;\n        else if (strcmp(name, \"AE09\") == 0) keyCodeGLFW = GLFW_KEY_9;\n        else if (strcmp(name, \"AE10\") == 0) keyCodeGLFW = GLFW_KEY_0;\n        else if (strcmp(name, \"AE11\") == 0) keyCodeGLFW = GLFW_KEY_MINUS;\n        else if (strcmp(name, \"AE12\") == 0) keyCodeGLFW = GLFW_KEY_EQUAL;\n        else if (strcmp(name, \"AD01\") == 0) keyCodeGLFW = GLFW_KEY_Q;\n        else if (strcmp(name, \"AD02\") == 0) keyCodeGLFW = GLFW_KEY_W;\n        else if (strcmp(name, \"AD03\") == 0) keyCodeGLFW = GLFW_KEY_E;\n        else if (strcmp(name, \"AD04\") == 0) keyCodeGLFW = GLFW_KEY_R;\n        else if (strcmp(name, \"AD05\") == 0) keyCodeGLFW = GLFW_KEY_T;\n        else if (strcmp(name, \"AD06\") == 0) keyCodeGLFW = GLFW_KEY_Y;\n        else if (strcmp(name, \"AD07\") == 0) keyCodeGLFW = GLFW_KEY_U;\n        else if (strcmp(name, \"AD08\") == 0) keyCodeGLFW = GLFW_KEY_I;\n        else if (strcmp(name, \"AD09\") == 0) keyCodeGLFW = GLFW_KEY_O;\n        else if (strcmp(name, \"AD10\") == 0) keyCodeGLFW = GLFW_KEY_P;\n        else if (strcmp(name, \"AD11\") == 0) keyCodeGLFW = GLFW_KEY_LEFT_BRACKET;\n        else if (strcmp(name, \"AD12\") == 0) keyCodeGLFW = GLFW_KEY_RIGHT_BRACKET;\n        else if (strcmp(name, \"AC01\") == 0) keyCodeGLFW = GLFW_KEY_A;\n        else if (strcmp(name, \"AC02\") == 0) keyCodeGLFW = GLFW_KEY_S;\n        else if (strcmp(name, \"AC03\") == 0) keyCodeGLFW = GLFW_KEY_D;\n        else if (strcmp(name, \"AC04\") == 0) keyCodeGLFW = GLFW_KEY_F;\n        else if (strcmp(name, \"AC05\") == 0) keyCodeGLFW = GLFW_KEY_G;\n        else if (strcmp(name, \"AC06\") == 0) keyCodeGLFW = GLFW_KEY_H;\n        else if (strcmp(name, \"AC07\") == 0) keyCodeGLFW = GLFW_KEY_J;\n        else if (strcmp(name, \"AC08\") == 0) keyCodeGLFW = GLFW_KEY_K;\n        else if (strcmp(name, \"AC09\") == 0) keyCodeGLFW = GLFW_KEY_L;\n        else if (strcmp(name, \"AC10\") == 0) keyCodeGLFW = GLFW_KEY_SEMICOLON;\n        else if (strcmp(name, \"AC11\") == 0) keyCodeGLFW = GLFW_KEY_APOSTROPHE;\n        else if (strcmp(name, \"AB01\") == 0) keyCodeGLFW = GLFW_KEY_Z;\n        else if (strcmp(name, \"AB02\") == 0) keyCodeGLFW = GLFW_KEY_X;\n        else if (strcmp(name, \"AB03\") == 0) keyCodeGLFW = GLFW_KEY_C;\n        else if (strcmp(name, \"AB04\") == 0) keyCodeGLFW = GLFW_KEY_V;\n        else if (strcmp(name, \"AB05\") == 0) keyCodeGLFW = GLFW_KEY_B;\n        else if (strcmp(name, \"AB06\") == 0) keyCodeGLFW = GLFW_KEY_N;\n        else if (strcmp(name, \"AB07\") == 0) keyCodeGLFW = GLFW_KEY_M;\n        else if (strcmp(name, \"AB08\") == 0) keyCodeGLFW = GLFW_KEY_COMMA;\n        else if (strcmp(name, \"AB09\") == 0) keyCodeGLFW = GLFW_KEY_PERIOD;\n        else if (strcmp(name, \"AB10\") == 0) keyCodeGLFW = GLFW_KEY_SLASH;\n        else if (strcmp(name, \"BKSL\") == 0) keyCodeGLFW = GLFW_KEY_BACKSLASH;\n        else if (strcmp(name, \"LSGT\") == 0) keyCodeGLFW = GLFW_KEY_WORLD_1;\n        else keyCodeGLFW = GLFW_KEY_UNKNOWN;\n\n        // Update the key code LUT\n        if ((keyCode >= 0) && (keyCode < 256))\n            _glfw.x11.keyCodeLUT[keyCode] = keyCodeGLFW;\n    }\n\n    // Free the keyboard description\n    XkbFreeKeyboard(descr, 0, True);\n\n    // Translate the un-translated key codes using traditional X11 KeySym\n    // lookups\n    for (keyCode = 0;  keyCode < 256;  keyCode++)\n    {\n        if (_glfw.x11.keyCodeLUT[keyCode] < 0)\n            _glfw.x11.keyCodeLUT[keyCode] = translateKey(keyCode);\n    }\n}\n\n// Check whether the specified atom is supported\n//\nstatic Atom getSupportedAtom(Atom* supportedAtoms,\n                             unsigned long atomCount,\n                             const char* atomName)\n{\n    Atom atom = XInternAtom(_glfw.x11.display, atomName, True);\n    if (atom != None)\n    {\n        unsigned long i;\n\n        for (i = 0;  i < atomCount;  i++)\n        {\n            if (supportedAtoms[i] == atom)\n                return atom;\n        }\n    }\n\n    return None;\n}\n\n// Check whether the running window manager is EWMH-compliant\n//\nstatic void detectEWMH(void)\n{\n    Window* windowFromRoot = NULL;\n    Window* windowFromChild = NULL;\n\n    // First we need a couple of atoms, which should already be there\n    Atom supportingWmCheck =\n        XInternAtom(_glfw.x11.display, \"_NET_SUPPORTING_WM_CHECK\", True);\n    Atom wmSupported =\n        XInternAtom(_glfw.x11.display, \"_NET_SUPPORTED\", True);\n    if (supportingWmCheck == None || wmSupported == None)\n        return;\n\n    // Then we look for the _NET_SUPPORTING_WM_CHECK property of the root window\n    if (_glfwGetWindowProperty(_glfw.x11.root,\n                               supportingWmCheck,\n                               XA_WINDOW,\n                               (unsigned char**) &windowFromRoot) != 1)\n    {\n        XFree(windowFromRoot);\n        return;\n    }\n\n    // It should be the ID of a child window (of the root)\n    // Then we look for the same property on the child window\n    if (_glfwGetWindowProperty(*windowFromRoot,\n                               supportingWmCheck,\n                               XA_WINDOW,\n                               (unsigned char**) &windowFromChild) != 1)\n    {\n        XFree(windowFromRoot);\n        XFree(windowFromChild);\n        return;\n    }\n\n    // It should be the ID of that same child window\n    if (*windowFromRoot != *windowFromChild)\n    {\n        XFree(windowFromRoot);\n        XFree(windowFromChild);\n        return;\n    }\n\n    XFree(windowFromRoot);\n    XFree(windowFromChild);\n\n    // We are now fairly sure that an EWMH-compliant window manager is running\n\n    Atom* supportedAtoms;\n    unsigned long atomCount;\n\n    // Now we need to check the _NET_SUPPORTED property of the root window\n    // It should be a list of supported WM protocol and state atoms\n    atomCount = _glfwGetWindowProperty(_glfw.x11.root,\n                                       wmSupported,\n                                       XA_ATOM,\n                                       (unsigned char**) &supportedAtoms);\n\n    // See which of the atoms we support that are supported by the WM\n\n    _glfw.x11.NET_WM_STATE =\n        getSupportedAtom(supportedAtoms, atomCount, \"_NET_WM_STATE\");\n    _glfw.x11.NET_WM_STATE_FULLSCREEN =\n        getSupportedAtom(supportedAtoms, atomCount, \"_NET_WM_STATE_FULLSCREEN\");\n    _glfw.x11.NET_WM_NAME =\n        getSupportedAtom(supportedAtoms, atomCount, \"_NET_WM_NAME\");\n    _glfw.x11.NET_WM_ICON_NAME =\n        getSupportedAtom(supportedAtoms, atomCount, \"_NET_WM_ICON_NAME\");\n    _glfw.x11.NET_WM_PID =\n        getSupportedAtom(supportedAtoms, atomCount, \"_NET_WM_PID\");\n    _glfw.x11.NET_WM_PING =\n        getSupportedAtom(supportedAtoms, atomCount, \"_NET_WM_PING\");\n    _glfw.x11.NET_ACTIVE_WINDOW =\n        getSupportedAtom(supportedAtoms, atomCount, \"_NET_ACTIVE_WINDOW\");\n\n    XFree(supportedAtoms);\n\n    _glfw.x11.hasEWMH = GL_TRUE;\n}\n\n// Initialize X11 display and look for supported X11 extensions\n//\nstatic GLboolean initDisplay(void)\n{\n    Bool supported;\n\n    _glfw.x11.display = XOpenDisplay(NULL);\n    if (!_glfw.x11.display)\n    {\n        _glfwInputError(GLFW_API_UNAVAILABLE, \"X11: Failed to open X display\");\n        return GL_FALSE;\n    }\n\n    _glfw.x11.screen = DefaultScreen(_glfw.x11.display);\n    _glfw.x11.root = RootWindow(_glfw.x11.display, _glfw.x11.screen);\n    _glfw.x11.context = XUniqueContext();\n\n    // Find or create window manager atoms\n    _glfw.x11.WM_STATE = XInternAtom(_glfw.x11.display, \"WM_STATE\", False);\n    _glfw.x11.WM_DELETE_WINDOW = XInternAtom(_glfw.x11.display,\n                                             \"WM_DELETE_WINDOW\",\n                                             False);\n    _glfw.x11.MOTIF_WM_HINTS = XInternAtom(_glfw.x11.display,\n                                           \"_MOTIF_WM_HINTS\",\n                                           False);\n\n    // Check for XF86VidMode extension\n    _glfw.x11.vidmode.available =\n        XF86VidModeQueryExtension(_glfw.x11.display,\n                                  &_glfw.x11.vidmode.eventBase,\n                                  &_glfw.x11.vidmode.errorBase);\n\n    // Check for RandR extension\n    _glfw.x11.randr.available =\n        XRRQueryExtension(_glfw.x11.display,\n                          &_glfw.x11.randr.eventBase,\n                          &_glfw.x11.randr.errorBase);\n\n    if (_glfw.x11.randr.available)\n    {\n        if (!XRRQueryVersion(_glfw.x11.display,\n                             &_glfw.x11.randr.versionMajor,\n                             &_glfw.x11.randr.versionMinor))\n        {\n            _glfwInputError(GLFW_PLATFORM_ERROR,\n                            \"X11: Failed to query RandR version\");\n            return GL_FALSE;\n        }\n\n        // The GLFW RandR path requires at least version 1.3\n        if (_glfw.x11.randr.versionMajor == 1 &&\n            _glfw.x11.randr.versionMinor < 3)\n        {\n            _glfw.x11.randr.available = GL_FALSE;\n        }\n    }\n\n    if (XQueryExtension(_glfw.x11.display,\n                        \"XInputExtension\",\n                        &_glfw.x11.xi.majorOpcode,\n                        &_glfw.x11.xi.eventBase,\n                        &_glfw.x11.xi.errorBase))\n    {\n        _glfw.x11.xi.versionMajor = 2;\n        _glfw.x11.xi.versionMinor = 0;\n\n        if (XIQueryVersion(_glfw.x11.display,\n                           &_glfw.x11.xi.versionMajor,\n                           &_glfw.x11.xi.versionMinor) != BadRequest)\n        {\n            _glfw.x11.xi.available = GL_TRUE;\n        }\n    }\n\n    // Check if Xkb is supported on this display\n    _glfw.x11.xkb.versionMajor = 1;\n    _glfw.x11.xkb.versionMinor = 0;\n    if (!XkbQueryExtension(_glfw.x11.display,\n                           &_glfw.x11.xkb.majorOpcode,\n                           &_glfw.x11.xkb.eventBase,\n                           &_glfw.x11.xkb.errorBase,\n                           &_glfw.x11.xkb.versionMajor,\n                           &_glfw.x11.xkb.versionMinor))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"X11: The keyboard extension is not available\");\n        return GL_FALSE;\n    }\n\n    if (!XkbSetDetectableAutoRepeat(_glfw.x11.display, True, &supported))\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"X11: Failed to set detectable key repeat\");\n        return GL_FALSE;\n    }\n\n    if (!supported)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR,\n                        \"X11: Detectable key repeat is not supported\");\n        return GL_FALSE;\n    }\n\n    // Update the key code LUT\n    // FIXME: We should listen to XkbMapNotify events to track changes to\n    // the keyboard mapping.\n    updateKeyCodeLUT();\n\n    // Detect whether an EWMH-conformant window manager is running\n    detectEWMH();\n\n    // Find or create string format atoms\n    _glfw.x11.UTF8_STRING =\n        XInternAtom(_glfw.x11.display, \"UTF8_STRING\", False);\n    _glfw.x11.COMPOUND_STRING =\n        XInternAtom(_glfw.x11.display, \"COMPOUND_STRING\", False);\n    _glfw.x11.ATOM_PAIR = XInternAtom(_glfw.x11.display, \"ATOM_PAIR\", False);\n\n    // Find or create selection property atom\n    _glfw.x11.GLFW_SELECTION =\n        XInternAtom(_glfw.x11.display, \"GLFW_SELECTION\", False);\n\n    // Find or create standard clipboard atoms\n    _glfw.x11.TARGETS = XInternAtom(_glfw.x11.display, \"TARGETS\", False);\n    _glfw.x11.MULTIPLE = XInternAtom(_glfw.x11.display, \"MULTIPLE\", False);\n    _glfw.x11.CLIPBOARD = XInternAtom(_glfw.x11.display, \"CLIPBOARD\", False);\n\n    // Find or create clipboard manager atoms\n    _glfw.x11.CLIPBOARD_MANAGER =\n        XInternAtom(_glfw.x11.display, \"CLIPBOARD_MANAGER\", False);\n    _glfw.x11.SAVE_TARGETS =\n        XInternAtom(_glfw.x11.display, \"SAVE_TARGETS\", False);\n\n    return GL_TRUE;\n}\n\n// Create a blank cursor (for locked mouse mode)\n//\nstatic Cursor createNULLCursor(void)\n{\n    Pixmap cursormask;\n    XGCValues xgc;\n    GC gc;\n    XColor col;\n    Cursor cursor;\n\n    // TODO: Add error checks\n\n    cursormask = XCreatePixmap(_glfw.x11.display, _glfw.x11.root, 1, 1, 1);\n    xgc.function = GXclear;\n    gc = XCreateGC(_glfw.x11.display, cursormask, GCFunction, &xgc);\n    XFillRectangle(_glfw.x11.display, cursormask, gc, 0, 0, 1, 1);\n    col.pixel = 0;\n    col.red = 0;\n    col.flags = 4;\n    cursor = XCreatePixmapCursor(_glfw.x11.display,\n                                 cursormask, cursormask,\n                                 &col, &col, 0, 0);\n    XFreePixmap(_glfw.x11.display, cursormask);\n    XFreeGC(_glfw.x11.display, gc);\n\n    return cursor;\n}\n\n// Terminate X11 display\n//\nstatic void terminateDisplay(void)\n{\n    if (_glfw.x11.display)\n    {\n        XCloseDisplay(_glfw.x11.display);\n        _glfw.x11.display = NULL;\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformInit(void)\n{\n    XInitThreads();\n\n    if (!initDisplay())\n        return GL_FALSE;\n\n    _glfwInitGammaRamp();\n\n    if (!_glfwInitContextAPI())\n        return GL_FALSE;\n\n    _glfw.x11.cursor = createNULLCursor();\n\n    if (!_glfwInitJoysticks())\n        return GL_FALSE;\n\n    _glfwInitTimer();\n\n    return GL_TRUE;\n}\n\nvoid _glfwPlatformTerminate(void)\n{\n    if (_glfw.x11.cursor)\n    {\n        XFreeCursor(_glfw.x11.display, _glfw.x11.cursor);\n        _glfw.x11.cursor = (Cursor) 0;\n    }\n\n    _glfwTerminateJoysticks();\n\n    _glfwTerminateContextAPI();\n\n    terminateDisplay();\n\n    if (_glfw.x11.selection.string)\n        free(_glfw.x11.selection.string);\n}\n\nconst char* _glfwPlatformGetVersionString(void)\n{\n    const char* version = _GLFW_VERSION_FULL \" X11\"\n#if defined(_GLFW_GLX)\n        \" GLX\"\n#elif defined(_GLFW_EGL)\n        \" EGL\"\n#endif\n#if defined(_GLFW_HAS_GLXGETPROCADDRESS)\n        \" glXGetProcAddress\"\n#elif defined(_GLFW_HAS_GLXGETPROCADDRESSARB)\n        \" glXGetProcAddressARB\"\n#elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT)\n        \" glXGetProcAddressEXT\"\n#elif defined(_GLFW_DLOPEN_LIBGL)\n        \" dlsym(libGL)\"\n#endif\n#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK)\n        \" clock_gettime\"\n#endif\n#if defined(__linux__)\n        \" /dev/js\"\n#endif\n#if defined(_GLFW_BUILD_DLL)\n        \" shared\"\n#endif\n        ;\n\n    return version;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_joystick.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#ifdef __linux__\n#include <linux/joystick.h>\n\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <errno.h>\n#include <regex.h>\n#include <dirent.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#endif // __linux__\n\n\n// Attempt to open the specified joystick device\n//\nstatic int openJoystickDevice(int joy, const char* path)\n{\n#ifdef __linux__\n    char axisCount, buttonCount;\n    char name[256];\n    int fd, version;\n\n    fd = open(path, O_RDONLY | O_NONBLOCK);\n    if (fd == -1)\n        return GL_FALSE;\n\n    _glfw.x11.joystick[joy].fd = fd;\n\n    // Verify that the joystick driver version is at least 1.0\n    ioctl(fd, JSIOCGVERSION, &version);\n    if (version < 0x010000)\n    {\n        // It's an old 0.x interface (we don't support it)\n        close(fd);\n        return GL_FALSE;\n    }\n\n    if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0)\n        strncpy(name, \"Unknown\", sizeof(name));\n\n    _glfw.x11.joystick[joy].name = strdup(name);\n\n    ioctl(fd, JSIOCGAXES, &axisCount);\n    _glfw.x11.joystick[joy].axisCount = (int) axisCount;\n\n    ioctl(fd, JSIOCGBUTTONS, &buttonCount);\n    _glfw.x11.joystick[joy].buttonCount = (int) buttonCount;\n\n    _glfw.x11.joystick[joy].axes = (float*) calloc(axisCount, sizeof(float));\n    _glfw.x11.joystick[joy].buttons = (unsigned char*) calloc(buttonCount, 1);\n\n    _glfw.x11.joystick[joy].present = GL_TRUE;\n#endif // __linux__\n\n    return GL_TRUE;\n}\n\n// Polls for and processes events for all present joysticks\n//\nstatic void pollJoystickEvents(void)\n{\n#ifdef __linux__\n    int i;\n    ssize_t result;\n    struct js_event e;\n\n    for (i = 0;  i <= GLFW_JOYSTICK_LAST;  i++)\n    {\n        if (!_glfw.x11.joystick[i].present)\n            continue;\n\n        // Read all queued events (non-blocking)\n        for (;;)\n        {\n            errno = 0;\n            result = read(_glfw.x11.joystick[i].fd, &e, sizeof(e));\n\n            if (errno == ENODEV)\n            {\n                free(_glfw.x11.joystick[i].axes);\n                free(_glfw.x11.joystick[i].buttons);\n                free(_glfw.x11.joystick[i].name);\n                _glfw.x11.joystick[i].present = GL_FALSE;\n            }\n\n            if (result == -1)\n                break;\n\n            // We don't care if it's an init event or not\n            e.type &= ~JS_EVENT_INIT;\n\n            switch (e.type)\n            {\n                case JS_EVENT_AXIS:\n                    _glfw.x11.joystick[i].axes[e.number] =\n                        (float) e.value / 32767.0f;\n\n                    // We need to change the sign for the Y axes, so that\n                    // positive = up/forward, according to the GLFW spec.\n                    if (e.number & 1)\n                    {\n                        _glfw.x11.joystick[i].axes[e.number] =\n                            -_glfw.x11.joystick[i].axes[e.number];\n                    }\n\n                    break;\n\n                case JS_EVENT_BUTTON:\n                    _glfw.x11.joystick[i].buttons[e.number] =\n                        e.value ? GLFW_PRESS : GLFW_RELEASE;\n                    break;\n\n                default:\n                    break;\n            }\n        }\n    }\n#endif // __linux__\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialize joystick interface\n//\nint _glfwInitJoysticks(void)\n{\n#ifdef __linux__\n    int i, joy = 0;\n    regex_t regex;\n    DIR* dir;\n    const char* dirs[] =\n    {\n        \"/dev/input\",\n        \"/dev\"\n    };\n\n    if (regcomp(&regex, \"^js[0-9]\\\\+$\", 0) != 0)\n    {\n        _glfwInputError(GLFW_PLATFORM_ERROR, \"X11: Failed to compile regex\");\n        return GL_FALSE;\n    }\n\n    for (i = 0;  i < sizeof(dirs) / sizeof(dirs[0]);  i++)\n    {\n        struct dirent* entry;\n\n        dir = opendir(dirs[i]);\n        if (!dir)\n            continue;\n\n        while ((entry = readdir(dir)))\n        {\n            char path[20];\n            regmatch_t match;\n\n            if (regexec(&regex, entry->d_name, 1, &match, 0) != 0)\n                continue;\n\n            snprintf(path, sizeof(path), \"%s/%s\", dirs[i], entry->d_name);\n            if (openJoystickDevice(joy, path))\n                joy++;\n        }\n\n        closedir(dir);\n    }\n\n    regfree(&regex);\n#endif // __linux__\n\n    return GL_TRUE;\n}\n\n// Close all opened joystick handles\n//\nvoid _glfwTerminateJoysticks(void)\n{\n#ifdef __linux__\n    int i;\n\n    for (i = 0;  i <= GLFW_JOYSTICK_LAST;  i++)\n    {\n        if (_glfw.x11.joystick[i].present)\n        {\n            close(_glfw.x11.joystick[i].fd);\n            free(_glfw.x11.joystick[i].axes);\n            free(_glfw.x11.joystick[i].buttons);\n            free(_glfw.x11.joystick[i].name);\n\n            _glfw.x11.joystick[i].present = GL_FALSE;\n        }\n    }\n#endif // __linux__\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformJoystickPresent(int joy)\n{\n    pollJoystickEvents();\n\n    return _glfw.x11.joystick[joy].present;\n}\n\nconst float* _glfwPlatformGetJoystickAxes(int joy, int* count)\n{\n    pollJoystickEvents();\n\n    if (!_glfw.x11.joystick[joy].present)\n        return NULL;\n\n    *count = _glfw.x11.joystick[joy].axisCount;\n    return _glfw.x11.joystick[joy].axes;\n}\n\nconst unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)\n{\n    pollJoystickEvents();\n\n    if (!_glfw.x11.joystick[joy].present)\n        return NULL;\n\n    *count = _glfw.x11.joystick[joy].buttonCount;\n    return _glfw.x11.joystick[joy].buttons;\n}\n\nconst char* _glfwPlatformGetJoystickName(int joy)\n{\n    pollJoystickEvents();\n\n    return _glfw.x11.joystick[joy].name;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_monitor.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11 (Unix)\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <limits.h>\n#include <stdlib.h>\n#include <string.h>\n\n\nstatic int calculateRefreshRate(const XRRModeInfo* mi)\n{\n    if (!mi->hTotal || !mi->vTotal)\n        return 0;\n\n    return (int) ((double) mi->dotClock / ((double) mi->hTotal * (double) mi->vTotal));\n}\n\nstatic const XRRModeInfo* getModeInfo(const XRRScreenResources* sr, RRMode id)\n{\n    int i;\n\n    for (i = 0;  i < sr->nmode;  i++)\n    {\n        if (sr->modes[i].id == id)\n            return sr->modes + i;\n    }\n\n    return NULL;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Set the current video mode for the specified monitor\n//\nvoid _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)\n{\n    if (_glfw.x11.randr.available)\n    {\n        int i, j;\n        XRRScreenResources* sr;\n        XRRCrtcInfo* ci;\n        XRROutputInfo* oi;\n        RRMode bestMode = 0;\n        unsigned int sizeDiff, leastSizeDiff = UINT_MAX;\n        unsigned int rateDiff, leastRateDiff = UINT_MAX;\n\n        sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);\n        ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);\n        oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output);\n\n        for (i = 0;  i < sr->nmode;  i++)\n        {\n            const XRRModeInfo* mi = sr->modes + i;\n\n            if (mi->modeFlags & RR_Interlace)\n                continue;\n\n            for (j = 0;  j < oi->nmode;  j++)\n            {\n                if (oi->modes[j] == mi->id)\n                    break;\n            }\n\n            if (j == oi->nmode)\n                continue;\n\n            sizeDiff = (mi->width - desired->width) *\n                       (mi->width - desired->width) +\n                       (mi->height - desired->height) *\n                       (mi->height - desired->height);\n\n            if (desired->refreshRate)\n                rateDiff = abs(calculateRefreshRate(mi) - desired->refreshRate);\n            else\n                rateDiff = UINT_MAX - calculateRefreshRate(mi);\n\n            if ((sizeDiff < leastSizeDiff) ||\n                (sizeDiff == leastSizeDiff && rateDiff < leastRateDiff))\n            {\n                bestMode = mi->id;\n                leastSizeDiff = sizeDiff;\n                leastRateDiff = rateDiff;\n            }\n        }\n\n        monitor->x11.oldMode = ci->mode;\n\n        XRRSetCrtcConfig(_glfw.x11.display,\n                         sr, monitor->x11.crtc,\n                         CurrentTime,\n                         ci->x, ci->y,\n                         bestMode,\n                         ci->rotation,\n                         ci->outputs,\n                         ci->noutput);\n\n        XRRFreeOutputInfo(oi);\n        XRRFreeCrtcInfo(ci);\n        XRRFreeScreenResources(sr);\n    }\n}\n\n// Restore the saved (original) video mode for the specified monitor\n//\nvoid _glfwRestoreVideoMode(_GLFWmonitor* monitor)\n{\n    if (_glfw.x11.randr.available)\n    {\n        XRRScreenResources* sr;\n        XRRCrtcInfo* ci;\n\n        sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);\n        ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);\n\n        XRRSetCrtcConfig(_glfw.x11.display,\n                         sr, monitor->x11.crtc,\n                         CurrentTime,\n                         ci->x, ci->y,\n                         monitor->x11.oldMode,\n                         ci->rotation,\n                         ci->outputs,\n                         ci->noutput);\n\n        XRRFreeCrtcInfo(ci);\n        XRRFreeScreenResources(sr);\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n_GLFWmonitor** _glfwPlatformGetMonitors(int* count)\n{\n    _GLFWmonitor** monitors = NULL;\n\n    *count = 0;\n\n    if (_glfw.x11.randr.available)\n    {\n        int i, found = 0;\n        RROutput primary;\n        XRRScreenResources* sr;\n\n        sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);\n        primary = XRRGetOutputPrimary(_glfw.x11.display, _glfw.x11.root);\n\n        monitors = (_GLFWmonitor**) calloc(sr->ncrtc, sizeof(_GLFWmonitor*));\n\n        for (i = 0;  i < sr->ncrtc;  i++)\n        {\n            int j;\n            XRROutputInfo* oi;\n            XRRCrtcInfo* ci;\n            RROutput output;\n\n            ci = XRRGetCrtcInfo(_glfw.x11.display, sr, sr->crtcs[i]);\n            if (ci->noutput == 0)\n            {\n                XRRFreeCrtcInfo(ci);\n                continue;\n            }\n\n            output = ci->outputs[0];\n\n            for (j = 0;  j < ci->noutput;  j++)\n            {\n                if (ci->outputs[j] == primary)\n                {\n                    output = primary;\n                    break;\n                }\n            }\n\n            oi = XRRGetOutputInfo(_glfw.x11.display, sr, output);\n            if (oi->connection != RR_Connected)\n            {\n                XRRFreeOutputInfo(oi);\n                XRRFreeCrtcInfo(ci);\n                continue;\n            }\n\n            monitors[found] = _glfwCreateMonitor(oi->name,\n                                                 oi->mm_width, oi->mm_height);\n\n            monitors[found]->x11.output = output;\n            monitors[found]->x11.crtc   = oi->crtc;\n\n            XRRFreeOutputInfo(oi);\n            XRRFreeCrtcInfo(ci);\n\n            found++;\n        }\n\n        XRRFreeScreenResources(sr);\n\n        for (i = 0;  i < found;  i++)\n        {\n            if (monitors[i]->x11.output == primary)\n            {\n                _GLFWmonitor* temp = monitors[0];\n                monitors[0] = monitors[i];\n                monitors[i] = temp;\n                break;\n            }\n        }\n\n        if (found == 0)\n        {\n            free(monitors);\n            monitors = NULL;\n        }\n\n        *count = found;\n    }\n    else\n    {\n        monitors = (_GLFWmonitor**) calloc(1, sizeof(_GLFWmonitor*));\n        monitors[0] = _glfwCreateMonitor(\"Display\",\n                                         DisplayWidthMM(_glfw.x11.display,\n                                                        _glfw.x11.screen),\n                                         DisplayHeightMM(_glfw.x11.display,\n                                                         _glfw.x11.screen));\n        *count = 1;\n    }\n\n    return monitors;\n}\n\nGLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)\n{\n    return first->x11.crtc == second->x11.crtc;\n}\n\nvoid _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)\n{\n    if (_glfw.x11.randr.available)\n    {\n        XRRScreenResources* sr;\n        XRRCrtcInfo* ci;\n\n        sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);\n        ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);\n\n        if (xpos)\n            *xpos = ci->x;\n        if (ypos)\n            *ypos = ci->y;\n\n        XRRFreeCrtcInfo(ci);\n        XRRFreeScreenResources(sr);\n    }\n    else\n    {\n        if (xpos)\n            *xpos = 0;\n        if (ypos)\n            *ypos = 0;\n    }\n}\n\nGLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)\n{\n    GLFWvidmode* result;\n    int depth, r, g, b;\n\n    depth = DefaultDepth(_glfw.x11.display, _glfw.x11.screen);\n    _glfwSplitBPP(depth, &r, &g, &b);\n\n    *found = 0;\n\n    // Build array of available resolutions\n\n    if (_glfw.x11.randr.available)\n    {\n        int i, j;\n        XRRScreenResources* sr;\n        XRROutputInfo* oi;\n\n        sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);\n        oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output);\n\n        result = (GLFWvidmode*) malloc(sizeof(GLFWvidmode) * oi->nmode);\n\n        for (i = 0;  i < oi->nmode;  i++)\n        {\n            GLFWvidmode mode;\n            const XRRModeInfo* mi = getModeInfo(sr, oi->modes[i]);\n\n            mode.width  = mi->width;\n            mode.height = mi->height;\n            mode.refreshRate = calculateRefreshRate(mi);\n\n            for (j = 0;  j < *found;  j++)\n            {\n                if (result[j].width == mode.width &&\n                    result[j].height == mode.height &&\n                    result[j].refreshRate == mode.refreshRate)\n                {\n                    break;\n                }\n            }\n\n            if (j < *found)\n            {\n                // This is a duplicate, so skip it\n                continue;\n            }\n\n            mode.redBits = r;\n            mode.greenBits = g;\n            mode.blueBits = b;\n\n            result[*found] = mode;\n            (*found)++;\n        }\n\n        XRRFreeOutputInfo(oi);\n        XRRFreeScreenResources(sr);\n    }\n    else\n    {\n        *found = 1;\n\n        result = (GLFWvidmode*) malloc(sizeof(GLFWvidmode));\n\n        result[0].width = DisplayWidth(_glfw.x11.display, _glfw.x11.screen);\n        result[0].height = DisplayHeight(_glfw.x11.display, _glfw.x11.screen);\n        result[0].redBits = r;\n        result[0].greenBits = g;\n        result[0].blueBits = b;\n        result[0].refreshRate = 0;\n    }\n\n    return result;\n}\n\nvoid _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)\n{\n    if (_glfw.x11.randr.available)\n    {\n        XRRScreenResources* sr;\n        XRRCrtcInfo* ci;\n\n        sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);\n        ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);\n\n        mode->width = ci->width;\n        mode->height = ci->height;\n\n        mode->refreshRate = calculateRefreshRate(getModeInfo(sr, ci->mode));\n\n        XRRFreeCrtcInfo(ci);\n        XRRFreeScreenResources(sr);\n    }\n    else\n    {\n        mode->width = DisplayWidth(_glfw.x11.display, _glfw.x11.screen);\n        mode->height = DisplayHeight(_glfw.x11.display, _glfw.x11.screen);\n        mode->refreshRate = 0;\n    }\n\n    _glfwSplitBPP(DefaultDepth(_glfw.x11.display, _glfw.x11.screen),\n                  &mode->redBits, &mode->greenBits, &mode->blueBits);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_platform.h",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#ifndef _x11_platform_h_\n#define _x11_platform_h_\n\n#include <unistd.h>\n#include <signal.h>\n#include <stdint.h>\n#include <X11/Xlib.h>\n#include <X11/keysym.h>\n#include <X11/Xatom.h>\n\n// The Xf86VidMode extension provides fallback gamma control\n#include <X11/extensions/xf86vmode.h>\n\n// The XRandR extension provides mode setting and gamma control\n#include <X11/extensions/Xrandr.h>\n\n// The XInput2 extension provides improved input events\n#include <X11/extensions/XInput2.h>\n\n// The Xkb extension provides improved keyboard support\n#include <X11/XKBlib.h>\n\n#if defined(_GLFW_GLX)\n #define _GLFW_X11_CONTEXT_VISUAL window->glx.visual\n #include \"glx_platform.h\"\n#elif defined(_GLFW_EGL)\n #define _GLFW_X11_CONTEXT_VISUAL window->egl.visual\n #define _GLFW_EGL_NATIVE_WINDOW  window->x11.handle\n #define _GLFW_EGL_NATIVE_DISPLAY _glfw.x11.display\n #include \"egl_platform.h\"\n#else\n #error \"No supported context creation API selected\"\n#endif\n\n#define _GLFW_PLATFORM_WINDOW_STATE         _GLFWwindowX11  x11\n#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryX11 x11\n#define _GLFW_PLATFORM_MONITOR_STATE        _GLFWmonitorX11 x11\n\n\n//========================================================================\n// GLFW platform specific types\n//========================================================================\n\n\n//------------------------------------------------------------------------\n// Platform-specific window structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWwindowX11\n{\n    // Platform specific window resources\n    Colormap        colormap;          // Window colormap\n    Window          handle;            // Window handle\n\n    // Various platform specific internal variables\n    GLboolean       overrideRedirect; // True if window is OverrideRedirect\n    GLboolean       cursorGrabbed;    // True if cursor is currently grabbed\n    GLboolean       cursorHidden;     // True if cursor is currently hidden\n\n    // Cached position and size used to filter out duplicate events\n    int             width, height;\n    int             xpos, ypos;\n\n    // The last received cursor position, regardless of source\n    double          cursorPosX, cursorPosY;\n    // The last position the cursor was warped to by GLFW\n    int             warpPosX, warpPosY;\n\n} _GLFWwindowX11;\n\n\n//------------------------------------------------------------------------\n// Platform-specific library global data for X11\n//------------------------------------------------------------------------\ntypedef struct _GLFWlibraryX11\n{\n    Display*        display;\n    int             screen;\n    Window          root;\n\n    // Invisible cursor for hidden cursor mode\n    Cursor          cursor;\n    XContext        context;\n\n    // Window manager atoms\n    Atom            WM_STATE;\n    Atom            WM_DELETE_WINDOW;\n    Atom            NET_WM_NAME;\n    Atom            NET_WM_ICON_NAME;\n    Atom            NET_WM_PID;\n    Atom            NET_WM_PING;\n    Atom            NET_WM_STATE;\n    Atom            NET_WM_STATE_FULLSCREEN;\n    Atom            NET_ACTIVE_WINDOW;\n    Atom            MOTIF_WM_HINTS;\n\n    // Selection atoms\n    Atom            TARGETS;\n    Atom            MULTIPLE;\n    Atom            CLIPBOARD;\n    Atom            CLIPBOARD_MANAGER;\n    Atom            SAVE_TARGETS;\n    Atom            UTF8_STRING;\n    Atom            COMPOUND_STRING;\n    Atom            ATOM_PAIR;\n    Atom            GLFW_SELECTION;\n\n    // True if window manager supports EWMH\n    GLboolean       hasEWMH;\n\n    struct {\n        GLboolean   available;\n        int         eventBase;\n        int         errorBase;\n    } vidmode;\n\n    struct {\n        GLboolean   available;\n        int         eventBase;\n        int         errorBase;\n        int         versionMajor;\n        int         versionMinor;\n        GLboolean   gammaBroken;\n    } randr;\n\n    struct {\n        int         majorOpcode;\n        int         eventBase;\n        int         errorBase;\n        int         versionMajor;\n        int         versionMinor;\n    } xkb;\n\n    struct {\n        GLboolean   available;\n        int         majorOpcode;\n        int         eventBase;\n        int         errorBase;\n        int         versionMajor;\n        int         versionMinor;\n    } xi;\n\n    // LUT for mapping X11 key codes to GLFW key codes\n    int             keyCodeLUT[256];\n\n    struct {\n        GLboolean   changed;\n        int         timeout;\n        int         interval;\n        int         blanking;\n        int         exposure;\n    } saver;\n\n    struct {\n        GLboolean   monotonic;\n        double      resolution;\n        uint64_t    base;\n    } timer;\n\n    struct {\n        char*       string;\n    } selection;\n\n    struct {\n        int         present;\n        int         fd;\n        float*      axes;\n        int         axisCount;\n        unsigned char* buttons;\n        int         buttonCount;\n        char*       name;\n    } joystick[GLFW_JOYSTICK_LAST + 1];\n\n} _GLFWlibraryX11;\n\n\n//------------------------------------------------------------------------\n// Platform-specific monitor structure\n//------------------------------------------------------------------------\ntypedef struct _GLFWmonitorX11\n{\n    RROutput        output;\n    RRCrtc          crtc;\n    RRMode          oldMode;\n\n} _GLFWmonitorX11;\n\n\n//========================================================================\n// Prototypes for platform specific internal functions\n//========================================================================\n\n// Time\nvoid _glfwInitTimer(void);\n\n// Gamma\nvoid _glfwInitGammaRamp(void);\n\n// OpenGL support\nint _glfwInitContextAPI(void);\nvoid _glfwTerminateContextAPI(void);\nint _glfwCreateContext(_GLFWwindow* window,\n                       const _GLFWwndconfig* wndconfig,\n                       const _GLFWfbconfig* fbconfig);\nvoid _glfwDestroyContext(_GLFWwindow* window);\n\n// Fullscreen support\nvoid _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);\nvoid _glfwRestoreVideoMode(_GLFWmonitor* monitor);\n\n// Joystick input\nint  _glfwInitJoysticks(void);\nvoid _glfwTerminateJoysticks(void);\n\n// Unicode support\nlong _glfwKeySym2Unicode(KeySym keysym);\n\n// Clipboard handling\nvoid _glfwHandleSelectionClear(XEvent* event);\nvoid _glfwHandleSelectionRequest(XEvent* event);\nvoid _glfwPushSelectionToManager(_GLFWwindow* window);\n\n// Window support\n_GLFWwindow* _glfwFindWindowByHandle(Window handle);\nunsigned long _glfwGetWindowProperty(Window window,\n                                     Atom property,\n                                     Atom type,\n                                     unsigned char** value);\n\n#endif // _x11_platform_h_\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_time.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <sys/time.h>\n#include <time.h>\n\n\n// Return raw time\n//\nstatic uint64_t getRawTime(void)\n{\n#if defined(CLOCK_MONOTONIC)\n    if (_glfw.x11.timer.monotonic)\n    {\n        struct timespec ts;\n\n        clock_gettime(CLOCK_MONOTONIC, &ts);\n        return (uint64_t) ts.tv_sec * (uint64_t) 1000000000 + (uint64_t) ts.tv_nsec;\n    }\n    else\n#endif\n    {\n        struct timeval tv;\n\n        gettimeofday(&tv, NULL);\n        return (uint64_t) tv.tv_sec * (uint64_t) 1000000 + (uint64_t) tv.tv_usec;\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Initialise timer\n//\nvoid _glfwInitTimer(void)\n{\n#if defined(CLOCK_MONOTONIC)\n    struct timespec ts;\n\n    if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)\n    {\n        _glfw.x11.timer.monotonic = GL_TRUE;\n        _glfw.x11.timer.resolution = 1e-9;\n    }\n    else\n#endif\n    {\n        _glfw.x11.timer.resolution = 1e-6;\n    }\n\n    _glfw.x11.timer.base = getRawTime();\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\ndouble _glfwPlatformGetTime(void)\n{\n    return (double) (getRawTime() - _glfw.x11.timer.base) *\n        _glfw.x11.timer.resolution;\n}\n\nvoid _glfwPlatformSetTime(double time)\n{\n    _glfw.x11.timer.base = getRawTime() -\n        (uint64_t) (time / _glfw.x11.timer.resolution);\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_unicode.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n\n/*\n * Marcus: This code was originally written by Markus G. Kuhn.\n * I have made some slight changes (trimmed it down a bit from >60 KB to\n * 20 KB), but the functionality is the same.\n */\n\n/*\n * This module converts keysym values into the corresponding ISO 10646\n * (UCS, Unicode) values.\n *\n * The array keysymtab[] contains pairs of X11 keysym values for graphical\n * characters and the corresponding Unicode value. The function\n * _glfwKeySym2Unicode() maps a keysym onto a Unicode value using a binary\n * search, therefore keysymtab[] must remain SORTED by keysym value.\n *\n * We allow to represent any UCS character in the range U-00000000 to\n * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.\n * This admittedly does not cover the entire 31-bit space of UCS, but\n * it does cover all of the characters up to U-10FFFF, which can be\n * represented by UTF-16, and more, and it is very unlikely that higher\n * UCS codes will ever be assigned by ISO. So to get Unicode character\n * U+ABCD you can directly use keysym 0x0100abcd.\n *\n * Original author: Markus G. Kuhn <mkuhn@acm.org>, University of\n *                  Cambridge, April 2001\n *\n * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing\n * an initial draft of the mapping table.\n *\n */\n\n\n//************************************************************************\n//****                KeySym to Unicode mapping table                 ****\n//************************************************************************\n\nstatic struct codepair {\n  unsigned short keysym;\n  unsigned short ucs;\n} keysymtab[] = {\n  { 0x01a1, 0x0104 },\n  { 0x01a2, 0x02d8 },\n  { 0x01a3, 0x0141 },\n  { 0x01a5, 0x013d },\n  { 0x01a6, 0x015a },\n  { 0x01a9, 0x0160 },\n  { 0x01aa, 0x015e },\n  { 0x01ab, 0x0164 },\n  { 0x01ac, 0x0179 },\n  { 0x01ae, 0x017d },\n  { 0x01af, 0x017b },\n  { 0x01b1, 0x0105 },\n  { 0x01b2, 0x02db },\n  { 0x01b3, 0x0142 },\n  { 0x01b5, 0x013e },\n  { 0x01b6, 0x015b },\n  { 0x01b7, 0x02c7 },\n  { 0x01b9, 0x0161 },\n  { 0x01ba, 0x015f },\n  { 0x01bb, 0x0165 },\n  { 0x01bc, 0x017a },\n  { 0x01bd, 0x02dd },\n  { 0x01be, 0x017e },\n  { 0x01bf, 0x017c },\n  { 0x01c0, 0x0154 },\n  { 0x01c3, 0x0102 },\n  { 0x01c5, 0x0139 },\n  { 0x01c6, 0x0106 },\n  { 0x01c8, 0x010c },\n  { 0x01ca, 0x0118 },\n  { 0x01cc, 0x011a },\n  { 0x01cf, 0x010e },\n  { 0x01d0, 0x0110 },\n  { 0x01d1, 0x0143 },\n  { 0x01d2, 0x0147 },\n  { 0x01d5, 0x0150 },\n  { 0x01d8, 0x0158 },\n  { 0x01d9, 0x016e },\n  { 0x01db, 0x0170 },\n  { 0x01de, 0x0162 },\n  { 0x01e0, 0x0155 },\n  { 0x01e3, 0x0103 },\n  { 0x01e5, 0x013a },\n  { 0x01e6, 0x0107 },\n  { 0x01e8, 0x010d },\n  { 0x01ea, 0x0119 },\n  { 0x01ec, 0x011b },\n  { 0x01ef, 0x010f },\n  { 0x01f0, 0x0111 },\n  { 0x01f1, 0x0144 },\n  { 0x01f2, 0x0148 },\n  { 0x01f5, 0x0151 },\n  { 0x01f8, 0x0159 },\n  { 0x01f9, 0x016f },\n  { 0x01fb, 0x0171 },\n  { 0x01fe, 0x0163 },\n  { 0x01ff, 0x02d9 },\n  { 0x02a1, 0x0126 },\n  { 0x02a6, 0x0124 },\n  { 0x02a9, 0x0130 },\n  { 0x02ab, 0x011e },\n  { 0x02ac, 0x0134 },\n  { 0x02b1, 0x0127 },\n  { 0x02b6, 0x0125 },\n  { 0x02b9, 0x0131 },\n  { 0x02bb, 0x011f },\n  { 0x02bc, 0x0135 },\n  { 0x02c5, 0x010a },\n  { 0x02c6, 0x0108 },\n  { 0x02d5, 0x0120 },\n  { 0x02d8, 0x011c },\n  { 0x02dd, 0x016c },\n  { 0x02de, 0x015c },\n  { 0x02e5, 0x010b },\n  { 0x02e6, 0x0109 },\n  { 0x02f5, 0x0121 },\n  { 0x02f8, 0x011d },\n  { 0x02fd, 0x016d },\n  { 0x02fe, 0x015d },\n  { 0x03a2, 0x0138 },\n  { 0x03a3, 0x0156 },\n  { 0x03a5, 0x0128 },\n  { 0x03a6, 0x013b },\n  { 0x03aa, 0x0112 },\n  { 0x03ab, 0x0122 },\n  { 0x03ac, 0x0166 },\n  { 0x03b3, 0x0157 },\n  { 0x03b5, 0x0129 },\n  { 0x03b6, 0x013c },\n  { 0x03ba, 0x0113 },\n  { 0x03bb, 0x0123 },\n  { 0x03bc, 0x0167 },\n  { 0x03bd, 0x014a },\n  { 0x03bf, 0x014b },\n  { 0x03c0, 0x0100 },\n  { 0x03c7, 0x012e },\n  { 0x03cc, 0x0116 },\n  { 0x03cf, 0x012a },\n  { 0x03d1, 0x0145 },\n  { 0x03d2, 0x014c },\n  { 0x03d3, 0x0136 },\n  { 0x03d9, 0x0172 },\n  { 0x03dd, 0x0168 },\n  { 0x03de, 0x016a },\n  { 0x03e0, 0x0101 },\n  { 0x03e7, 0x012f },\n  { 0x03ec, 0x0117 },\n  { 0x03ef, 0x012b },\n  { 0x03f1, 0x0146 },\n  { 0x03f2, 0x014d },\n  { 0x03f3, 0x0137 },\n  { 0x03f9, 0x0173 },\n  { 0x03fd, 0x0169 },\n  { 0x03fe, 0x016b },\n  { 0x047e, 0x203e },\n  { 0x04a1, 0x3002 },\n  { 0x04a2, 0x300c },\n  { 0x04a3, 0x300d },\n  { 0x04a4, 0x3001 },\n  { 0x04a5, 0x30fb },\n  { 0x04a6, 0x30f2 },\n  { 0x04a7, 0x30a1 },\n  { 0x04a8, 0x30a3 },\n  { 0x04a9, 0x30a5 },\n  { 0x04aa, 0x30a7 },\n  { 0x04ab, 0x30a9 },\n  { 0x04ac, 0x30e3 },\n  { 0x04ad, 0x30e5 },\n  { 0x04ae, 0x30e7 },\n  { 0x04af, 0x30c3 },\n  { 0x04b0, 0x30fc },\n  { 0x04b1, 0x30a2 },\n  { 0x04b2, 0x30a4 },\n  { 0x04b3, 0x30a6 },\n  { 0x04b4, 0x30a8 },\n  { 0x04b5, 0x30aa },\n  { 0x04b6, 0x30ab },\n  { 0x04b7, 0x30ad },\n  { 0x04b8, 0x30af },\n  { 0x04b9, 0x30b1 },\n  { 0x04ba, 0x30b3 },\n  { 0x04bb, 0x30b5 },\n  { 0x04bc, 0x30b7 },\n  { 0x04bd, 0x30b9 },\n  { 0x04be, 0x30bb },\n  { 0x04bf, 0x30bd },\n  { 0x04c0, 0x30bf },\n  { 0x04c1, 0x30c1 },\n  { 0x04c2, 0x30c4 },\n  { 0x04c3, 0x30c6 },\n  { 0x04c4, 0x30c8 },\n  { 0x04c5, 0x30ca },\n  { 0x04c6, 0x30cb },\n  { 0x04c7, 0x30cc },\n  { 0x04c8, 0x30cd },\n  { 0x04c9, 0x30ce },\n  { 0x04ca, 0x30cf },\n  { 0x04cb, 0x30d2 },\n  { 0x04cc, 0x30d5 },\n  { 0x04cd, 0x30d8 },\n  { 0x04ce, 0x30db },\n  { 0x04cf, 0x30de },\n  { 0x04d0, 0x30df },\n  { 0x04d1, 0x30e0 },\n  { 0x04d2, 0x30e1 },\n  { 0x04d3, 0x30e2 },\n  { 0x04d4, 0x30e4 },\n  { 0x04d5, 0x30e6 },\n  { 0x04d6, 0x30e8 },\n  { 0x04d7, 0x30e9 },\n  { 0x04d8, 0x30ea },\n  { 0x04d9, 0x30eb },\n  { 0x04da, 0x30ec },\n  { 0x04db, 0x30ed },\n  { 0x04dc, 0x30ef },\n  { 0x04dd, 0x30f3 },\n  { 0x04de, 0x309b },\n  { 0x04df, 0x309c },\n  { 0x05ac, 0x060c },\n  { 0x05bb, 0x061b },\n  { 0x05bf, 0x061f },\n  { 0x05c1, 0x0621 },\n  { 0x05c2, 0x0622 },\n  { 0x05c3, 0x0623 },\n  { 0x05c4, 0x0624 },\n  { 0x05c5, 0x0625 },\n  { 0x05c6, 0x0626 },\n  { 0x05c7, 0x0627 },\n  { 0x05c8, 0x0628 },\n  { 0x05c9, 0x0629 },\n  { 0x05ca, 0x062a },\n  { 0x05cb, 0x062b },\n  { 0x05cc, 0x062c },\n  { 0x05cd, 0x062d },\n  { 0x05ce, 0x062e },\n  { 0x05cf, 0x062f },\n  { 0x05d0, 0x0630 },\n  { 0x05d1, 0x0631 },\n  { 0x05d2, 0x0632 },\n  { 0x05d3, 0x0633 },\n  { 0x05d4, 0x0634 },\n  { 0x05d5, 0x0635 },\n  { 0x05d6, 0x0636 },\n  { 0x05d7, 0x0637 },\n  { 0x05d8, 0x0638 },\n  { 0x05d9, 0x0639 },\n  { 0x05da, 0x063a },\n  { 0x05e0, 0x0640 },\n  { 0x05e1, 0x0641 },\n  { 0x05e2, 0x0642 },\n  { 0x05e3, 0x0643 },\n  { 0x05e4, 0x0644 },\n  { 0x05e5, 0x0645 },\n  { 0x05e6, 0x0646 },\n  { 0x05e7, 0x0647 },\n  { 0x05e8, 0x0648 },\n  { 0x05e9, 0x0649 },\n  { 0x05ea, 0x064a },\n  { 0x05eb, 0x064b },\n  { 0x05ec, 0x064c },\n  { 0x05ed, 0x064d },\n  { 0x05ee, 0x064e },\n  { 0x05ef, 0x064f },\n  { 0x05f0, 0x0650 },\n  { 0x05f1, 0x0651 },\n  { 0x05f2, 0x0652 },\n  { 0x06a1, 0x0452 },\n  { 0x06a2, 0x0453 },\n  { 0x06a3, 0x0451 },\n  { 0x06a4, 0x0454 },\n  { 0x06a5, 0x0455 },\n  { 0x06a6, 0x0456 },\n  { 0x06a7, 0x0457 },\n  { 0x06a8, 0x0458 },\n  { 0x06a9, 0x0459 },\n  { 0x06aa, 0x045a },\n  { 0x06ab, 0x045b },\n  { 0x06ac, 0x045c },\n  { 0x06ae, 0x045e },\n  { 0x06af, 0x045f },\n  { 0x06b0, 0x2116 },\n  { 0x06b1, 0x0402 },\n  { 0x06b2, 0x0403 },\n  { 0x06b3, 0x0401 },\n  { 0x06b4, 0x0404 },\n  { 0x06b5, 0x0405 },\n  { 0x06b6, 0x0406 },\n  { 0x06b7, 0x0407 },\n  { 0x06b8, 0x0408 },\n  { 0x06b9, 0x0409 },\n  { 0x06ba, 0x040a },\n  { 0x06bb, 0x040b },\n  { 0x06bc, 0x040c },\n  { 0x06be, 0x040e },\n  { 0x06bf, 0x040f },\n  { 0x06c0, 0x044e },\n  { 0x06c1, 0x0430 },\n  { 0x06c2, 0x0431 },\n  { 0x06c3, 0x0446 },\n  { 0x06c4, 0x0434 },\n  { 0x06c5, 0x0435 },\n  { 0x06c6, 0x0444 },\n  { 0x06c7, 0x0433 },\n  { 0x06c8, 0x0445 },\n  { 0x06c9, 0x0438 },\n  { 0x06ca, 0x0439 },\n  { 0x06cb, 0x043a },\n  { 0x06cc, 0x043b },\n  { 0x06cd, 0x043c },\n  { 0x06ce, 0x043d },\n  { 0x06cf, 0x043e },\n  { 0x06d0, 0x043f },\n  { 0x06d1, 0x044f },\n  { 0x06d2, 0x0440 },\n  { 0x06d3, 0x0441 },\n  { 0x06d4, 0x0442 },\n  { 0x06d5, 0x0443 },\n  { 0x06d6, 0x0436 },\n  { 0x06d7, 0x0432 },\n  { 0x06d8, 0x044c },\n  { 0x06d9, 0x044b },\n  { 0x06da, 0x0437 },\n  { 0x06db, 0x0448 },\n  { 0x06dc, 0x044d },\n  { 0x06dd, 0x0449 },\n  { 0x06de, 0x0447 },\n  { 0x06df, 0x044a },\n  { 0x06e0, 0x042e },\n  { 0x06e1, 0x0410 },\n  { 0x06e2, 0x0411 },\n  { 0x06e3, 0x0426 },\n  { 0x06e4, 0x0414 },\n  { 0x06e5, 0x0415 },\n  { 0x06e6, 0x0424 },\n  { 0x06e7, 0x0413 },\n  { 0x06e8, 0x0425 },\n  { 0x06e9, 0x0418 },\n  { 0x06ea, 0x0419 },\n  { 0x06eb, 0x041a },\n  { 0x06ec, 0x041b },\n  { 0x06ed, 0x041c },\n  { 0x06ee, 0x041d },\n  { 0x06ef, 0x041e },\n  { 0x06f0, 0x041f },\n  { 0x06f1, 0x042f },\n  { 0x06f2, 0x0420 },\n  { 0x06f3, 0x0421 },\n  { 0x06f4, 0x0422 },\n  { 0x06f5, 0x0423 },\n  { 0x06f6, 0x0416 },\n  { 0x06f7, 0x0412 },\n  { 0x06f8, 0x042c },\n  { 0x06f9, 0x042b },\n  { 0x06fa, 0x0417 },\n  { 0x06fb, 0x0428 },\n  { 0x06fc, 0x042d },\n  { 0x06fd, 0x0429 },\n  { 0x06fe, 0x0427 },\n  { 0x06ff, 0x042a },\n  { 0x07a1, 0x0386 },\n  { 0x07a2, 0x0388 },\n  { 0x07a3, 0x0389 },\n  { 0x07a4, 0x038a },\n  { 0x07a5, 0x03aa },\n  { 0x07a7, 0x038c },\n  { 0x07a8, 0x038e },\n  { 0x07a9, 0x03ab },\n  { 0x07ab, 0x038f },\n  { 0x07ae, 0x0385 },\n  { 0x07af, 0x2015 },\n  { 0x07b1, 0x03ac },\n  { 0x07b2, 0x03ad },\n  { 0x07b3, 0x03ae },\n  { 0x07b4, 0x03af },\n  { 0x07b5, 0x03ca },\n  { 0x07b6, 0x0390 },\n  { 0x07b7, 0x03cc },\n  { 0x07b8, 0x03cd },\n  { 0x07b9, 0x03cb },\n  { 0x07ba, 0x03b0 },\n  { 0x07bb, 0x03ce },\n  { 0x07c1, 0x0391 },\n  { 0x07c2, 0x0392 },\n  { 0x07c3, 0x0393 },\n  { 0x07c4, 0x0394 },\n  { 0x07c5, 0x0395 },\n  { 0x07c6, 0x0396 },\n  { 0x07c7, 0x0397 },\n  { 0x07c8, 0x0398 },\n  { 0x07c9, 0x0399 },\n  { 0x07ca, 0x039a },\n  { 0x07cb, 0x039b },\n  { 0x07cc, 0x039c },\n  { 0x07cd, 0x039d },\n  { 0x07ce, 0x039e },\n  { 0x07cf, 0x039f },\n  { 0x07d0, 0x03a0 },\n  { 0x07d1, 0x03a1 },\n  { 0x07d2, 0x03a3 },\n  { 0x07d4, 0x03a4 },\n  { 0x07d5, 0x03a5 },\n  { 0x07d6, 0x03a6 },\n  { 0x07d7, 0x03a7 },\n  { 0x07d8, 0x03a8 },\n  { 0x07d9, 0x03a9 },\n  { 0x07e1, 0x03b1 },\n  { 0x07e2, 0x03b2 },\n  { 0x07e3, 0x03b3 },\n  { 0x07e4, 0x03b4 },\n  { 0x07e5, 0x03b5 },\n  { 0x07e6, 0x03b6 },\n  { 0x07e7, 0x03b7 },\n  { 0x07e8, 0x03b8 },\n  { 0x07e9, 0x03b9 },\n  { 0x07ea, 0x03ba },\n  { 0x07eb, 0x03bb },\n  { 0x07ec, 0x03bc },\n  { 0x07ed, 0x03bd },\n  { 0x07ee, 0x03be },\n  { 0x07ef, 0x03bf },\n  { 0x07f0, 0x03c0 },\n  { 0x07f1, 0x03c1 },\n  { 0x07f2, 0x03c3 },\n  { 0x07f3, 0x03c2 },\n  { 0x07f4, 0x03c4 },\n  { 0x07f5, 0x03c5 },\n  { 0x07f6, 0x03c6 },\n  { 0x07f7, 0x03c7 },\n  { 0x07f8, 0x03c8 },\n  { 0x07f9, 0x03c9 },\n  { 0x08a1, 0x23b7 },\n  { 0x08a2, 0x250c },\n  { 0x08a3, 0x2500 },\n  { 0x08a4, 0x2320 },\n  { 0x08a5, 0x2321 },\n  { 0x08a6, 0x2502 },\n  { 0x08a7, 0x23a1 },\n  { 0x08a8, 0x23a3 },\n  { 0x08a9, 0x23a4 },\n  { 0x08aa, 0x23a6 },\n  { 0x08ab, 0x239b },\n  { 0x08ac, 0x239d },\n  { 0x08ad, 0x239e },\n  { 0x08ae, 0x23a0 },\n  { 0x08af, 0x23a8 },\n  { 0x08b0, 0x23ac },\n  { 0x08bc, 0x2264 },\n  { 0x08bd, 0x2260 },\n  { 0x08be, 0x2265 },\n  { 0x08bf, 0x222b },\n  { 0x08c0, 0x2234 },\n  { 0x08c1, 0x221d },\n  { 0x08c2, 0x221e },\n  { 0x08c5, 0x2207 },\n  { 0x08c8, 0x223c },\n  { 0x08c9, 0x2243 },\n  { 0x08cd, 0x21d4 },\n  { 0x08ce, 0x21d2 },\n  { 0x08cf, 0x2261 },\n  { 0x08d6, 0x221a },\n  { 0x08da, 0x2282 },\n  { 0x08db, 0x2283 },\n  { 0x08dc, 0x2229 },\n  { 0x08dd, 0x222a },\n  { 0x08de, 0x2227 },\n  { 0x08df, 0x2228 },\n  { 0x08ef, 0x2202 },\n  { 0x08f6, 0x0192 },\n  { 0x08fb, 0x2190 },\n  { 0x08fc, 0x2191 },\n  { 0x08fd, 0x2192 },\n  { 0x08fe, 0x2193 },\n  { 0x09e0, 0x25c6 },\n  { 0x09e1, 0x2592 },\n  { 0x09e2, 0x2409 },\n  { 0x09e3, 0x240c },\n  { 0x09e4, 0x240d },\n  { 0x09e5, 0x240a },\n  { 0x09e8, 0x2424 },\n  { 0x09e9, 0x240b },\n  { 0x09ea, 0x2518 },\n  { 0x09eb, 0x2510 },\n  { 0x09ec, 0x250c },\n  { 0x09ed, 0x2514 },\n  { 0x09ee, 0x253c },\n  { 0x09ef, 0x23ba },\n  { 0x09f0, 0x23bb },\n  { 0x09f1, 0x2500 },\n  { 0x09f2, 0x23bc },\n  { 0x09f3, 0x23bd },\n  { 0x09f4, 0x251c },\n  { 0x09f5, 0x2524 },\n  { 0x09f6, 0x2534 },\n  { 0x09f7, 0x252c },\n  { 0x09f8, 0x2502 },\n  { 0x0aa1, 0x2003 },\n  { 0x0aa2, 0x2002 },\n  { 0x0aa3, 0x2004 },\n  { 0x0aa4, 0x2005 },\n  { 0x0aa5, 0x2007 },\n  { 0x0aa6, 0x2008 },\n  { 0x0aa7, 0x2009 },\n  { 0x0aa8, 0x200a },\n  { 0x0aa9, 0x2014 },\n  { 0x0aaa, 0x2013 },\n  { 0x0aae, 0x2026 },\n  { 0x0aaf, 0x2025 },\n  { 0x0ab0, 0x2153 },\n  { 0x0ab1, 0x2154 },\n  { 0x0ab2, 0x2155 },\n  { 0x0ab3, 0x2156 },\n  { 0x0ab4, 0x2157 },\n  { 0x0ab5, 0x2158 },\n  { 0x0ab6, 0x2159 },\n  { 0x0ab7, 0x215a },\n  { 0x0ab8, 0x2105 },\n  { 0x0abb, 0x2012 },\n  { 0x0abc, 0x2329 },\n  { 0x0abe, 0x232a },\n  { 0x0ac3, 0x215b },\n  { 0x0ac4, 0x215c },\n  { 0x0ac5, 0x215d },\n  { 0x0ac6, 0x215e },\n  { 0x0ac9, 0x2122 },\n  { 0x0aca, 0x2613 },\n  { 0x0acc, 0x25c1 },\n  { 0x0acd, 0x25b7 },\n  { 0x0ace, 0x25cb },\n  { 0x0acf, 0x25af },\n  { 0x0ad0, 0x2018 },\n  { 0x0ad1, 0x2019 },\n  { 0x0ad2, 0x201c },\n  { 0x0ad3, 0x201d },\n  { 0x0ad4, 0x211e },\n  { 0x0ad6, 0x2032 },\n  { 0x0ad7, 0x2033 },\n  { 0x0ad9, 0x271d },\n  { 0x0adb, 0x25ac },\n  { 0x0adc, 0x25c0 },\n  { 0x0add, 0x25b6 },\n  { 0x0ade, 0x25cf },\n  { 0x0adf, 0x25ae },\n  { 0x0ae0, 0x25e6 },\n  { 0x0ae1, 0x25ab },\n  { 0x0ae2, 0x25ad },\n  { 0x0ae3, 0x25b3 },\n  { 0x0ae4, 0x25bd },\n  { 0x0ae5, 0x2606 },\n  { 0x0ae6, 0x2022 },\n  { 0x0ae7, 0x25aa },\n  { 0x0ae8, 0x25b2 },\n  { 0x0ae9, 0x25bc },\n  { 0x0aea, 0x261c },\n  { 0x0aeb, 0x261e },\n  { 0x0aec, 0x2663 },\n  { 0x0aed, 0x2666 },\n  { 0x0aee, 0x2665 },\n  { 0x0af0, 0x2720 },\n  { 0x0af1, 0x2020 },\n  { 0x0af2, 0x2021 },\n  { 0x0af3, 0x2713 },\n  { 0x0af4, 0x2717 },\n  { 0x0af5, 0x266f },\n  { 0x0af6, 0x266d },\n  { 0x0af7, 0x2642 },\n  { 0x0af8, 0x2640 },\n  { 0x0af9, 0x260e },\n  { 0x0afa, 0x2315 },\n  { 0x0afb, 0x2117 },\n  { 0x0afc, 0x2038 },\n  { 0x0afd, 0x201a },\n  { 0x0afe, 0x201e },\n  { 0x0ba3, 0x003c },\n  { 0x0ba6, 0x003e },\n  { 0x0ba8, 0x2228 },\n  { 0x0ba9, 0x2227 },\n  { 0x0bc0, 0x00af },\n  { 0x0bc2, 0x22a5 },\n  { 0x0bc3, 0x2229 },\n  { 0x0bc4, 0x230a },\n  { 0x0bc6, 0x005f },\n  { 0x0bca, 0x2218 },\n  { 0x0bcc, 0x2395 },\n  { 0x0bce, 0x22a4 },\n  { 0x0bcf, 0x25cb },\n  { 0x0bd3, 0x2308 },\n  { 0x0bd6, 0x222a },\n  { 0x0bd8, 0x2283 },\n  { 0x0bda, 0x2282 },\n  { 0x0bdc, 0x22a2 },\n  { 0x0bfc, 0x22a3 },\n  { 0x0cdf, 0x2017 },\n  { 0x0ce0, 0x05d0 },\n  { 0x0ce1, 0x05d1 },\n  { 0x0ce2, 0x05d2 },\n  { 0x0ce3, 0x05d3 },\n  { 0x0ce4, 0x05d4 },\n  { 0x0ce5, 0x05d5 },\n  { 0x0ce6, 0x05d6 },\n  { 0x0ce7, 0x05d7 },\n  { 0x0ce8, 0x05d8 },\n  { 0x0ce9, 0x05d9 },\n  { 0x0cea, 0x05da },\n  { 0x0ceb, 0x05db },\n  { 0x0cec, 0x05dc },\n  { 0x0ced, 0x05dd },\n  { 0x0cee, 0x05de },\n  { 0x0cef, 0x05df },\n  { 0x0cf0, 0x05e0 },\n  { 0x0cf1, 0x05e1 },\n  { 0x0cf2, 0x05e2 },\n  { 0x0cf3, 0x05e3 },\n  { 0x0cf4, 0x05e4 },\n  { 0x0cf5, 0x05e5 },\n  { 0x0cf6, 0x05e6 },\n  { 0x0cf7, 0x05e7 },\n  { 0x0cf8, 0x05e8 },\n  { 0x0cf9, 0x05e9 },\n  { 0x0cfa, 0x05ea },\n  { 0x0da1, 0x0e01 },\n  { 0x0da2, 0x0e02 },\n  { 0x0da3, 0x0e03 },\n  { 0x0da4, 0x0e04 },\n  { 0x0da5, 0x0e05 },\n  { 0x0da6, 0x0e06 },\n  { 0x0da7, 0x0e07 },\n  { 0x0da8, 0x0e08 },\n  { 0x0da9, 0x0e09 },\n  { 0x0daa, 0x0e0a },\n  { 0x0dab, 0x0e0b },\n  { 0x0dac, 0x0e0c },\n  { 0x0dad, 0x0e0d },\n  { 0x0dae, 0x0e0e },\n  { 0x0daf, 0x0e0f },\n  { 0x0db0, 0x0e10 },\n  { 0x0db1, 0x0e11 },\n  { 0x0db2, 0x0e12 },\n  { 0x0db3, 0x0e13 },\n  { 0x0db4, 0x0e14 },\n  { 0x0db5, 0x0e15 },\n  { 0x0db6, 0x0e16 },\n  { 0x0db7, 0x0e17 },\n  { 0x0db8, 0x0e18 },\n  { 0x0db9, 0x0e19 },\n  { 0x0dba, 0x0e1a },\n  { 0x0dbb, 0x0e1b },\n  { 0x0dbc, 0x0e1c },\n  { 0x0dbd, 0x0e1d },\n  { 0x0dbe, 0x0e1e },\n  { 0x0dbf, 0x0e1f },\n  { 0x0dc0, 0x0e20 },\n  { 0x0dc1, 0x0e21 },\n  { 0x0dc2, 0x0e22 },\n  { 0x0dc3, 0x0e23 },\n  { 0x0dc4, 0x0e24 },\n  { 0x0dc5, 0x0e25 },\n  { 0x0dc6, 0x0e26 },\n  { 0x0dc7, 0x0e27 },\n  { 0x0dc8, 0x0e28 },\n  { 0x0dc9, 0x0e29 },\n  { 0x0dca, 0x0e2a },\n  { 0x0dcb, 0x0e2b },\n  { 0x0dcc, 0x0e2c },\n  { 0x0dcd, 0x0e2d },\n  { 0x0dce, 0x0e2e },\n  { 0x0dcf, 0x0e2f },\n  { 0x0dd0, 0x0e30 },\n  { 0x0dd1, 0x0e31 },\n  { 0x0dd2, 0x0e32 },\n  { 0x0dd3, 0x0e33 },\n  { 0x0dd4, 0x0e34 },\n  { 0x0dd5, 0x0e35 },\n  { 0x0dd6, 0x0e36 },\n  { 0x0dd7, 0x0e37 },\n  { 0x0dd8, 0x0e38 },\n  { 0x0dd9, 0x0e39 },\n  { 0x0dda, 0x0e3a },\n  { 0x0ddf, 0x0e3f },\n  { 0x0de0, 0x0e40 },\n  { 0x0de1, 0x0e41 },\n  { 0x0de2, 0x0e42 },\n  { 0x0de3, 0x0e43 },\n  { 0x0de4, 0x0e44 },\n  { 0x0de5, 0x0e45 },\n  { 0x0de6, 0x0e46 },\n  { 0x0de7, 0x0e47 },\n  { 0x0de8, 0x0e48 },\n  { 0x0de9, 0x0e49 },\n  { 0x0dea, 0x0e4a },\n  { 0x0deb, 0x0e4b },\n  { 0x0dec, 0x0e4c },\n  { 0x0ded, 0x0e4d },\n  { 0x0df0, 0x0e50 },\n  { 0x0df1, 0x0e51 },\n  { 0x0df2, 0x0e52 },\n  { 0x0df3, 0x0e53 },\n  { 0x0df4, 0x0e54 },\n  { 0x0df5, 0x0e55 },\n  { 0x0df6, 0x0e56 },\n  { 0x0df7, 0x0e57 },\n  { 0x0df8, 0x0e58 },\n  { 0x0df9, 0x0e59 },\n  { 0x0ea1, 0x3131 },\n  { 0x0ea2, 0x3132 },\n  { 0x0ea3, 0x3133 },\n  { 0x0ea4, 0x3134 },\n  { 0x0ea5, 0x3135 },\n  { 0x0ea6, 0x3136 },\n  { 0x0ea7, 0x3137 },\n  { 0x0ea8, 0x3138 },\n  { 0x0ea9, 0x3139 },\n  { 0x0eaa, 0x313a },\n  { 0x0eab, 0x313b },\n  { 0x0eac, 0x313c },\n  { 0x0ead, 0x313d },\n  { 0x0eae, 0x313e },\n  { 0x0eaf, 0x313f },\n  { 0x0eb0, 0x3140 },\n  { 0x0eb1, 0x3141 },\n  { 0x0eb2, 0x3142 },\n  { 0x0eb3, 0x3143 },\n  { 0x0eb4, 0x3144 },\n  { 0x0eb5, 0x3145 },\n  { 0x0eb6, 0x3146 },\n  { 0x0eb7, 0x3147 },\n  { 0x0eb8, 0x3148 },\n  { 0x0eb9, 0x3149 },\n  { 0x0eba, 0x314a },\n  { 0x0ebb, 0x314b },\n  { 0x0ebc, 0x314c },\n  { 0x0ebd, 0x314d },\n  { 0x0ebe, 0x314e },\n  { 0x0ebf, 0x314f },\n  { 0x0ec0, 0x3150 },\n  { 0x0ec1, 0x3151 },\n  { 0x0ec2, 0x3152 },\n  { 0x0ec3, 0x3153 },\n  { 0x0ec4, 0x3154 },\n  { 0x0ec5, 0x3155 },\n  { 0x0ec6, 0x3156 },\n  { 0x0ec7, 0x3157 },\n  { 0x0ec8, 0x3158 },\n  { 0x0ec9, 0x3159 },\n  { 0x0eca, 0x315a },\n  { 0x0ecb, 0x315b },\n  { 0x0ecc, 0x315c },\n  { 0x0ecd, 0x315d },\n  { 0x0ece, 0x315e },\n  { 0x0ecf, 0x315f },\n  { 0x0ed0, 0x3160 },\n  { 0x0ed1, 0x3161 },\n  { 0x0ed2, 0x3162 },\n  { 0x0ed3, 0x3163 },\n  { 0x0ed4, 0x11a8 },\n  { 0x0ed5, 0x11a9 },\n  { 0x0ed6, 0x11aa },\n  { 0x0ed7, 0x11ab },\n  { 0x0ed8, 0x11ac },\n  { 0x0ed9, 0x11ad },\n  { 0x0eda, 0x11ae },\n  { 0x0edb, 0x11af },\n  { 0x0edc, 0x11b0 },\n  { 0x0edd, 0x11b1 },\n  { 0x0ede, 0x11b2 },\n  { 0x0edf, 0x11b3 },\n  { 0x0ee0, 0x11b4 },\n  { 0x0ee1, 0x11b5 },\n  { 0x0ee2, 0x11b6 },\n  { 0x0ee3, 0x11b7 },\n  { 0x0ee4, 0x11b8 },\n  { 0x0ee5, 0x11b9 },\n  { 0x0ee6, 0x11ba },\n  { 0x0ee7, 0x11bb },\n  { 0x0ee8, 0x11bc },\n  { 0x0ee9, 0x11bd },\n  { 0x0eea, 0x11be },\n  { 0x0eeb, 0x11bf },\n  { 0x0eec, 0x11c0 },\n  { 0x0eed, 0x11c1 },\n  { 0x0eee, 0x11c2 },\n  { 0x0eef, 0x316d },\n  { 0x0ef0, 0x3171 },\n  { 0x0ef1, 0x3178 },\n  { 0x0ef2, 0x317f },\n  { 0x0ef3, 0x3181 },\n  { 0x0ef4, 0x3184 },\n  { 0x0ef5, 0x3186 },\n  { 0x0ef6, 0x318d },\n  { 0x0ef7, 0x318e },\n  { 0x0ef8, 0x11eb },\n  { 0x0ef9, 0x11f0 },\n  { 0x0efa, 0x11f9 },\n  { 0x0eff, 0x20a9 },\n  { 0x13a4, 0x20ac },\n  { 0x13bc, 0x0152 },\n  { 0x13bd, 0x0153 },\n  { 0x13be, 0x0178 },\n  { 0x20ac, 0x20ac },\n  // Numeric keypad with numlock on\n  { XK_KP_Space, ' ' },\n  { XK_KP_Equal, '=' },\n  { XK_KP_Multiply, '*' },\n  { XK_KP_Add, '+' },\n  { XK_KP_Separator, ',' },\n  { XK_KP_Subtract, '-' },\n  { XK_KP_Decimal, '.' },\n  { XK_KP_Divide, '/' },\n  { XK_KP_0, 0x0030 },\n  { XK_KP_1, 0x0031 },\n  { XK_KP_2, 0x0032 },\n  { XK_KP_3, 0x0033 },\n  { XK_KP_4, 0x0034 },\n  { XK_KP_5, 0x0035 },\n  { XK_KP_6, 0x0036 },\n  { XK_KP_7, 0x0037 },\n  { XK_KP_8, 0x0038 },\n  { XK_KP_9, 0x0039 }\n};\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Convert X11 KeySym to Unicode\n//\nlong _glfwKeySym2Unicode( KeySym keysym )\n{\n    int min = 0;\n    int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;\n    int mid;\n\n    /* First check for Latin-1 characters (1:1 mapping) */\n    if( (keysym >= 0x0020 && keysym <= 0x007e) ||\n        (keysym >= 0x00a0 && keysym <= 0x00ff) )\n    { return keysym;\n    }\n\n    /* Also check for directly encoded 24-bit UCS characters */\n    if( (keysym & 0xff000000) == 0x01000000 )\n        return keysym & 0x00ffffff;\n\n    /* Binary search in table */\n    while( max >= min )\n    {\n        mid = (min + max) / 2;\n        if( keysymtab[mid].keysym < keysym )\n            min = mid + 1;\n        else if( keysymtab[mid].keysym > keysym )\n            max = mid - 1;\n        else\n        {\n            /* Found it! */\n            return keysymtab[mid].ucs;\n        }\n    }\n\n    /* No matching Unicode value found */\n    return -1;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/glfw/src/x11_window.c",
    "content": "//========================================================================\n// GLFW - An OpenGL library\n// Platform:    X11\n// API version: 3.0\n// WWW:         http://www.glfw.org/\n//------------------------------------------------------------------------\n// Copyright (c) 2002-2006 Marcus Geelnard\n// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//    claim that you wrote the original software. If you use this software\n//    in a product, an acknowledgment in the product documentation would\n//    be appreciated but is not required.\n//\n// 2. Altered source versions must be plainly marked as such, and must not\n//    be misrepresented as being the original software.\n//\n// 3. This notice may not be removed or altered from any source\n//    distribution.\n//\n//========================================================================\n\n#include \"internal.h\"\n\n#include <sys/select.h>\n\n#include <string.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <limits.h>\n\n// Action for EWMH client messages\n#define _NET_WM_STATE_REMOVE        0\n#define _NET_WM_STATE_ADD           1\n#define _NET_WM_STATE_TOGGLE        2\n\n// Additional mouse button names for XButtonEvent\n#define Button6            6\n#define Button7            7\n\ntypedef struct\n{\n\tunsigned long flags;\n\tunsigned long functions;\n\tunsigned long decorations;\n\tlong input_mode;\n\tunsigned long status;\n} MotifWmHints;\n\n#define MWM_HINTS_DECORATIONS (1L << 1)\n\n\n// Translates an X event modifier state mask\n//\nstatic int translateState(int state)\n{\n    int mods = 0;\n\n    if (state & ShiftMask)\n        mods |= GLFW_MOD_SHIFT;\n    if (state & ControlMask)\n        mods |= GLFW_MOD_CONTROL;\n    if (state & Mod1Mask)\n        mods |= GLFW_MOD_ALT;\n    if (state & Mod4Mask)\n        mods |= GLFW_MOD_SUPER;\n\n    return mods;\n}\n\n// Translates an X Window key to internal coding\n//\nstatic int translateKey(int keycode)\n{\n    // Use the pre-filled LUT (see updateKeyCodeLUT() in x11_init.c)\n    if ((keycode >= 0) && (keycode < 256))\n        return _glfw.x11.keyCodeLUT[keycode];\n\n    return GLFW_KEY_UNKNOWN;\n}\n\n// Translates an X Window event to Unicode\n//\nstatic int translateChar(XKeyEvent* event)\n{\n    KeySym keysym;\n\n    // Get X11 keysym\n    XLookupString(event, NULL, 0, &keysym, NULL);\n\n    // Convert to Unicode (see x11_unicode.c)\n    return (int) _glfwKeySym2Unicode(keysym);\n}\n\n// Create the X11 window (and its colormap)\n//\nstatic GLboolean createWindow(_GLFWwindow* window,\n                              const _GLFWwndconfig* wndconfig)\n{\n    unsigned long wamask;\n    XSetWindowAttributes wa;\n    XVisualInfo* visual = _GLFW_X11_CONTEXT_VISUAL;\n\n    // Every window needs a colormap\n    // Create one based on the visual used by the current context\n    // TODO: Decouple this from context creation\n\n    window->x11.colormap = XCreateColormap(_glfw.x11.display,\n                                           _glfw.x11.root,\n                                           visual->visual,\n                                           AllocNone);\n\n    // Create the actual window\n    {\n        wamask = CWBorderPixel | CWColormap | CWEventMask;\n\n        wa.colormap = window->x11.colormap;\n        wa.border_pixel = 0;\n        wa.event_mask = StructureNotifyMask | KeyPressMask | KeyReleaseMask |\n                        PointerMotionMask | ButtonPressMask | ButtonReleaseMask |\n                        ExposureMask | FocusChangeMask | VisibilityChangeMask |\n                        EnterWindowMask | LeaveWindowMask | PropertyChangeMask;\n\n        if (wndconfig->monitor == NULL)\n        {\n            // HACK: This is a workaround for windows without a background pixel\n            // not getting any decorations on certain older versions of Compiz\n            // running on Intel hardware\n            wa.background_pixel = BlackPixel(_glfw.x11.display,\n                                             _glfw.x11.screen);\n            wamask |= CWBackPixel;\n        }\n\n        window->x11.handle = XCreateWindow(_glfw.x11.display,\n                                           _glfw.x11.root,\n                                           0, 0,\n                                           wndconfig->width, wndconfig->height,\n                                           0,              // Border width\n                                           visual->depth,  // Color depth\n                                           InputOutput,\n                                           visual->visual,\n                                           wamask,\n                                           &wa);\n\n        if (!window->x11.handle)\n        {\n            // TODO: Handle all the various error codes here and translate them\n            // to GLFW errors\n\n            _glfwInputError(GLFW_PLATFORM_ERROR, \"X11: Failed to create window\");\n            return GL_FALSE;\n        }\n\n        if (!wndconfig->decorated)\n        {\n            MotifWmHints hints;\n            hints.flags = MWM_HINTS_DECORATIONS;\n            hints.decorations = 0;\n\n            XChangeProperty(_glfw.x11.display, window->x11.handle,\n                            _glfw.x11.MOTIF_WM_HINTS,\n                            _glfw.x11.MOTIF_WM_HINTS, 32,\n                            PropModeReplace,\n                            (unsigned char*) &hints,\n                            sizeof(MotifWmHints) / sizeof(long));\n        }\n\n        XSaveContext(_glfw.x11.display,\n                     window->x11.handle,\n                     _glfw.x11.context,\n                     (XPointer) window);\n    }\n\n    if (window->monitor && !_glfw.x11.hasEWMH)\n    {\n        // This is the butcher's way of removing window decorations\n        // Setting the override-redirect attribute on a window makes the window\n        // manager ignore the window completely (ICCCM, section 4)\n        // The good thing is that this makes undecorated fullscreen windows\n        // easy to do; the bad thing is that we have to do everything manually\n        // and some things (like iconify/restore) won't work at all, as those\n        // are tasks usually performed by the window manager\n\n        XSetWindowAttributes attributes;\n        attributes.override_redirect = True;\n        XChangeWindowAttributes(_glfw.x11.display,\n                                window->x11.handle,\n                                CWOverrideRedirect,\n                                &attributes);\n\n        window->x11.overrideRedirect = GL_TRUE;\n    }\n\n    // Declare the WM protocols supported by GLFW\n    {\n        int count = 0;\n        Atom protocols[2];\n\n        // The WM_DELETE_WINDOW ICCCM protocol\n        // Basic window close notification protocol\n        if (_glfw.x11.WM_DELETE_WINDOW != None)\n            protocols[count++] = _glfw.x11.WM_DELETE_WINDOW;\n\n        // The _NET_WM_PING EWMH protocol\n        // Tells the WM to ping the GLFW window and flag the application as\n        // unresponsive if the WM doesn't get a reply within a few seconds\n        if (_glfw.x11.NET_WM_PING != None)\n            protocols[count++] = _glfw.x11.NET_WM_PING;\n\n        if (count > 0)\n        {\n            XSetWMProtocols(_glfw.x11.display, window->x11.handle,\n                            protocols, count);\n        }\n    }\n\n    if (_glfw.x11.NET_WM_PID != None)\n    {\n        const pid_t pid = getpid();\n\n        XChangeProperty(_glfw.x11.display,  window->x11.handle,\n                        _glfw.x11.NET_WM_PID, XA_CARDINAL, 32,\n                        PropModeReplace,\n                        (unsigned char*) &pid, 1);\n    }\n\n    // Set ICCCM WM_HINTS property\n    {\n        XWMHints* hints = XAllocWMHints();\n        if (!hints)\n        {\n            _glfwInputError(GLFW_OUT_OF_MEMORY,\n                            \"X11: Failed to allocate WM hints\");\n            return GL_FALSE;\n        }\n\n        hints->flags = StateHint;\n        hints->initial_state = NormalState;\n\n        XSetWMHints(_glfw.x11.display, window->x11.handle, hints);\n        XFree(hints);\n    }\n\n    // Set ICCCM WM_NORMAL_HINTS property (even if no parts are set)\n    {\n        XSizeHints* hints = XAllocSizeHints();\n        hints->flags = 0;\n\n        if (wndconfig->monitor)\n        {\n            hints->flags |= PPosition;\n            _glfwPlatformGetMonitorPos(wndconfig->monitor, &hints->x, &hints->y);\n        }\n\n        if (!wndconfig->resizable)\n        {\n            hints->flags |= (PMinSize | PMaxSize);\n            hints->min_width  = hints->max_width  = wndconfig->width;\n            hints->min_height = hints->max_height = wndconfig->height;\n        }\n\n        XSetWMNormalHints(_glfw.x11.display, window->x11.handle, hints);\n        XFree(hints);\n    }\n\n    if (_glfw.x11.xi.available)\n    {\n        // Select for XInput2 events\n\n        XIEventMask eventmask;\n        unsigned char mask[] = { 0 };\n\n        eventmask.deviceid = 2;\n        eventmask.mask_len = sizeof(mask);\n        eventmask.mask = mask;\n        XISetMask(mask, XI_Motion);\n\n        XISelectEvents(_glfw.x11.display, window->x11.handle, &eventmask, 1);\n    }\n\n    _glfwPlatformSetWindowTitle(window, wndconfig->title);\n\n    XRRSelectInput(_glfw.x11.display, window->x11.handle,\n                   RRScreenChangeNotifyMask);\n\n    _glfwPlatformGetWindowPos(window, &window->x11.xpos, &window->x11.ypos);\n    _glfwPlatformGetWindowSize(window, &window->x11.width, &window->x11.height);\n\n    return GL_TRUE;\n}\n\n// Hide cursor\n//\nstatic void hideCursor(_GLFWwindow* window)\n{\n    // Un-grab cursor (in windowed mode only; in fullscreen mode we still\n    // want the cursor grabbed in order to confine the cursor to the window\n    // area)\n    if (window->x11.cursorGrabbed && window->monitor == NULL)\n    {\n        XUngrabPointer(_glfw.x11.display, CurrentTime);\n        window->x11.cursorGrabbed = GL_FALSE;\n    }\n\n    if (!window->x11.cursorHidden)\n    {\n        XDefineCursor(_glfw.x11.display, window->x11.handle, _glfw.x11.cursor);\n        window->x11.cursorHidden = GL_TRUE;\n    }\n}\n\n// Capture cursor\n//\nstatic void captureCursor(_GLFWwindow* window)\n{\n    hideCursor(window);\n\n    if (!window->x11.cursorGrabbed)\n    {\n        if (XGrabPointer(_glfw.x11.display, window->x11.handle, True,\n                         ButtonPressMask | ButtonReleaseMask |\n                         PointerMotionMask, GrabModeAsync, GrabModeAsync,\n                         window->x11.handle, None, CurrentTime) ==\n            GrabSuccess)\n        {\n            window->x11.cursorGrabbed = GL_TRUE;\n        }\n    }\n}\n\n// Show cursor\n//\nstatic void showCursor(_GLFWwindow* window)\n{\n    // Un-grab cursor (in windowed mode only; in fullscreen mode we still\n    // want the cursor grabbed in order to confine the cursor to the window\n    // area)\n    if (window->x11.cursorGrabbed && window->monitor == NULL)\n    {\n        XUngrabPointer(_glfw.x11.display, CurrentTime);\n        window->x11.cursorGrabbed = GL_FALSE;\n    }\n\n    // Show cursor\n    if (window->x11.cursorHidden)\n    {\n        XUndefineCursor(_glfw.x11.display, window->x11.handle);\n        window->x11.cursorHidden = GL_FALSE;\n    }\n}\n\n// Enter fullscreen mode\n//\nstatic void enterFullscreenMode(_GLFWwindow* window)\n{\n    if (!_glfw.x11.saver.changed)\n    {\n        // Remember old screen saver settings\n        XGetScreenSaver(_glfw.x11.display,\n                        &_glfw.x11.saver.timeout,\n                        &_glfw.x11.saver.interval,\n                        &_glfw.x11.saver.blanking,\n                        &_glfw.x11.saver.exposure);\n\n        // Disable screen saver\n        XSetScreenSaver(_glfw.x11.display, 0, 0, DontPreferBlanking,\n                        DefaultExposures);\n\n        _glfw.x11.saver.changed = GL_TRUE;\n    }\n\n    _glfwSetVideoMode(window->monitor, &window->videoMode);\n\n    if (_glfw.x11.hasEWMH &&\n        _glfw.x11.NET_WM_STATE != None &&\n        _glfw.x11.NET_WM_STATE_FULLSCREEN != None)\n    {\n        int x, y;\n        _glfwPlatformGetMonitorPos(window->monitor, &x, &y);\n        _glfwPlatformSetWindowPos(window, x, y);\n\n        if (_glfw.x11.NET_ACTIVE_WINDOW != None)\n        {\n            // Ask the window manager to raise and focus the GLFW window\n            // Only focused windows with the _NET_WM_STATE_FULLSCREEN state end\n            // up on top of all other windows (\"Stacking order\" in EWMH spec)\n\n            XEvent event;\n            memset(&event, 0, sizeof(event));\n\n            event.type = ClientMessage;\n            event.xclient.window = window->x11.handle;\n            event.xclient.format = 32; // Data is 32-bit longs\n            event.xclient.message_type = _glfw.x11.NET_ACTIVE_WINDOW;\n            event.xclient.data.l[0] = 1; // Sender is a normal application\n            event.xclient.data.l[1] = 0; // We don't really know the timestamp\n\n            XSendEvent(_glfw.x11.display,\n                       _glfw.x11.root,\n                       False,\n                       SubstructureNotifyMask | SubstructureRedirectMask,\n                       &event);\n        }\n\n        // Ask the window manager to make the GLFW window a fullscreen window\n        // Fullscreen windows are undecorated and, when focused, are kept\n        // on top of all other windows\n\n        XEvent event;\n        memset(&event, 0, sizeof(event));\n\n        event.type = ClientMessage;\n        event.xclient.window = window->x11.handle;\n        event.xclient.format = 32; // Data is 32-bit longs\n        event.xclient.message_type = _glfw.x11.NET_WM_STATE;\n        event.xclient.data.l[0] = _NET_WM_STATE_ADD;\n        event.xclient.data.l[1] = _glfw.x11.NET_WM_STATE_FULLSCREEN;\n        event.xclient.data.l[2] = 0; // No secondary property\n        event.xclient.data.l[3] = 1; // Sender is a normal application\n\n        XSendEvent(_glfw.x11.display,\n                   _glfw.x11.root,\n                   False,\n                   SubstructureNotifyMask | SubstructureRedirectMask,\n                   &event);\n    }\n    else if (window->x11.overrideRedirect)\n    {\n        // In override-redirect mode we have divorced ourselves from the\n        // window manager, so we need to do everything manually\n\n        GLFWvidmode mode;\n        _glfwPlatformGetVideoMode(window->monitor, &mode);\n\n        XRaiseWindow(_glfw.x11.display, window->x11.handle);\n        XSetInputFocus(_glfw.x11.display, window->x11.handle,\n                       RevertToParent, CurrentTime);\n        XMoveWindow(_glfw.x11.display, window->x11.handle, 0, 0);\n        XResizeWindow(_glfw.x11.display, window->x11.handle,\n                      mode.width, mode.height);\n    }\n}\n\n// Leave fullscreen mode\n//\nstatic void leaveFullscreenMode(_GLFWwindow* window)\n{\n    _glfwRestoreVideoMode(window->monitor);\n\n    if (_glfw.x11.saver.changed)\n    {\n        // Restore old screen saver settings\n        XSetScreenSaver(_glfw.x11.display,\n                        _glfw.x11.saver.timeout,\n                        _glfw.x11.saver.interval,\n                        _glfw.x11.saver.blanking,\n                        _glfw.x11.saver.exposure);\n\n        _glfw.x11.saver.changed = GL_FALSE;\n    }\n\n    if (_glfw.x11.hasEWMH &&\n        _glfw.x11.NET_WM_STATE != None &&\n        _glfw.x11.NET_WM_STATE_FULLSCREEN != None)\n    {\n        // Ask the window manager to make the GLFW window a normal window\n        // Normal windows usually have frames and other decorations\n\n        XEvent event;\n        memset(&event, 0, sizeof(event));\n\n        event.type = ClientMessage;\n        event.xclient.window = window->x11.handle;\n        event.xclient.format = 32; // Data is 32-bit longs\n        event.xclient.message_type = _glfw.x11.NET_WM_STATE;\n        event.xclient.data.l[0] = _NET_WM_STATE_REMOVE;\n        event.xclient.data.l[1] = _glfw.x11.NET_WM_STATE_FULLSCREEN;\n        event.xclient.data.l[2] = 0; // No secondary property\n        event.xclient.data.l[3] = 1; // Sender is a normal application\n\n        XSendEvent(_glfw.x11.display,\n                   _glfw.x11.root,\n                   False,\n                   SubstructureNotifyMask | SubstructureRedirectMask,\n                   &event);\n    }\n}\n\n// Process the specified X event\n//\nstatic void processEvent(XEvent *event)\n{\n    _GLFWwindow* window = NULL;\n\n    if (event->type != GenericEvent)\n    {\n        window = _glfwFindWindowByHandle(event->xany.window);\n        if (window == NULL)\n        {\n            // This is either an event for a destroyed GLFW window or an event\n            // of a type not currently supported by GLFW\n            return;\n        }\n    }\n\n    switch (event->type)\n    {\n        case KeyPress:\n        {\n            const int key = translateKey(event->xkey.keycode);\n            const int mods = translateState(event->xkey.state);\n\n            _glfwInputKey(window, key, event->xkey.keycode, GLFW_PRESS, mods);\n\n            if (!(mods & GLFW_MOD_CONTROL) && !(mods & GLFW_MOD_ALT))\n                _glfwInputChar(window, translateChar(&event->xkey));\n\n            break;\n        }\n\n        case KeyRelease:\n        {\n            const int key = translateKey(event->xkey.keycode);\n            const int mods = translateState(event->xkey.state);\n\n            _glfwInputKey(window, key, event->xkey.keycode, GLFW_RELEASE, mods);\n            break;\n        }\n\n        case ButtonPress:\n        {\n            const int mods = translateState(event->xbutton.state);\n\n            if (event->xbutton.button == Button1)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_LEFT, GLFW_PRESS, mods);\n            else if (event->xbutton.button == Button2)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_MIDDLE, GLFW_PRESS, mods);\n            else if (event->xbutton.button == Button3)\n                _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_RIGHT, GLFW_PRESS, mods);\n\n            // Modern X provides scroll events as mouse button presses\n            else if (event->xbutton.button == Button4)\n                _glfwInputScroll(window, 0.0, 1.0);\n            else if (event->xbutton.button == Button5)\n                _glfwInputScroll(window, 0.0, -1.0);\n            else if (event->xbutton.button == Button6)\n                _glfwInputScroll(window, -1.0, 0.0);\n            else if (event->xbutton.button == Button7)\n                _glfwInputScroll(window, 1.0, 0.0);\n\n            break;\n        }\n\n        case ButtonRelease:\n        {\n            const int mods = translateState(event->xbutton.state);\n\n            if (event->xbutton.button == Button1)\n            {\n                _glfwInputMouseClick(window,\n                                     GLFW_MOUSE_BUTTON_LEFT,\n                                     GLFW_RELEASE,\n                                     mods);\n            }\n            else if (event->xbutton.button == Button2)\n            {\n                _glfwInputMouseClick(window,\n                                     GLFW_MOUSE_BUTTON_MIDDLE,\n                                     GLFW_RELEASE,\n                                     mods);\n            }\n            else if (event->xbutton.button == Button3)\n            {\n                _glfwInputMouseClick(window,\n                                     GLFW_MOUSE_BUTTON_RIGHT,\n                                     GLFW_RELEASE,\n                                     mods);\n            }\n            break;\n        }\n\n        case EnterNotify:\n        {\n            if (window->cursorMode == GLFW_CURSOR_HIDDEN)\n                hideCursor(window);\n\n            _glfwInputCursorEnter(window, GL_TRUE);\n            break;\n        }\n\n        case LeaveNotify:\n        {\n            if (window->cursorMode == GLFW_CURSOR_HIDDEN)\n                showCursor(window);\n\n            _glfwInputCursorEnter(window, GL_FALSE);\n            break;\n        }\n\n        case MotionNotify:\n        {\n            if (event->xmotion.x != window->x11.warpPosX ||\n                event->xmotion.y != window->x11.warpPosY)\n            {\n                // The cursor was moved by something other than GLFW\n\n                int x, y;\n\n                if (window->cursorMode == GLFW_CURSOR_DISABLED)\n                {\n                    if (_glfw.focusedWindow != window)\n                        break;\n\n                    x = event->xmotion.x - window->x11.cursorPosX;\n                    y = event->xmotion.y - window->x11.cursorPosY;\n                }\n                else\n                {\n                    x = event->xmotion.x;\n                    y = event->xmotion.y;\n                }\n\n                _glfwInputCursorMotion(window, x, y);\n            }\n\n            window->x11.cursorPosX = event->xmotion.x;\n            window->x11.cursorPosY = event->xmotion.y;\n            break;\n        }\n\n        case ConfigureNotify:\n        {\n            if (event->xconfigure.width != window->x11.width ||\n                event->xconfigure.height != window->x11.height)\n            {\n                _glfwInputFramebufferSize(window,\n                                          event->xconfigure.width,\n                                          event->xconfigure.height);\n\n                _glfwInputWindowSize(window,\n                                     event->xconfigure.width,\n                                     event->xconfigure.height);\n\n                window->x11.width = event->xconfigure.width;\n                window->x11.height = event->xconfigure.height;\n            }\n\n            if (event->xconfigure.x != window->x11.xpos ||\n                event->xconfigure.y != window->x11.ypos)\n            {\n                _glfwInputWindowPos(window,\n                                    event->xconfigure.x,\n                                    event->xconfigure.y);\n\n                window->x11.xpos = event->xconfigure.x;\n                window->x11.ypos = event->xconfigure.y;\n            }\n\n            break;\n        }\n\n        case ClientMessage:\n        {\n            // Custom client message, probably from the window manager\n\n            if ((Atom) event->xclient.data.l[0] == _glfw.x11.WM_DELETE_WINDOW)\n            {\n                // The window manager was asked to close the window, for example by\n                // the user pressing a 'close' window decoration button\n\n                _glfwInputWindowCloseRequest(window);\n            }\n            else if (_glfw.x11.NET_WM_PING != None &&\n                     (Atom) event->xclient.data.l[0] == _glfw.x11.NET_WM_PING)\n            {\n                // The window manager is pinging the application to ensure it's\n                // still responding to events\n\n                event->xclient.window = _glfw.x11.root;\n                XSendEvent(_glfw.x11.display,\n                           event->xclient.window,\n                           False,\n                           SubstructureNotifyMask | SubstructureRedirectMask,\n                           event);\n            }\n\n            break;\n        }\n\n        case MapNotify:\n        {\n            _glfwInputWindowVisibility(window, GL_TRUE);\n            break;\n        }\n\n        case UnmapNotify:\n        {\n            _glfwInputWindowVisibility(window, GL_FALSE);\n            break;\n        }\n\n        case FocusIn:\n        {\n            _glfwInputWindowFocus(window, GL_TRUE);\n\n            if (window->cursorMode == GLFW_CURSOR_DISABLED)\n                captureCursor(window);\n\n            break;\n        }\n\n        case FocusOut:\n        {\n            _glfwInputWindowFocus(window, GL_FALSE);\n\n            if (window->cursorMode == GLFW_CURSOR_DISABLED)\n                showCursor(window);\n\n            break;\n        }\n\n        case Expose:\n        {\n            _glfwInputWindowDamage(window);\n            break;\n        }\n\n        case PropertyNotify:\n        {\n            if (event->xproperty.atom == _glfw.x11.WM_STATE &&\n                event->xproperty.state == PropertyNewValue)\n            {\n                struct {\n                    CARD32 state;\n                    Window icon;\n                } *state = NULL;\n\n                if (_glfwGetWindowProperty(window->x11.handle,\n                                           _glfw.x11.WM_STATE,\n                                           _glfw.x11.WM_STATE,\n                                           (unsigned char**) &state) >= 2)\n                {\n                    if (state->state == IconicState)\n                        _glfwInputWindowIconify(window, GL_TRUE);\n                    else if (state->state == NormalState)\n                        _glfwInputWindowIconify(window, GL_FALSE);\n                }\n\n                XFree(state);\n            }\n\n            break;\n        }\n\n        case SelectionClear:\n        {\n            _glfwHandleSelectionClear(event);\n            break;\n        }\n\n        case SelectionRequest:\n        {\n            _glfwHandleSelectionRequest(event);\n            break;\n        }\n\n        case DestroyNotify:\n            return;\n\n        case GenericEvent:\n        {\n            if (event->xcookie.extension == _glfw.x11.xi.majorOpcode &&\n                XGetEventData(_glfw.x11.display, &event->xcookie))\n            {\n                if (event->xcookie.evtype == XI_Motion)\n                {\n                    XIDeviceEvent* data = (XIDeviceEvent*) event->xcookie.data;\n\n                    window = _glfwFindWindowByHandle(data->event);\n                    if (window)\n                    {\n                        if (data->event_x != window->x11.warpPosX ||\n                            data->event_y != window->x11.warpPosY)\n                        {\n                            // The cursor was moved by something other than GLFW\n\n                            double x, y;\n\n                            if (window->cursorMode == GLFW_CURSOR_DISABLED)\n                            {\n                                if (_glfw.focusedWindow != window)\n                                    break;\n\n                                x = data->event_x - window->x11.cursorPosX;\n                                y = data->event_y - window->x11.cursorPosY;\n                            }\n                            else\n                            {\n                                x = data->event_x;\n                                y = data->event_y;\n                            }\n\n                            _glfwInputCursorMotion(window, x, y);\n                        }\n\n                        window->x11.cursorPosX = data->event_x;\n                        window->x11.cursorPosY = data->event_y;\n                    }\n                }\n            }\n\n            XFreeEventData(_glfw.x11.display, &event->xcookie);\n            break;\n        }\n\n        default:\n        {\n            switch (event->type - _glfw.x11.randr.eventBase)\n            {\n                case RRScreenChangeNotify:\n                {\n                    XRRUpdateConfiguration(event);\n                    break;\n                }\n            }\n\n            break;\n        }\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW internal API                      //////\n//////////////////////////////////////////////////////////////////////////\n\n// Return the GLFW window corresponding to the specified X11 window\n//\n_GLFWwindow* _glfwFindWindowByHandle(Window handle)\n{\n    _GLFWwindow* window;\n\n    if (XFindContext(_glfw.x11.display,\n                     handle,\n                     _glfw.x11.context,\n                     (XPointer*) &window) != 0)\n    {\n        return NULL;\n    }\n\n    return window;\n}\n\n// Retrieve a single window property of the specified type\n// Inspired by fghGetWindowProperty from freeglut\n//\nunsigned long _glfwGetWindowProperty(Window window,\n                                     Atom property,\n                                     Atom type,\n                                     unsigned char** value)\n{\n    Atom actualType;\n    int actualFormat;\n    unsigned long itemCount, bytesAfter;\n\n    XGetWindowProperty(_glfw.x11.display,\n                       window,\n                       property,\n                       0,\n                       LONG_MAX,\n                       False,\n                       type,\n                       &actualType,\n                       &actualFormat,\n                       &itemCount,\n                       &bytesAfter,\n                       value);\n\n    if (actualType != type)\n        return 0;\n\n    return itemCount;\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                       GLFW platform API                      //////\n//////////////////////////////////////////////////////////////////////////\n\nint _glfwPlatformCreateWindow(_GLFWwindow* window,\n                              const _GLFWwndconfig* wndconfig,\n                              const _GLFWfbconfig* fbconfig)\n{\n    if (!_glfwCreateContext(window, wndconfig, fbconfig))\n        return GL_FALSE;\n\n    if (!createWindow(window, wndconfig))\n        return GL_FALSE;\n\n    if (wndconfig->monitor)\n    {\n        _glfwPlatformShowWindow(window);\n        enterFullscreenMode(window);\n    }\n\n    return GL_TRUE;\n}\n\nvoid _glfwPlatformDestroyWindow(_GLFWwindow* window)\n{\n    if (window->monitor)\n        leaveFullscreenMode(window);\n\n    _glfwDestroyContext(window);\n\n    if (window->x11.handle)\n    {\n        if (window->x11.handle ==\n            XGetSelectionOwner(_glfw.x11.display, _glfw.x11.CLIPBOARD))\n        {\n            _glfwPushSelectionToManager(window);\n        }\n\n        XDeleteContext(_glfw.x11.display, window->x11.handle, _glfw.x11.context);\n        XUnmapWindow(_glfw.x11.display, window->x11.handle);\n        XDestroyWindow(_glfw.x11.display, window->x11.handle);\n        window->x11.handle = (Window) 0;\n    }\n\n    if (window->x11.colormap)\n    {\n        XFreeColormap(_glfw.x11.display, window->x11.colormap);\n        window->x11.colormap = (Colormap) 0;\n    }\n}\n\nvoid _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)\n{\n#if defined(X_HAVE_UTF8_STRING)\n    Xutf8SetWMProperties(_glfw.x11.display,\n                         window->x11.handle,\n                         title, title,\n                         NULL, 0,\n                         NULL, NULL, NULL);\n#else\n    // This may be a slightly better fallback than using XStoreName and\n    // XSetIconName, which always store their arguments using STRING\n    XmbSetWMProperties(_glfw.x11.display,\n                       window->x11.handle,\n                       title, title,\n                       NULL, 0,\n                       NULL, NULL, NULL);\n#endif\n\n    if (_glfw.x11.NET_WM_NAME != None)\n    {\n        XChangeProperty(_glfw.x11.display,  window->x11.handle,\n                        _glfw.x11.NET_WM_NAME, _glfw.x11.UTF8_STRING, 8,\n                        PropModeReplace,\n                        (unsigned char*) title, strlen(title));\n    }\n\n    if (_glfw.x11.NET_WM_ICON_NAME != None)\n    {\n        XChangeProperty(_glfw.x11.display,  window->x11.handle,\n                        _glfw.x11.NET_WM_ICON_NAME, _glfw.x11.UTF8_STRING, 8,\n                        PropModeReplace,\n                        (unsigned char*) title, strlen(title));\n    }\n}\n\nvoid _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)\n{\n    Window child;\n    int x, y;\n\n    XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root,\n                          0, 0, &x, &y, &child);\n\n    if (xpos)\n        *xpos = x;\n    if (ypos)\n        *ypos = y;\n}\n\nvoid _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)\n{\n    XMoveWindow(_glfw.x11.display, window->x11.handle, xpos, ypos);\n    XFlush(_glfw.x11.display);\n}\n\nvoid _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)\n{\n    XWindowAttributes attribs;\n    XGetWindowAttributes(_glfw.x11.display, window->x11.handle, &attribs);\n\n    if (width)\n        *width = attribs.width;\n    if (height)\n        *height = attribs.height;\n}\n\nvoid _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)\n{\n    if (!window->resizable)\n    {\n        // Update window size restrictions to match new window size\n\n        XSizeHints* hints = XAllocSizeHints();\n\n        hints->flags |= (PMinSize | PMaxSize);\n        hints->min_width  = hints->max_width  = width;\n        hints->min_height = hints->max_height = height;\n\n        XSetWMNormalHints(_glfw.x11.display, window->x11.handle, hints);\n        XFree(hints);\n    }\n\n    if (window->monitor)\n    {\n        if (window->x11.overrideRedirect)\n        {\n            GLFWvidmode mode;\n            _glfwPlatformGetVideoMode(window->monitor, &mode);\n            XResizeWindow(_glfw.x11.display, window->x11.handle,\n                          window->videoMode.width, window->videoMode.height);\n        }\n\n        _glfwSetVideoMode(window->monitor, &window->videoMode);\n    }\n    else\n        XResizeWindow(_glfw.x11.display, window->x11.handle, width, height);\n\n    XFlush(_glfw.x11.display);\n}\n\nvoid _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)\n{\n    _glfwPlatformGetWindowSize(window, width, height);\n}\n\nvoid _glfwPlatformIconifyWindow(_GLFWwindow* window)\n{\n    if (window->x11.overrideRedirect)\n    {\n        // Override-redirect windows cannot be iconified or restored, as those\n        // tasks are performed by the window manager\n        return;\n    }\n\n    XIconifyWindow(_glfw.x11.display, window->x11.handle, _glfw.x11.screen);\n}\n\nvoid _glfwPlatformRestoreWindow(_GLFWwindow* window)\n{\n    if (window->x11.overrideRedirect)\n    {\n        // Override-redirect windows cannot be iconified or restored, as those\n        // tasks are performed by the window manager\n        return;\n    }\n\n    XMapWindow(_glfw.x11.display, window->x11.handle);\n}\n\nvoid _glfwPlatformShowWindow(_GLFWwindow* window)\n{\n    XMapRaised(_glfw.x11.display, window->x11.handle);\n    XFlush(_glfw.x11.display);\n}\n\nvoid _glfwPlatformHideWindow(_GLFWwindow* window)\n{\n    XUnmapWindow(_glfw.x11.display, window->x11.handle);\n    XFlush(_glfw.x11.display);\n}\n\nvoid _glfwPlatformPollEvents(void)\n{\n    int count = XPending(_glfw.x11.display);\n    while (count--)\n    {\n        XEvent event;\n        XNextEvent(_glfw.x11.display, &event);\n        processEvent(&event);\n    }\n\n    // Check whether the cursor has moved inside an focused window that has\n    // captured the cursor (because then it needs to be re-centered)\n\n    _GLFWwindow* window;\n    window = _glfw.focusedWindow;\n    if (window)\n    {\n        if (window->cursorMode == GLFW_CURSOR_DISABLED)\n        {\n            int width, height;\n            _glfwPlatformGetWindowSize(window, &width, &height);\n            _glfwPlatformSetCursorPos(window, width / 2, height / 2);\n\n            // NOTE: This is a temporary fix.  It works as long as you use\n            //       offsets accumulated over the course of a frame, instead of\n            //       performing the necessary actions per callback call.\n            XFlush(_glfw.x11.display);\n        }\n    }\n}\n\nvoid _glfwPlatformWaitEvents(void)\n{\n    if (!XPending(_glfw.x11.display))\n    {\n        int fd;\n        fd_set fds;\n\n        fd = ConnectionNumber(_glfw.x11.display);\n\n        FD_ZERO(&fds);\n        FD_SET(fd, &fds);\n\n        // select(1) is used instead of an X function like XNextEvent, as the\n        // wait inside those are guarded by the mutex protecting the display\n        // struct, locking out other threads from using X (including GLX)\n        if (select(fd + 1, &fds, NULL, NULL, NULL) < 0)\n            return;\n    }\n\n    _glfwPlatformPollEvents();\n}\n\nvoid _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)\n{\n    // Store the new position so it can be recognized later\n    window->x11.warpPosX = (int) x;\n    window->x11.warpPosY = (int) y;\n\n    XWarpPointer(_glfw.x11.display, None, window->x11.handle,\n                 0,0,0,0, (int) x, (int) y);\n}\n\nvoid _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)\n{\n    switch (mode)\n    {\n        case GLFW_CURSOR_NORMAL:\n            showCursor(window);\n            break;\n        case GLFW_CURSOR_HIDDEN:\n            hideCursor(window);\n            break;\n        case GLFW_CURSOR_DISABLED:\n            captureCursor(window);\n            break;\n    }\n}\n\n\n//////////////////////////////////////////////////////////////////////////\n//////                        GLFW native API                       //////\n//////////////////////////////////////////////////////////////////////////\n\nGLFWAPI Display* glfwGetX11Display(void)\n{\n    _GLFW_REQUIRE_INIT_OR_RETURN(NULL);\n    return _glfw.x11.display;\n}\n\nGLFWAPI Window glfwGetX11Window(GLFWwindow* handle)\n{\n    _GLFWwindow* window = (_GLFWwindow*) handle;\n    _GLFW_REQUIRE_INIT_OR_RETURN(None);\n    return window->x11.handle;\n}\n\n"
  },
  {
    "path": "tests/3rdparty/stb/stb_image.h",
    "content": "/* stb_image - v2.02 - public domain image loader - http://nothings.org/stb_image.h\n                                     no warranty implied; use at your own risk\n\n   Do this:\n      #define STB_IMAGE_IMPLEMENTATION\n   before you include this file in *one* C or C++ file to create the implementation.\n\n   // i.e. it should look like this:\n   #include ...\n   #include ...\n   #include ...\n   #define STB_IMAGE_IMPLEMENTATION\n   #include \"stb_image.h\"\n\n   You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.\n   And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free\n\n\n   QUICK NOTES:\n      Primarily of interest to game developers and other people who can\n          avoid problematic images and only need the trivial interface\n\n      JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)\n      PNG 1/2/4/8-bit-per-channel (16 bpc not supported)\n\n      TGA (not sure what subset, if a subset)\n      BMP non-1bpp, non-RLE\n      PSD (composited view only, no extra channels)\n\n      GIF (*comp always reports as 4-channel)\n      HDR (radiance rgbE format)\n      PIC (Softimage PIC)\n      PNM (PPM and PGM binary only)\n\n      - decode from memory or through FILE (define STBI_NO_STDIO to remove code)\n      - decode from arbitrary I/O callbacks\n      - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)\n\n   Full documentation under \"DOCUMENTATION\" below.\n\n\n   Revision 2.00 release notes:\n\n      - Progressive JPEG is now supported.\n\n      - PPM and PGM binary formats are now supported, thanks to Ken Miller.\n\n      - x86 platforms now make use of SSE2 SIMD instructions for\n        JPEG decoding, and ARM platforms can use NEON SIMD if requested.\n        This work was done by Fabian \"ryg\" Giesen. SSE2 is used by\n        default, but NEON must be enabled explicitly; see docs.\n\n        With other JPEG optimizations included in this version, we see\n        2x speedup on a JPEG on an x86 machine, and a 1.5x speedup\n        on a JPEG on an ARM machine, relative to previous versions of this\n        library. The same results will not obtain for all JPGs and for all\n        x86/ARM machines. (Note that progressive JPEGs are significantly\n        slower to decode than regular JPEGs.) This doesn't mean that this\n        is the fastest JPEG decoder in the land; rather, it brings it\n        closer to parity with standard libraries. If you want the fastest\n        decode, look elsewhere. (See \"Philosophy\" section of docs below.)\n\n        See final bullet items below for more info on SIMD.\n\n      - Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing\n        the memory allocator. Unlike other STBI libraries, these macros don't\n        support a context parameter, so if you need to pass a context in to\n        the allocator, you'll have to store it in a global or a thread-local\n        variable.\n\n      - Split existing STBI_NO_HDR flag into two flags, STBI_NO_HDR and\n        STBI_NO_LINEAR.\n            STBI_NO_HDR:     suppress implementation of .hdr reader format\n            STBI_NO_LINEAR:  suppress high-dynamic-range light-linear float API\n\n      - You can suppress implementation of any of the decoders to reduce\n        your code footprint by #defining one or more of the following\n        symbols before creating the implementation.\n\n            STBI_NO_JPEG\n            STBI_NO_PNG\n            STBI_NO_BMP\n            STBI_NO_PSD\n            STBI_NO_TGA\n            STBI_NO_GIF\n            STBI_NO_HDR\n            STBI_NO_PIC\n            STBI_NO_PNM   (.ppm and .pgm)\n\n      - You can request *only* certain decoders and suppress all other ones\n        (this will be more forward-compatible, as addition of new decoders\n        doesn't require you to disable them explicitly):\n\n            STBI_ONLY_JPEG\n            STBI_ONLY_PNG\n            STBI_ONLY_BMP\n            STBI_ONLY_PSD\n            STBI_ONLY_TGA\n            STBI_ONLY_GIF\n            STBI_ONLY_HDR\n            STBI_ONLY_PIC\n            STBI_ONLY_PNM   (.ppm and .pgm)\n\n         Note that you can define multiples of these, and you will get all\n         of them (\"only x\" and \"only y\" is interpreted to mean \"only x&y\").\n\n       - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still\n         want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB\n\n      - Compilation of all SIMD code can be suppressed with\n            #define STBI_NO_SIMD\n        It should not be necessary to disable SIMD unless you have issues\n        compiling (e.g. using an x86 compiler which doesn't support SSE\n        intrinsics or that doesn't support the method used to detect\n        SSE2 support at run-time), and even those can be reported as\n        bugs so I can refine the built-in compile-time checking to be\n        smarter.\n\n      - The old STBI_SIMD system which allowed installing a user-defined\n        IDCT etc. has been removed. If you need this, don't upgrade. My\n        assumption is that almost nobody was doing this, and those who\n        were will find the built-in SIMD more satisfactory anyway.\n\n      - RGB values computed for JPEG images are slightly different from\n        previous versions of stb_image. (This is due to using less\n        integer precision in SIMD.) The C code has been adjusted so\n        that the same RGB values will be computed regardless of whether\n        SIMD support is available, so your app should always produce\n        consistent results. But these results are slightly different from\n        previous versions. (Specifically, about 3% of available YCbCr values\n        will compute different RGB results from pre-1.49 versions by +-1;\n        most of the deviating values are one smaller in the G channel.)\n\n      - If you must produce consistent results with previous versions of\n        stb_image, #define STBI_JPEG_OLD and you will get the same results\n        you used to; however, you will not get the SIMD speedups for\n        the YCbCr-to-RGB conversion step (although you should still see\n        significant JPEG speedup from the other changes).\n\n        Please note that STBI_JPEG_OLD is a temporary feature; it will be\n        removed in future versions of the library. It is only intended for\n        near-term back-compatibility use.\n\n\n   Latest revision history:\n      2.02  (2015-01-19) fix incorrect assert, fix warning\n      2.01  (2015-01-17) fix various warnings\n      2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG\n      2.00  (2014-12-25) optimize JPEG, including x86 SSE2 & ARM NEON SIMD\n                         progressive JPEG\n                         PGM/PPM support\n                         STBI_MALLOC,STBI_REALLOC,STBI_FREE\n                         STBI_NO_*, STBI_ONLY_*\n                         GIF bugfix\n      1.48  (2014-12-14) fix incorrectly-named assert()\n      1.47  (2014-12-14) 1/2/4-bit PNG support (both grayscale and paletted)\n                         optimize PNG\n                         fix bug in interlaced PNG with user-specified channel count\n      1.46  (2014-08-26) fix broken tRNS chunk in non-paletted PNG\n      1.45  (2014-08-16) workaround MSVC-ARM internal compiler error by wrapping malloc\n\n   See end of file for full revision history.\n\n\n ============================    Contributors    =========================\n\n Image formats                                Bug fixes & warning fixes\n    Sean Barrett (jpeg, png, bmp)                Marc LeBlanc\n    Nicolas Schulz (hdr, psd)                    Christpher Lloyd\n    Jonathan Dummer (tga)                        Dave Moore\n    Jean-Marc Lienher (gif)                      Won Chun\n    Tom Seddon (pic)                             the Horde3D community\n    Thatcher Ulrich (psd)                        Janez Zemva\n    Ken Miller (pgm, ppm)                        Jonathan Blow\n                                                 Laurent Gomila\n                                                 Aruelien Pocheville\n Extensions, features                            Ryamond Barbiero\n    Jetro Lauha (stbi_info)                      David Woo\n    Martin \"SpartanJ\" Golini (stbi_info)         Martin Golini\n    James \"moose2000\" Brown (iPhone PNG)         Roy Eltham\n    Ben \"Disch\" Wenger (io callbacks)            Luke Graham\n    Omar Cornut (1/2/4-bit PNG)                  Thomas Ruf\n                                                 John Bartholomew\n                                                 Ken Hamada\n Optimizations & bugfixes                        Cort Stratton\n    Fabian \"ryg\" Giesen                          Blazej Dariusz Roszkowski\n    Arseny Kapoulkine                            Thibault Reuille\n                                                 Paul Du Bois\n                                                 Guillaume George\n  If your name should be here but                Jerry Jansson\n  isn't, let Sean know.                          Hayaki Saito\n                                                 Johan Duparc\n                                                 Ronny Chevalier\n                                                 Michal Cichon\n                                                 Tero Hanninen\n                                                 Sergio Gonzalez\n                                                 Cass Everitt\n                                                 Engin Manap\n\nLicense:\n   This software is in the public domain. Where that dedication is not\n   recognized, you are granted a perpetual, irrevocable license to copy\n   and modify this file however you want.\n\n*/\n\n#ifndef STBI_INCLUDE_STB_IMAGE_H\n#define STBI_INCLUDE_STB_IMAGE_H\n\n// DOCUMENTATION\n//\n// Limitations:\n//    - no 16-bit-per-channel PNG\n//    - no 12-bit-per-channel JPEG\n//    - no JPEGs with arithmetic coding\n//    - no 1-bit BMP\n//    - GIF always returns *comp=4\n//\n// Basic usage (see HDR discussion below for HDR usage):\n//    int x,y,n;\n//    unsigned char *data = stbi_load(filename, &x, &y, &n, 0);\n//    // ... process data if not NULL ...\n//    // ... x = width, y = height, n = # 8-bit components per pixel ...\n//    // ... replace '0' with '1'..'4' to force that many components per pixel\n//    // ... but 'n' will always be the number that it would have been if you said 0\n//    stbi_image_free(data)\n//\n// Standard parameters:\n//    int *x       -- outputs image width in pixels\n//    int *y       -- outputs image height in pixels\n//    int *comp    -- outputs # of image components in image file\n//    int req_comp -- if non-zero, # of image components requested in result\n//\n// The return value from an image loader is an 'unsigned char *' which points\n// to the pixel data, or NULL on an allocation failure or if the image is\n// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels,\n// with each pixel consisting of N interleaved 8-bit components; the first\n// pixel pointed to is top-left-most in the image. There is no padding between\n// image scanlines or between pixels, regardless of format. The number of\n// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise.\n// If req_comp is non-zero, *comp has the number of components that _would_\n// have been output otherwise. E.g. if you set req_comp to 4, you will always\n// get RGBA output, but you can check *comp to see if it's trivially opaque\n// because e.g. there were only 3 channels in the source image.\n//\n// An output image with N components has the following components interleaved\n// in this order in each pixel:\n//\n//     N=#comp     components\n//       1           grey\n//       2           grey, alpha\n//       3           red, green, blue\n//       4           red, green, blue, alpha\n//\n// If image loading fails for any reason, the return value will be NULL,\n// and *x, *y, *comp will be unchanged. The function stbi_failure_reason()\n// can be queried for an extremely brief, end-user unfriendly explanation\n// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid\n// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly\n// more user-friendly ones.\n//\n// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.\n//\n// ===========================================================================\n//\n// Philosophy\n//\n// stb libraries are designed with the following priorities:\n//\n//    1. easy to use\n//    2. easy to maintain\n//    3. good performance\n//\n// Sometimes I let \"good performance\" creep up in priority over \"easy to maintain\",\n// and for best performance I may provide less-easy-to-use APIs that give higher\n// performance, in addition to the easy to use ones. Nevertheless, it's important\n// to keep in mind that from the standpoint of you, a client of this library,\n// all you care about is #1 and #3, and stb libraries do not emphasize #3 above all.\n//\n// Some secondary priorities arise directly from the first two, some of which\n// make more explicit reasons why performance can't be emphasized.\n//\n//    - Portable (\"ease of use\")\n//    - Small footprint (\"easy to maintain\")\n//    - No dependencies (\"ease of use\")\n//\n// ===========================================================================\n//\n// I/O callbacks\n//\n// I/O callbacks allow you to read from arbitrary sources, like packaged\n// files or some other source. Data read from callbacks are processed\n// through a small internal buffer (currently 128 bytes) to try to reduce\n// overhead.\n//\n// The three functions you must define are \"read\" (reads some bytes of data),\n// \"skip\" (skips some bytes of data), \"eof\" (reports if the stream is at the end).\n//\n// ===========================================================================\n//\n// SIMD support\n//\n// The JPEG decoder will try to automatically use SIMD kernels on x86 when\n// supported by the compiler. For ARM Neon support, you must explicitly\n// request it.\n//\n// (The old do-it-yourself SIMD API is no longer supported in the current\n// code.)\n//\n// On x86, SSE2 will automatically be used when available based on a run-time\n// test; if not, the generic C versions are used as a fall-back. On ARM targets,\n// the typical path is to have separate builds for NEON and non-NEON devices\n// (at least this is true for iOS and Android). Therefore, the NEON support is\n// toggled by a build flag: define STBI_NEON to get NEON loops.\n//\n// The output of the JPEG decoder is slightly different from versions where\n// SIMD support was introduced (that is, for versions before 1.49). The\n// difference is only +-1 in the 8-bit RGB channels, and only on a small\n// fraction of pixels. You can force the pre-1.49 behavior by defining\n// STBI_JPEG_OLD, but this will disable some of the SIMD decoding path\n// and hence cost some performance.\n//\n// If for some reason you do not want to use any of SIMD code, or if\n// you have issues compiling it, you can disable it entirely by\n// defining STBI_NO_SIMD.\n//\n// ===========================================================================\n//\n// HDR image support   (disable by defining STBI_NO_HDR)\n//\n// stb_image now supports loading HDR images in general, and currently\n// the Radiance .HDR file format, although the support is provided\n// generically. You can still load any file through the existing interface;\n// if you attempt to load an HDR file, it will be automatically remapped to\n// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;\n// both of these constants can be reconfigured through this interface:\n//\n//     stbi_hdr_to_ldr_gamma(2.2f);\n//     stbi_hdr_to_ldr_scale(1.0f);\n//\n// (note, do not use _inverse_ constants; stbi_image will invert them\n// appropriately).\n//\n// Additionally, there is a new, parallel interface for loading files as\n// (linear) floats to preserve the full dynamic range:\n//\n//    float *data = stbi_loadf(filename, &x, &y, &n, 0);\n//\n// If you load LDR images through this interface, those images will\n// be promoted to floating point values, run through the inverse of\n// constants corresponding to the above:\n//\n//     stbi_ldr_to_hdr_scale(1.0f);\n//     stbi_ldr_to_hdr_gamma(2.2f);\n//\n// Finally, given a filename (or an open file or memory block--see header\n// file for details) containing image data, you can query for the \"most\n// appropriate\" interface to use (that is, whether the image is HDR or\n// not), using:\n//\n//     stbi_is_hdr(char *filename);\n//\n// ===========================================================================\n//\n// iPhone PNG support:\n//\n// By default we convert iphone-formatted PNGs back to RGB, even though\n// they are internally encoded differently. You can disable this conversion\n// by by calling stbi_convert_iphone_png_to_rgb(0), in which case\n// you will always just get the native iphone \"format\" through (which\n// is BGR stored in RGB).\n//\n// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per\n// pixel to remove any premultiplied alpha *only* if the image file explicitly\n// says there's premultiplied data (currently only happens in iPhone images,\n// and only if iPhone convert-to-rgb processing is on).\n//\n\n\n#ifndef STBI_NO_STDIO\n#include <stdio.h>\n#endif // STBI_NO_STDIO\n\n#define STBI_VERSION 1\n\nenum\n{\n   STBI_default = 0, // only used for req_comp\n\n   STBI_grey       = 1,\n   STBI_grey_alpha = 2,\n   STBI_rgb        = 3,\n   STBI_rgb_alpha  = 4\n};\n\ntypedef unsigned char stbi_uc;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifdef STB_IMAGE_STATIC\n#define STBIDEF static\n#else\n#define STBIDEF extern\n#endif\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// PRIMARY API - works on images of any type\n//\n\n//\n// load image by filename, open file, or memory buffer\n//\n\ntypedef struct\n{\n   int      (*read)  (void *user,char *data,int size);   // fill 'data' with 'size' bytes.  return number of bytes actually read\n   void     (*skip)  (void *user,int n);                 // skip the next 'n' bytes, or 'unget' the last -n bytes if negative\n   int      (*eof)   (void *user);                       // returns nonzero if we are at end of file/data\n} stbi_io_callbacks;\n\nSTBIDEF stbi_uc *stbi_load               (char              const *filename,           int *x, int *y, int *comp, int req_comp);\nSTBIDEF stbi_uc *stbi_load_from_memory   (stbi_uc           const *buffer, int len   , int *x, int *y, int *comp, int req_comp);\nSTBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk  , void *user, int *x, int *y, int *comp, int req_comp);\n\n#ifndef STBI_NO_STDIO\nSTBIDEF stbi_uc *stbi_load_from_file  (FILE *f,                  int *x, int *y, int *comp, int req_comp);\n// for stbi_load_from_file, file pointer is left pointing immediately after image\n#endif\n\n#ifndef STBI_NO_LINEAR\n   STBIDEF float *stbi_loadf                 (char const *filename,           int *x, int *y, int *comp, int req_comp);\n   STBIDEF float *stbi_loadf_from_memory     (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);\n   STBIDEF float *stbi_loadf_from_callbacks  (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);\n\n   #ifndef STBI_NO_STDIO\n   STBIDEF float *stbi_loadf_from_file  (FILE *f,                int *x, int *y, int *comp, int req_comp);\n   #endif\n#endif\n\n#ifndef STBI_NO_HDR\n   STBIDEF void   stbi_hdr_to_ldr_gamma(float gamma);\n   STBIDEF void   stbi_hdr_to_ldr_scale(float scale);\n#endif\n\n#ifndef STBI_NO_LINEAR\n   STBIDEF void   stbi_ldr_to_hdr_gamma(float gamma);\n   STBIDEF void   stbi_ldr_to_hdr_scale(float scale);\n#endif // STBI_NO_HDR\n\n// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR\nSTBIDEF int    stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);\nSTBIDEF int    stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);\n#ifndef STBI_NO_STDIO\nSTBIDEF int      stbi_is_hdr          (char const *filename);\nSTBIDEF int      stbi_is_hdr_from_file(FILE *f);\n#endif // STBI_NO_STDIO\n\n\n// get a VERY brief reason for failure\n// NOT THREADSAFE\nSTBIDEF const char *stbi_failure_reason  (void);\n\n// free the loaded image -- this is just free()\nSTBIDEF void     stbi_image_free      (void *retval_from_stbi_load);\n\n// get image dimensions & components without fully decoding\nSTBIDEF int      stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);\nSTBIDEF int      stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp);\n\n#ifndef STBI_NO_STDIO\nSTBIDEF int      stbi_info            (char const *filename,     int *x, int *y, int *comp);\nSTBIDEF int      stbi_info_from_file  (FILE *f,                  int *x, int *y, int *comp);\n\n#endif\n\n\n\n// for image formats that explicitly notate that they have premultiplied alpha,\n// we just return the colors as stored in the file. set this flag to force\n// unpremultiplication. results are undefined if the unpremultiply overflow.\nSTBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);\n\n// indicate whether we should process iphone images back to canonical format,\n// or just pass them through \"as-is\"\nSTBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);\n\n\n// ZLIB client - used by PNG, available for other purposes\n\nSTBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen);\nSTBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header);\nSTBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);\nSTBIDEF int   stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);\n\nSTBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);\nSTBIDEF int   stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);\n\n\n#ifdef __cplusplus\n}\n#endif\n\n//\n//\n////   end header file   /////////////////////////////////////////////////////\n#endif // STBI_INCLUDE_STB_IMAGE_H\n\n#ifdef STB_IMAGE_IMPLEMENTATION\n\n#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \\\n  || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \\\n  || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \\\n  || defined(STBI_ONLY_ZLIB)\n   #ifndef STBI_ONLY_JPEG\n   #define STBI_NO_JPEG\n   #endif\n   #ifndef STBI_ONLY_PNG\n   #define STBI_NO_PNG\n   #endif\n   #ifndef STBI_ONLY_BMP\n   #define STBI_NO_BMP\n   #endif\n   #ifndef STBI_ONLY_PSD\n   #define STBI_NO_PSD\n   #endif\n   #ifndef STBI_ONLY_TGA\n   #define STBI_NO_TGA\n   #endif\n   #ifndef STBI_ONLY_GIF\n   #define STBI_NO_GIF\n   #endif\n   #ifndef STBI_ONLY_HDR\n   #define STBI_NO_HDR\n   #endif\n   #ifndef STBI_ONLY_PIC\n   #define STBI_NO_PIC\n   #endif\n   #ifndef STBI_ONLY_PNM\n   #define STBI_NO_PNM\n   #endif\n#endif\n\n#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB)\n#define STBI_NO_ZLIB\n#endif\n\n\n#include <stdarg.h>\n#include <stddef.h> // ptrdiff_t on osx\n#include <stdlib.h>\n#include <string.h>\n\n#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)\n#include <math.h>  // ldexp\n#endif\n\n#ifndef STBI_NO_STDIO\n#include <stdio.h>\n#endif\n\n#ifndef STBI_ASSERT\n#include <assert.h>\n#define STBI_ASSERT(x) assert(x)\n#endif\n\n\n#ifndef _MSC_VER\n   #ifdef __cplusplus\n   #define stbi_inline inline\n   #else\n   #define stbi_inline\n   #endif\n#else\n   #define stbi_inline __forceinline\n#endif\n\n\n#ifdef _MSC_VER\ntypedef unsigned short stbi__uint16;\ntypedef   signed short stbi__int16;\ntypedef unsigned int   stbi__uint32;\ntypedef   signed int   stbi__int32;\n#else\n#include <stdint.h>\ntypedef uint16_t stbi__uint16;\ntypedef int16_t  stbi__int16;\ntypedef uint32_t stbi__uint32;\ntypedef int32_t  stbi__int32;\n#endif\n\n// should produce compiler error if size is wrong\ntypedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];\n\n#ifdef _MSC_VER\n#define STBI_NOTUSED(v)  (void)(v)\n#else\n#define STBI_NOTUSED(v)  (void)sizeof(v)\n#endif\n\n#ifdef _MSC_VER\n#define STBI_HAS_LROTL\n#endif\n\n#ifdef STBI_HAS_LROTL\n   #define stbi_lrot(x,y)  _lrotl(x,y)\n#else\n   #define stbi_lrot(x,y)  (((x) << (y)) | ((x) >> (32 - (y))))\n#endif\n\n#if defined(STBI_MALLOC) && defined(STBI_FREE) && defined(STBI_REALLOC)\n// ok\n#elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC)\n// ok\n#else\n#error \"Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC.\"\n#endif\n\n#ifndef STBI_MALLOC\n#define STBI_MALLOC(sz)    malloc(sz)\n#define STBI_REALLOC(p,sz) realloc(p,sz)\n#define STBI_FREE(p)       free(p)\n#endif\n\n#if defined(__GNUC__) && !defined(__SSE2__) && !defined(STBI_NO_SIMD)\n// gcc doesn't support sse2 intrinsics unless you compile with -msse2,\n// (but compiling with -msse2 allows the compiler to use SSE2 everywhere;\n// this is just broken and gcc are jerks for not fixing it properly\n// http://www.virtualdub.org/blog/pivot/entry.php?id=363 )\n#define STBI_NO_SIMD\n#endif\n\n#if !defined(STBI_NO_SIMD) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86))\n#define STBI_SSE2\n#include <emmintrin.h>\n\n#ifdef _MSC_VER\n\n#if _MSC_VER >= 1400  // not VC6\n#include <intrin.h> // __cpuid\nstatic int stbi__cpuid3(void)\n{\n   int info[4];\n   __cpuid(info,1);\n   return info[3];\n}\n#else\nstatic int stbi__cpuid3(void)\n{\n   int res;\n   __asm {\n      mov  eax,1\n      cpuid\n      mov  res,edx\n   }\n   return res;\n}\n#endif\n\n#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name\n\nstatic int stbi__sse2_available()\n{\n   int info3 = stbi__cpuid3();\n   return ((info3 >> 26) & 1) != 0;\n}\n#else // assume GCC-style if not VC++\n#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))\n\nstatic int stbi__sse2_available()\n{\n#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later\n   // GCC 4.8+ has a nice way to do this\n   return __builtin_cpu_supports(\"sse2\");\n#else\n   // portable way to do this, preferably without using GCC inline ASM?\n   // just bail for now.\n   return 0;\n#endif\n}\n#endif\n#endif\n\n// ARM NEON\n#if defined(STBI_NO_SIMD) && defined(STBI_NEON)\n#undef STBI_NEON\n#endif\n\n#ifdef STBI_NEON\n#include <arm_neon.h>\n// assume GCC or Clang on ARM targets\n#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))\n#endif\n\n#ifndef STBI_SIMD_ALIGN\n#define STBI_SIMD_ALIGN(type, name) type name\n#endif\n\n///////////////////////////////////////////////\n//\n//  stbi__context struct and start_xxx functions\n\n// stbi__context structure is our basic context used by all images, so it\n// contains all the IO context, plus some basic image information\ntypedef struct\n{\n   stbi__uint32 img_x, img_y;\n   int img_n, img_out_n;\n\n   stbi_io_callbacks io;\n   void *io_user_data;\n\n   int read_from_callbacks;\n   int buflen;\n   stbi_uc buffer_start[128];\n\n   stbi_uc *img_buffer, *img_buffer_end;\n   stbi_uc *img_buffer_original;\n} stbi__context;\n\n\nstatic void stbi__refill_buffer(stbi__context *s);\n\n// initialize a memory-decode context\nstatic void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len)\n{\n   s->io.read = NULL;\n   s->read_from_callbacks = 0;\n   s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer;\n   s->img_buffer_end = (stbi_uc *) buffer+len;\n}\n\n// initialize a callback-based context\nstatic void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user)\n{\n   s->io = *c;\n   s->io_user_data = user;\n   s->buflen = sizeof(s->buffer_start);\n   s->read_from_callbacks = 1;\n   s->img_buffer_original = s->buffer_start;\n   stbi__refill_buffer(s);\n}\n\n#ifndef STBI_NO_STDIO\n\nstatic int stbi__stdio_read(void *user, char *data, int size)\n{\n   return (int) fread(data,1,size,(FILE*) user);\n}\n\nstatic void stbi__stdio_skip(void *user, int n)\n{\n   fseek((FILE*) user, n, SEEK_CUR);\n}\n\nstatic int stbi__stdio_eof(void *user)\n{\n   return feof((FILE*) user);\n}\n\nstatic stbi_io_callbacks stbi__stdio_callbacks =\n{\n   stbi__stdio_read,\n   stbi__stdio_skip,\n   stbi__stdio_eof,\n};\n\nstatic void stbi__start_file(stbi__context *s, FILE *f)\n{\n   stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f);\n}\n\n//static void stop_file(stbi__context *s) { }\n\n#endif // !STBI_NO_STDIO\n\nstatic void stbi__rewind(stbi__context *s)\n{\n   // conceptually rewind SHOULD rewind to the beginning of the stream,\n   // but we just rewind to the beginning of the initial buffer, because\n   // we only use it after doing 'test', which only ever looks at at most 92 bytes\n   s->img_buffer = s->img_buffer_original;\n}\n\n#ifndef STBI_NO_JPEG\nstatic int      stbi__jpeg_test(stbi__context *s);\nstatic stbi_uc *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_PNG\nstatic int      stbi__png_test(stbi__context *s);\nstatic stbi_uc *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__png_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_BMP\nstatic int      stbi__bmp_test(stbi__context *s);\nstatic stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_TGA\nstatic int      stbi__tga_test(stbi__context *s);\nstatic stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__tga_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_PSD\nstatic int      stbi__psd_test(stbi__context *s);\nstatic stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__psd_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_HDR\nstatic int      stbi__hdr_test(stbi__context *s);\nstatic float   *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_PIC\nstatic int      stbi__pic_test(stbi__context *s);\nstatic stbi_uc *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__pic_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_GIF\nstatic int      stbi__gif_test(stbi__context *s);\nstatic stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__gif_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_PNM\nstatic int      stbi__pnm_test(stbi__context *s);\nstatic stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);\nstatic int      stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n// this is not threadsafe\nstatic const char *stbi__g_failure_reason;\n\nSTBIDEF const char *stbi_failure_reason(void)\n{\n   return stbi__g_failure_reason;\n}\n\nstatic int stbi__err(const char *str)\n{\n   stbi__g_failure_reason = str;\n   return 0;\n}\n\nstatic void *stbi__malloc(size_t size)\n{\n    return STBI_MALLOC(size);\n}\n\n// stbi__err - error\n// stbi__errpf - error returning pointer to float\n// stbi__errpuc - error returning pointer to unsigned char\n\n#ifdef STBI_NO_FAILURE_STRINGS\n   #define stbi__err(x,y)  0\n#elif defined(STBI_FAILURE_USERMSG)\n   #define stbi__err(x,y)  stbi__err(y)\n#else\n   #define stbi__err(x,y)  stbi__err(x)\n#endif\n\n#define stbi__errpf(x,y)   ((float *) (stbi__err(x,y)?NULL:NULL))\n#define stbi__errpuc(x,y)  ((unsigned char *) (stbi__err(x,y)?NULL:NULL))\n\nSTBIDEF void stbi_image_free(void *retval_from_stbi_load)\n{\n   STBI_FREE(retval_from_stbi_load);\n}\n\n#ifndef STBI_NO_LINEAR\nstatic float   *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp);\n#endif\n\n#ifndef STBI_NO_HDR\nstatic stbi_uc *stbi__hdr_to_ldr(float   *data, int x, int y, int comp);\n#endif\n\nstatic unsigned char *stbi_load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   #ifndef STBI_NO_JPEG\n   if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp);\n   #endif\n   #ifndef STBI_NO_PNG\n   if (stbi__png_test(s))  return stbi__png_load(s,x,y,comp,req_comp);\n   #endif\n   #ifndef STBI_NO_BMP\n   if (stbi__bmp_test(s))  return stbi__bmp_load(s,x,y,comp,req_comp);\n   #endif\n   #ifndef STBI_NO_GIF\n   if (stbi__gif_test(s))  return stbi__gif_load(s,x,y,comp,req_comp);\n   #endif\n   #ifndef STBI_NO_PSD\n   if (stbi__psd_test(s))  return stbi__psd_load(s,x,y,comp,req_comp);\n   #endif\n   #ifndef STBI_NO_PIC\n   if (stbi__pic_test(s))  return stbi__pic_load(s,x,y,comp,req_comp);\n   #endif\n   #ifndef STBI_NO_PNM\n   if (stbi__pnm_test(s))  return stbi__pnm_load(s,x,y,comp,req_comp);\n   #endif\n\n   #ifndef STBI_NO_HDR\n   if (stbi__hdr_test(s)) {\n      float *hdr = stbi__hdr_load(s, x,y,comp,req_comp);\n      return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);\n   }\n   #endif\n\n   #ifndef STBI_NO_TGA\n   // test tga last because it's a crappy test!\n   if (stbi__tga_test(s))\n      return stbi__tga_load(s,x,y,comp,req_comp);\n   #endif\n\n   return stbi__errpuc(\"unknown image type\", \"Image not of any known type, or corrupt\");\n}\n\n#ifndef STBI_NO_STDIO\n\nstatic FILE *stbi__fopen(char const *filename, char const *mode)\n{\n   FILE *f;\n#if defined(_MSC_VER) && _MSC_VER >= 1400\n   if (0 != fopen_s(&f, filename, mode))\n      f=0;\n#else\n   f = fopen(filename, mode);\n#endif\n   return f;\n}\n\n\nSTBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)\n{\n   FILE *f = stbi__fopen(filename, \"rb\");\n   unsigned char *result;\n   if (!f) return stbi__errpuc(\"can't fopen\", \"Unable to open file\");\n   result = stbi_load_from_file(f,x,y,comp,req_comp);\n   fclose(f);\n   return result;\n}\n\nSTBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)\n{\n   unsigned char *result;\n   stbi__context s;\n   stbi__start_file(&s,f);\n   result = stbi_load_main(&s,x,y,comp,req_comp);\n   if (result) {\n      // need to 'unget' all the characters in the IO buffer\n      fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);\n   }\n   return result;\n}\n#endif //!STBI_NO_STDIO\n\nSTBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)\n{\n   stbi__context s;\n   stbi__start_mem(&s,buffer,len);\n   return stbi_load_main(&s,x,y,comp,req_comp);\n}\n\nSTBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)\n{\n   stbi__context s;\n   stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);\n   return stbi_load_main(&s,x,y,comp,req_comp);\n}\n\n#ifndef STBI_NO_LINEAR\nstatic float *stbi_loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   unsigned char *data;\n   #ifndef STBI_NO_HDR\n   if (stbi__hdr_test(s))\n      return stbi__hdr_load(s,x,y,comp,req_comp);\n   #endif\n   data = stbi_load_main(s, x, y, comp, req_comp);\n   if (data)\n      return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);\n   return stbi__errpf(\"unknown image type\", \"Image not of any known type, or corrupt\");\n}\n\nSTBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)\n{\n   stbi__context s;\n   stbi__start_mem(&s,buffer,len);\n   return stbi_loadf_main(&s,x,y,comp,req_comp);\n}\n\nSTBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)\n{\n   stbi__context s;\n   stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);\n   return stbi_loadf_main(&s,x,y,comp,req_comp);\n}\n\n#ifndef STBI_NO_STDIO\nSTBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)\n{\n   float *result;\n   FILE *f = stbi__fopen(filename, \"rb\");\n   if (!f) return stbi__errpf(\"can't fopen\", \"Unable to open file\");\n   result = stbi_loadf_from_file(f,x,y,comp,req_comp);\n   fclose(f);\n   return result;\n}\n\nSTBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)\n{\n   stbi__context s;\n   stbi__start_file(&s,f);\n   return stbi_loadf_main(&s,x,y,comp,req_comp);\n}\n#endif // !STBI_NO_STDIO\n\n#endif // !STBI_NO_LINEAR\n\n// these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is\n// defined, for API simplicity; if STBI_NO_LINEAR is defined, it always\n// reports false!\n\nSTBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)\n{\n   #ifndef STBI_NO_HDR\n   stbi__context s;\n   stbi__start_mem(&s,buffer,len);\n   return stbi__hdr_test(&s);\n   #else\n   STBI_NOTUSED(buffer);\n   STBI_NOTUSED(len);\n   return 0;\n   #endif\n}\n\n#ifndef STBI_NO_STDIO\nSTBIDEF int      stbi_is_hdr          (char const *filename)\n{\n   FILE *f = stbi__fopen(filename, \"rb\");\n   int result=0;\n   if (f) {\n      result = stbi_is_hdr_from_file(f);\n      fclose(f);\n   }\n   return result;\n}\n\nSTBIDEF int      stbi_is_hdr_from_file(FILE *f)\n{\n   #ifndef STBI_NO_HDR\n   stbi__context s;\n   stbi__start_file(&s,f);\n   return stbi__hdr_test(&s);\n   #else\n   return 0;\n   #endif\n}\n#endif // !STBI_NO_STDIO\n\nSTBIDEF int      stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user)\n{\n   #ifndef STBI_NO_HDR\n   stbi__context s;\n   stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);\n   return stbi__hdr_test(&s);\n   #else\n   return 0;\n   #endif\n}\n\nstatic float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f;\nstatic float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f;\n\n#ifndef STBI_NO_LINEAR\nSTBIDEF void   stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; }\nSTBIDEF void   stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }\n#endif\n\nSTBIDEF void   stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; }\nSTBIDEF void   stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; }\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// Common code used by all image loaders\n//\n\nenum\n{\n   STBI__SCAN_load=0,\n   STBI__SCAN_type,\n   STBI__SCAN_header\n};\n\nstatic void stbi__refill_buffer(stbi__context *s)\n{\n   int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);\n   if (n == 0) {\n      // at end of file, treat same as if from memory, but need to handle case\n      // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file\n      s->read_from_callbacks = 0;\n      s->img_buffer = s->buffer_start;\n      s->img_buffer_end = s->buffer_start+1;\n      *s->img_buffer = 0;\n   } else {\n      s->img_buffer = s->buffer_start;\n      s->img_buffer_end = s->buffer_start + n;\n   }\n}\n\nstbi_inline static stbi_uc stbi__get8(stbi__context *s)\n{\n   if (s->img_buffer < s->img_buffer_end)\n      return *s->img_buffer++;\n   if (s->read_from_callbacks) {\n      stbi__refill_buffer(s);\n      return *s->img_buffer++;\n   }\n   return 0;\n}\n\nstbi_inline static int stbi__at_eof(stbi__context *s)\n{\n   if (s->io.read) {\n      if (!(s->io.eof)(s->io_user_data)) return 0;\n      // if feof() is true, check if buffer = end\n      // special case: we've only got the special 0 character at the end\n      if (s->read_from_callbacks == 0) return 1;\n   }\n\n   return s->img_buffer >= s->img_buffer_end;\n}\n\nstatic void stbi__skip(stbi__context *s, int n)\n{\n   if (s->io.read) {\n      int blen = (int) (s->img_buffer_end - s->img_buffer);\n      if (blen < n) {\n         s->img_buffer = s->img_buffer_end;\n         (s->io.skip)(s->io_user_data, n - blen);\n         return;\n      }\n   }\n   s->img_buffer += n;\n}\n\nstatic int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)\n{\n   if (s->io.read) {\n      int blen = (int) (s->img_buffer_end - s->img_buffer);\n      if (blen < n) {\n         int res, count;\n\n         memcpy(buffer, s->img_buffer, blen);\n\n         count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);\n         res = (count == (n-blen));\n         s->img_buffer = s->img_buffer_end;\n         return res;\n      }\n   }\n\n   if (s->img_buffer+n <= s->img_buffer_end) {\n      memcpy(buffer, s->img_buffer, n);\n      s->img_buffer += n;\n      return 1;\n   } else\n      return 0;\n}\n\nstatic int stbi__get16be(stbi__context *s)\n{\n   int z = stbi__get8(s);\n   return (z << 8) + stbi__get8(s);\n}\n\nstatic stbi__uint32 stbi__get32be(stbi__context *s)\n{\n   stbi__uint32 z = stbi__get16be(s);\n   return (z << 16) + stbi__get16be(s);\n}\n\nstatic int stbi__get16le(stbi__context *s)\n{\n   int z = stbi__get8(s);\n   return z + (stbi__get8(s) << 8);\n}\n\nstatic stbi__uint32 stbi__get32le(stbi__context *s)\n{\n   stbi__uint32 z = stbi__get16le(s);\n   return z + (stbi__get16le(s) << 16);\n}\n\n#define STBI__BYTECAST(x)  ((stbi_uc) ((x) & 255))  // truncate int to byte without warnings\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n//  generic converter from built-in img_n to req_comp\n//    individual types do this automatically as much as possible (e.g. jpeg\n//    does all cases internally since it needs to colorspace convert anyway,\n//    and it never has alpha, so very few cases ). png can automatically\n//    interleave an alpha=255 channel, but falls back to this for other cases\n//\n//  assume data buffer is malloced, so malloc a new one and free that one\n//  only failure mode is malloc failing\n\nstatic stbi_uc stbi__compute_y(int r, int g, int b)\n{\n   return (stbi_uc) (((r*77) + (g*150) +  (29*b)) >> 8);\n}\n\nstatic unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y)\n{\n   int i,j;\n   unsigned char *good;\n\n   if (req_comp == img_n) return data;\n   STBI_ASSERT(req_comp >= 1 && req_comp <= 4);\n\n   good = (unsigned char *) stbi__malloc(req_comp * x * y);\n   if (good == NULL) {\n      STBI_FREE(data);\n      return stbi__errpuc(\"outofmem\", \"Out of memory\");\n   }\n\n   for (j=0; j < (int) y; ++j) {\n      unsigned char *src  = data + j * x * img_n   ;\n      unsigned char *dest = good + j * x * req_comp;\n\n      #define COMBO(a,b)  ((a)*8+(b))\n      #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)\n      // convert source image with img_n components to one with req_comp components;\n      // avoid switch per pixel, so use switch per scanline and massive macros\n      switch (COMBO(img_n, req_comp)) {\n         CASE(1,2) dest[0]=src[0], dest[1]=255; break;\n         CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break;\n         CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break;\n         CASE(2,1) dest[0]=src[0]; break;\n         CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break;\n         CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break;\n         CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break;\n         CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;\n         CASE(3,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break;\n         CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;\n         CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break;\n         CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break;\n         default: STBI_ASSERT(0);\n      }\n      #undef CASE\n   }\n\n   STBI_FREE(data);\n   return good;\n}\n\n#ifndef STBI_NO_LINEAR\nstatic float   *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)\n{\n   int i,k,n;\n   float *output = (float *) stbi__malloc(x * y * comp * sizeof(float));\n   if (output == NULL) { STBI_FREE(data); return stbi__errpf(\"outofmem\", \"Out of memory\"); }\n   // compute number of non-alpha components\n   if (comp & 1) n = comp; else n = comp-1;\n   for (i=0; i < x*y; ++i) {\n      for (k=0; k < n; ++k) {\n         output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale);\n      }\n      if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;\n   }\n   STBI_FREE(data);\n   return output;\n}\n#endif\n\n#ifndef STBI_NO_HDR\n#define stbi__float2int(x)   ((int) (x))\nstatic stbi_uc *stbi__hdr_to_ldr(float   *data, int x, int y, int comp)\n{\n   int i,k,n;\n   stbi_uc *output = (stbi_uc *) stbi__malloc(x * y * comp);\n   if (output == NULL) { STBI_FREE(data); return stbi__errpuc(\"outofmem\", \"Out of memory\"); }\n   // compute number of non-alpha components\n   if (comp & 1) n = comp; else n = comp-1;\n   for (i=0; i < x*y; ++i) {\n      for (k=0; k < n; ++k) {\n         float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f;\n         if (z < 0) z = 0;\n         if (z > 255) z = 255;\n         output[i*comp + k] = (stbi_uc) stbi__float2int(z);\n      }\n      if (k < comp) {\n         float z = data[i*comp+k] * 255 + 0.5f;\n         if (z < 0) z = 0;\n         if (z > 255) z = 255;\n         output[i*comp + k] = (stbi_uc) stbi__float2int(z);\n      }\n   }\n   STBI_FREE(data);\n   return output;\n}\n#endif\n\n//////////////////////////////////////////////////////////////////////////////\n//\n//  \"baseline\" JPEG/JFIF decoder\n//\n//    simple implementation\n//      - doesn't support delayed output of y-dimension\n//      - simple interface (only one output format: 8-bit interleaved RGB)\n//      - doesn't try to recover corrupt jpegs\n//      - doesn't allow partial loading, loading multiple at once\n//      - still fast on x86 (copying globals into locals doesn't help x86)\n//      - allocates lots of intermediate memory (full size of all components)\n//        - non-interleaved case requires this anyway\n//        - allows good upsampling (see next)\n//    high-quality\n//      - upsampled channels are bilinearly interpolated, even across blocks\n//      - quality integer IDCT derived from IJG's 'slow'\n//    performance\n//      - fast huffman; reasonable integer IDCT\n//      - some SIMD kernels for common paths on targets with SSE2/NEON\n//      - uses a lot of intermediate memory, could cache poorly\n\n#ifndef STBI_NO_JPEG\n\n// huffman decoding acceleration\n#define FAST_BITS   9  // larger handles more cases; smaller stomps less cache\n\ntypedef struct\n{\n   stbi_uc  fast[1 << FAST_BITS];\n   // weirdly, repacking this into AoS is a 10% speed loss, instead of a win\n   stbi__uint16 code[256];\n   stbi_uc  values[256];\n   stbi_uc  size[257];\n   unsigned int maxcode[18];\n   int    delta[17];   // old 'firstsymbol' - old 'firstcode'\n} stbi__huffman;\n\ntypedef struct\n{\n   stbi__context *s;\n   stbi__huffman huff_dc[4];\n   stbi__huffman huff_ac[4];\n   stbi_uc dequant[4][64];\n   stbi__int16 fast_ac[4][1 << FAST_BITS];\n\n// sizes for components, interleaved MCUs\n   int img_h_max, img_v_max;\n   int img_mcu_x, img_mcu_y;\n   int img_mcu_w, img_mcu_h;\n\n// definition of jpeg image component\n   struct\n   {\n      int id;\n      int h,v;\n      int tq;\n      int hd,ha;\n      int dc_pred;\n\n      int x,y,w2,h2;\n      stbi_uc *data;\n      void *raw_data, *raw_coeff;\n      stbi_uc *linebuf;\n      short   *coeff;   // progressive only\n      int      coeff_w, coeff_h; // number of 8x8 coefficient blocks\n   } img_comp[4];\n\n   stbi__uint32   code_buffer; // jpeg entropy-coded buffer\n   int            code_bits;   // number of valid bits\n   unsigned char  marker;      // marker seen while filling entropy buffer\n   int            nomore;      // flag if we saw a marker so must stop\n\n   int            progressive;\n   int            spec_start;\n   int            spec_end;\n   int            succ_high;\n   int            succ_low;\n   int            eob_run;\n\n   int scan_n, order[4];\n   int restart_interval, todo;\n\n// kernels\n   void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]);\n   void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step);\n   stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs);\n} stbi__jpeg;\n\nstatic int stbi__build_huffman(stbi__huffman *h, int *count)\n{\n   int i,j,k=0,code;\n   // build size list for each symbol (from JPEG spec)\n   for (i=0; i < 16; ++i)\n      for (j=0; j < count[i]; ++j)\n         h->size[k++] = (stbi_uc) (i+1);\n   h->size[k] = 0;\n\n   // compute actual symbols (from jpeg spec)\n   code = 0;\n   k = 0;\n   for(j=1; j <= 16; ++j) {\n      // compute delta to add to code to compute symbol id\n      h->delta[j] = k - code;\n      if (h->size[k] == j) {\n         while (h->size[k] == j)\n            h->code[k++] = (stbi__uint16) (code++);\n         if (code-1 >= (1 << j)) return stbi__err(\"bad code lengths\",\"Corrupt JPEG\");\n      }\n      // compute largest code + 1 for this size, preshifted as needed later\n      h->maxcode[j] = code << (16-j);\n      code <<= 1;\n   }\n   h->maxcode[j] = 0xffffffff;\n\n   // build non-spec acceleration table; 255 is flag for not-accelerated\n   memset(h->fast, 255, 1 << FAST_BITS);\n   for (i=0; i < k; ++i) {\n      int s = h->size[i];\n      if (s <= FAST_BITS) {\n         int c = h->code[i] << (FAST_BITS-s);\n         int m = 1 << (FAST_BITS-s);\n         for (j=0; j < m; ++j) {\n            h->fast[c+j] = (stbi_uc) i;\n         }\n      }\n   }\n   return 1;\n}\n\n// build a table that decodes both magnitude and value of small ACs in\n// one go.\nstatic void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)\n{\n   int i;\n   for (i=0; i < (1 << FAST_BITS); ++i) {\n      stbi_uc fast = h->fast[i];\n      fast_ac[i] = 0;\n      if (fast < 255) {\n         int rs = h->values[fast];\n         int run = (rs >> 4) & 15;\n         int magbits = rs & 15;\n         int len = h->size[fast];\n\n         if (magbits && len + magbits <= FAST_BITS) {\n            // magnitude code followed by receive_extend code\n            int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits);\n            int m = 1 << (magbits - 1);\n            if (k < m) k += (-1 << magbits) + 1;\n            // if the result is small enough, we can fit it in fast_ac table\n            if (k >= -128 && k <= 127)\n               fast_ac[i] = (stbi__int16) ((k << 8) + (run << 4) + (len + magbits));\n         }\n      }\n   }\n}\n\nstatic void stbi__grow_buffer_unsafe(stbi__jpeg *j)\n{\n   do {\n      int b = j->nomore ? 0 : stbi__get8(j->s);\n      if (b == 0xff) {\n         int c = stbi__get8(j->s);\n         if (c != 0) {\n            j->marker = (unsigned char) c;\n            j->nomore = 1;\n            return;\n         }\n      }\n      j->code_buffer |= b << (24 - j->code_bits);\n      j->code_bits += 8;\n   } while (j->code_bits <= 24);\n}\n\n// (1 << n) - 1\nstatic stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};\n\n// decode a jpeg huffman value from the bitstream\nstbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)\n{\n   unsigned int temp;\n   int c,k;\n\n   if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n\n   // look at the top FAST_BITS and determine what symbol ID it is,\n   // if the code is <= FAST_BITS\n   c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);\n   k = h->fast[c];\n   if (k < 255) {\n      int s = h->size[k];\n      if (s > j->code_bits)\n         return -1;\n      j->code_buffer <<= s;\n      j->code_bits -= s;\n      return h->values[k];\n   }\n\n   // naive test is to shift the code_buffer down so k bits are\n   // valid, then test against maxcode. To speed this up, we've\n   // preshifted maxcode left so that it has (16-k) 0s at the\n   // end; in other words, regardless of the number of bits, it\n   // wants to be compared against something shifted to have 16;\n   // that way we don't need to shift inside the loop.\n   temp = j->code_buffer >> 16;\n   for (k=FAST_BITS+1 ; ; ++k)\n      if (temp < h->maxcode[k])\n         break;\n   if (k == 17) {\n      // error! code not found\n      j->code_bits -= 16;\n      return -1;\n   }\n\n   if (k > j->code_bits)\n      return -1;\n\n   // convert the huffman code to the symbol id\n   c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];\n   STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);\n\n   // convert the id to a symbol\n   j->code_bits -= k;\n   j->code_buffer <<= k;\n   return h->values[c];\n}\n\n// bias[n] = (-1<<n) + 1\nstatic int const stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};\n\n// combined JPEG 'receive' and JPEG 'extend', since baseline\n// always extends everything it receives.\nstbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)\n{\n   unsigned int k;\n   int sgn;\n   if (j->code_bits < n) stbi__grow_buffer_unsafe(j);\n\n   sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB\n   k = stbi_lrot(j->code_buffer, n);\n   j->code_buffer = k & ~stbi__bmask[n];\n   k &= stbi__bmask[n];\n   j->code_bits -= n;\n   return k + (stbi__jbias[n] & ~sgn);\n}\n\n// get some unsigned bits\nstbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)\n{\n   unsigned int k;\n   if (j->code_bits < n) stbi__grow_buffer_unsafe(j);\n   k = stbi_lrot(j->code_buffer, n);\n   j->code_buffer = k & ~stbi__bmask[n];\n   k &= stbi__bmask[n];\n   j->code_bits -= n;\n   return k;\n}\n\nstbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)\n{\n   unsigned int k;\n   if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);\n   k = j->code_buffer;\n   j->code_buffer <<= 1;\n   --j->code_bits;\n   return k & 0x80000000;\n}\n\n// given a value that's at position X in the zigzag stream,\n// where does it appear in the 8x8 matrix coded as row-major?\nstatic stbi_uc stbi__jpeg_dezigzag[64+15] =\n{\n    0,  1,  8, 16,  9,  2,  3, 10,\n   17, 24, 32, 25, 18, 11,  4,  5,\n   12, 19, 26, 33, 40, 48, 41, 34,\n   27, 20, 13,  6,  7, 14, 21, 28,\n   35, 42, 49, 56, 57, 50, 43, 36,\n   29, 22, 15, 23, 30, 37, 44, 51,\n   58, 59, 52, 45, 38, 31, 39, 46,\n   53, 60, 61, 54, 47, 55, 62, 63,\n   // let corrupt input sample past end\n   63, 63, 63, 63, 63, 63, 63, 63,\n   63, 63, 63, 63, 63, 63, 63\n};\n\n// decode one 64-entry block--\nstatic int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *dequant)\n{\n   int diff,dc,k;\n   int t;\n\n   if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n   t = stbi__jpeg_huff_decode(j, hdc);\n   if (t < 0) return stbi__err(\"bad huffman code\",\"Corrupt JPEG\");\n\n   // 0 all the ac values now so we can do it 32-bits at a time\n   memset(data,0,64*sizeof(data[0]));\n\n   diff = t ? stbi__extend_receive(j, t) : 0;\n   dc = j->img_comp[b].dc_pred + diff;\n   j->img_comp[b].dc_pred = dc;\n   data[0] = (short) (dc * dequant[0]);\n\n   // decode AC components, see JPEG spec\n   k = 1;\n   do {\n      unsigned int zig;\n      int c,r,s;\n      if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n      c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);\n      r = fac[c];\n      if (r) { // fast-AC path\n         k += (r >> 4) & 15; // run\n         s = r & 15; // combined length\n         j->code_buffer <<= s;\n         j->code_bits -= s;\n         // decode into unzigzag'd location\n         zig = stbi__jpeg_dezigzag[k++];\n         data[zig] = (short) ((r >> 8) * dequant[zig]);\n      } else {\n         int rs = stbi__jpeg_huff_decode(j, hac);\n         if (rs < 0) return stbi__err(\"bad huffman code\",\"Corrupt JPEG\");\n         s = rs & 15;\n         r = rs >> 4;\n         if (s == 0) {\n            if (rs != 0xf0) break; // end block\n            k += 16;\n         } else {\n            k += r;\n            // decode into unzigzag'd location\n            zig = stbi__jpeg_dezigzag[k++];\n            data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]);\n         }\n      }\n   } while (k < 64);\n   return 1;\n}\n\nstatic int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b)\n{\n   int diff,dc;\n   int t;\n   if (j->spec_end != 0) return stbi__err(\"can't merge dc and ac\", \"Corrupt JPEG\");\n\n   if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n\n   if (j->succ_high == 0) {\n      // first scan for DC coefficient, must be first\n      memset(data,0,64*sizeof(data[0])); // 0 all the ac values now\n      t = stbi__jpeg_huff_decode(j, hdc);\n      diff = t ? stbi__extend_receive(j, t) : 0;\n\n      dc = j->img_comp[b].dc_pred + diff;\n      j->img_comp[b].dc_pred = dc;\n      data[0] = (short) (dc << j->succ_low);\n   } else {\n      // refinement scan for DC coefficient\n      if (stbi__jpeg_get_bit(j))\n         data[0] += (short) (1 << j->succ_low);\n   }\n   return 1;\n}\n\n// @OPTIMIZE: store non-zigzagged during the decode passes,\n// and only de-zigzag when dequantizing\nstatic int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac)\n{\n   int k;\n   if (j->spec_start == 0) return stbi__err(\"can't merge dc and ac\", \"Corrupt JPEG\");\n\n   if (j->succ_high == 0) {\n      int shift = j->succ_low;\n\n      if (j->eob_run) {\n         --j->eob_run;\n         return 1;\n      }\n\n      k = j->spec_start;\n      do {\n         unsigned int zig;\n         int c,r,s;\n         if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n         c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);\n         r = fac[c];\n         if (r) { // fast-AC path\n            k += (r >> 4) & 15; // run\n            s = r & 15; // combined length\n            j->code_buffer <<= s;\n            j->code_bits -= s;\n            zig = stbi__jpeg_dezigzag[k++];\n            data[zig] = (short) ((r >> 8) << shift);\n         } else {\n            int rs = stbi__jpeg_huff_decode(j, hac);\n            if (rs < 0) return stbi__err(\"bad huffman code\",\"Corrupt JPEG\");\n            s = rs & 15;\n            r = rs >> 4;\n            if (s == 0) {\n               if (r < 15) {\n                  j->eob_run = (1 << r);\n                  if (r)\n                     j->eob_run += stbi__jpeg_get_bits(j, r);\n                  --j->eob_run;\n                  break;\n               }\n               k += 16;\n            } else {\n               k += r;\n               zig = stbi__jpeg_dezigzag[k++];\n               data[zig] = (short) (stbi__extend_receive(j,s) << shift);\n            }\n         }\n      } while (k <= j->spec_end);\n   } else {\n      // refinement scan for these AC coefficients\n\n      short bit = (short) (1 << j->succ_low);\n\n      if (j->eob_run) {\n         --j->eob_run;\n         for (k = j->spec_start; k <= j->spec_end; ++k) {\n            short *p = &data[stbi__jpeg_dezigzag[k]];\n            if (*p != 0)\n               if (stbi__jpeg_get_bit(j))\n                  if ((*p & bit)==0) {\n                     if (*p > 0)\n                        *p += bit;\n                     else\n                        *p -= bit;\n                  }\n         }\n      } else {\n         k = j->spec_start;\n         do {\n            int r,s;\n            int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh\n            if (rs < 0) return stbi__err(\"bad huffman code\",\"Corrupt JPEG\");\n            s = rs & 15;\n            r = rs >> 4;\n            if (s == 0) {\n               if (r < 15) {\n                  j->eob_run = (1 << r) - 1;\n                  if (r)\n                     j->eob_run += stbi__jpeg_get_bits(j, r);\n                  r = 64; // force end of block\n               } else\n                  r = 16; // r=15 is the code for 16 0s\n            } else {\n               if (s != 1) return stbi__err(\"bad huffman code\", \"Corrupt JPEG\");\n               // sign bit\n               if (stbi__jpeg_get_bit(j))\n                  s = bit;\n               else\n                  s = -bit;\n            }\n\n            // advance by r\n            while (k <= j->spec_end) {\n               short *p = &data[stbi__jpeg_dezigzag[k]];\n               if (*p != 0) {\n                  if (stbi__jpeg_get_bit(j))\n                     if ((*p & bit)==0) {\n                        if (*p > 0)\n                           *p += bit;\n                        else\n                           *p -= bit;\n                     }\n                  ++k;\n               } else {\n                  if (r == 0) {\n                     if (s)\n                        data[stbi__jpeg_dezigzag[k++]] = (short) s;\n                     break;\n                  }\n                  --r;\n                  ++k;\n               }\n            }\n         } while (k <= j->spec_end);\n      }\n   }\n   return 1;\n}\n\n// take a -128..127 value and stbi__clamp it and convert to 0..255\nstbi_inline static stbi_uc stbi__clamp(int x)\n{\n   // trick to use a single test to catch both cases\n   if ((unsigned int) x > 255) {\n      if (x < 0) return 0;\n      if (x > 255) return 255;\n   }\n   return (stbi_uc) x;\n}\n\n#define stbi__f2f(x)  ((int) (((x) * 4096 + 0.5)))\n#define stbi__fsh(x)  ((x) << 12)\n\n// derived from jidctint -- DCT_ISLOW\n#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \\\n   int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \\\n   p2 = s2;                                    \\\n   p3 = s6;                                    \\\n   p1 = (p2+p3) * stbi__f2f(0.5411961f);       \\\n   t2 = p1 + p3*stbi__f2f(-1.847759065f);      \\\n   t3 = p1 + p2*stbi__f2f( 0.765366865f);      \\\n   p2 = s0;                                    \\\n   p3 = s4;                                    \\\n   t0 = stbi__fsh(p2+p3);                      \\\n   t1 = stbi__fsh(p2-p3);                      \\\n   x0 = t0+t3;                                 \\\n   x3 = t0-t3;                                 \\\n   x1 = t1+t2;                                 \\\n   x2 = t1-t2;                                 \\\n   t0 = s7;                                    \\\n   t1 = s5;                                    \\\n   t2 = s3;                                    \\\n   t3 = s1;                                    \\\n   p3 = t0+t2;                                 \\\n   p4 = t1+t3;                                 \\\n   p1 = t0+t3;                                 \\\n   p2 = t1+t2;                                 \\\n   p5 = (p3+p4)*stbi__f2f( 1.175875602f);      \\\n   t0 = t0*stbi__f2f( 0.298631336f);           \\\n   t1 = t1*stbi__f2f( 2.053119869f);           \\\n   t2 = t2*stbi__f2f( 3.072711026f);           \\\n   t3 = t3*stbi__f2f( 1.501321110f);           \\\n   p1 = p5 + p1*stbi__f2f(-0.899976223f);      \\\n   p2 = p5 + p2*stbi__f2f(-2.562915447f);      \\\n   p3 = p3*stbi__f2f(-1.961570560f);           \\\n   p4 = p4*stbi__f2f(-0.390180644f);           \\\n   t3 += p1+p4;                                \\\n   t2 += p2+p3;                                \\\n   t1 += p2+p4;                                \\\n   t0 += p1+p3;\n\nstatic void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])\n{\n   int i,val[64],*v=val;\n   stbi_uc *o;\n   short *d = data;\n\n   // columns\n   for (i=0; i < 8; ++i,++d, ++v) {\n      // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing\n      if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0\n           && d[40]==0 && d[48]==0 && d[56]==0) {\n         //    no shortcut                 0     seconds\n         //    (1|2|3|4|5|6|7)==0          0     seconds\n         //    all separate               -0.047 seconds\n         //    1 && 2|3 && 4|5 && 6|7:    -0.047 seconds\n         int dcterm = d[0] << 2;\n         v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm;\n      } else {\n         STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56])\n         // constants scaled things up by 1<<12; let's bring them back\n         // down, but keep 2 extra bits of precision\n         x0 += 512; x1 += 512; x2 += 512; x3 += 512;\n         v[ 0] = (x0+t3) >> 10;\n         v[56] = (x0-t3) >> 10;\n         v[ 8] = (x1+t2) >> 10;\n         v[48] = (x1-t2) >> 10;\n         v[16] = (x2+t1) >> 10;\n         v[40] = (x2-t1) >> 10;\n         v[24] = (x3+t0) >> 10;\n         v[32] = (x3-t0) >> 10;\n      }\n   }\n\n   for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) {\n      // no fast case since the first 1D IDCT spread components out\n      STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7])\n      // constants scaled things up by 1<<12, plus we had 1<<2 from first\n      // loop, plus horizontal and vertical each scale by sqrt(8) so together\n      // we've got an extra 1<<3, so 1<<17 total we need to remove.\n      // so we want to round that, which means adding 0.5 * 1<<17,\n      // aka 65536. Also, we'll end up with -128 to 127 that we want\n      // to encode as 0..255 by adding 128, so we'll add that before the shift\n      x0 += 65536 + (128<<17);\n      x1 += 65536 + (128<<17);\n      x2 += 65536 + (128<<17);\n      x3 += 65536 + (128<<17);\n      // tried computing the shifts into temps, or'ing the temps to see\n      // if any were out of range, but that was slower\n      o[0] = stbi__clamp((x0+t3) >> 17);\n      o[7] = stbi__clamp((x0-t3) >> 17);\n      o[1] = stbi__clamp((x1+t2) >> 17);\n      o[6] = stbi__clamp((x1-t2) >> 17);\n      o[2] = stbi__clamp((x2+t1) >> 17);\n      o[5] = stbi__clamp((x2-t1) >> 17);\n      o[3] = stbi__clamp((x3+t0) >> 17);\n      o[4] = stbi__clamp((x3-t0) >> 17);\n   }\n}\n\n#ifdef STBI_SSE2\n// sse2 integer IDCT. not the fastest possible implementation but it\n// produces bit-identical results to the generic C version so it's\n// fully \"transparent\".\nstatic void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])\n{\n   // This is constructed to match our regular (generic) integer IDCT exactly.\n   __m128i row0, row1, row2, row3, row4, row5, row6, row7;\n   __m128i tmp;\n\n   // dot product constant: even elems=x, odd elems=y\n   #define dct_const(x,y)  _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))\n\n   // out(0) = c0[even]*x + c0[odd]*y   (c0, x, y 16-bit, out 32-bit)\n   // out(1) = c1[even]*x + c1[odd]*y\n   #define dct_rot(out0,out1, x,y,c0,c1) \\\n      __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \\\n      __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \\\n      __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \\\n      __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \\\n      __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \\\n      __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)\n\n   // out = in << 12  (in 16-bit, out 32-bit)\n   #define dct_widen(out, in) \\\n      __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \\\n      __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)\n\n   // wide add\n   #define dct_wadd(out, a, b) \\\n      __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \\\n      __m128i out##_h = _mm_add_epi32(a##_h, b##_h)\n\n   // wide sub\n   #define dct_wsub(out, a, b) \\\n      __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \\\n      __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)\n\n   // butterfly a/b, add bias, then shift by \"s\" and pack\n   #define dct_bfly32o(out0, out1, a,b,bias,s) \\\n      { \\\n         __m128i abiased_l = _mm_add_epi32(a##_l, bias); \\\n         __m128i abiased_h = _mm_add_epi32(a##_h, bias); \\\n         dct_wadd(sum, abiased, b); \\\n         dct_wsub(dif, abiased, b); \\\n         out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \\\n         out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \\\n      }\n\n   // 8-bit interleave step (for transposes)\n   #define dct_interleave8(a, b) \\\n      tmp = a; \\\n      a = _mm_unpacklo_epi8(a, b); \\\n      b = _mm_unpackhi_epi8(tmp, b)\n\n   // 16-bit interleave step (for transposes)\n   #define dct_interleave16(a, b) \\\n      tmp = a; \\\n      a = _mm_unpacklo_epi16(a, b); \\\n      b = _mm_unpackhi_epi16(tmp, b)\n\n   #define dct_pass(bias,shift) \\\n      { \\\n         /* even part */ \\\n         dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \\\n         __m128i sum04 = _mm_add_epi16(row0, row4); \\\n         __m128i dif04 = _mm_sub_epi16(row0, row4); \\\n         dct_widen(t0e, sum04); \\\n         dct_widen(t1e, dif04); \\\n         dct_wadd(x0, t0e, t3e); \\\n         dct_wsub(x3, t0e, t3e); \\\n         dct_wadd(x1, t1e, t2e); \\\n         dct_wsub(x2, t1e, t2e); \\\n         /* odd part */ \\\n         dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \\\n         dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \\\n         __m128i sum17 = _mm_add_epi16(row1, row7); \\\n         __m128i sum35 = _mm_add_epi16(row3, row5); \\\n         dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \\\n         dct_wadd(x4, y0o, y4o); \\\n         dct_wadd(x5, y1o, y5o); \\\n         dct_wadd(x6, y2o, y5o); \\\n         dct_wadd(x7, y3o, y4o); \\\n         dct_bfly32o(row0,row7, x0,x7,bias,shift); \\\n         dct_bfly32o(row1,row6, x1,x6,bias,shift); \\\n         dct_bfly32o(row2,row5, x2,x5,bias,shift); \\\n         dct_bfly32o(row3,row4, x3,x4,bias,shift); \\\n      }\n\n   __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f));\n   __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f));\n   __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f));\n   __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f));\n   __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f));\n   __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f));\n   __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f));\n   __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f));\n\n   // rounding biases in column/row passes, see stbi__idct_block for explanation.\n   __m128i bias_0 = _mm_set1_epi32(512);\n   __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17));\n\n   // load\n   row0 = _mm_load_si128((const __m128i *) (data + 0*8));\n   row1 = _mm_load_si128((const __m128i *) (data + 1*8));\n   row2 = _mm_load_si128((const __m128i *) (data + 2*8));\n   row3 = _mm_load_si128((const __m128i *) (data + 3*8));\n   row4 = _mm_load_si128((const __m128i *) (data + 4*8));\n   row5 = _mm_load_si128((const __m128i *) (data + 5*8));\n   row6 = _mm_load_si128((const __m128i *) (data + 6*8));\n   row7 = _mm_load_si128((const __m128i *) (data + 7*8));\n\n   // column pass\n   dct_pass(bias_0, 10);\n\n   {\n      // 16bit 8x8 transpose pass 1\n      dct_interleave16(row0, row4);\n      dct_interleave16(row1, row5);\n      dct_interleave16(row2, row6);\n      dct_interleave16(row3, row7);\n\n      // transpose pass 2\n      dct_interleave16(row0, row2);\n      dct_interleave16(row1, row3);\n      dct_interleave16(row4, row6);\n      dct_interleave16(row5, row7);\n\n      // transpose pass 3\n      dct_interleave16(row0, row1);\n      dct_interleave16(row2, row3);\n      dct_interleave16(row4, row5);\n      dct_interleave16(row6, row7);\n   }\n\n   // row pass\n   dct_pass(bias_1, 17);\n\n   {\n      // pack\n      __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7\n      __m128i p1 = _mm_packus_epi16(row2, row3);\n      __m128i p2 = _mm_packus_epi16(row4, row5);\n      __m128i p3 = _mm_packus_epi16(row6, row7);\n\n      // 8bit 8x8 transpose pass 1\n      dct_interleave8(p0, p2); // a0e0a1e1...\n      dct_interleave8(p1, p3); // c0g0c1g1...\n\n      // transpose pass 2\n      dct_interleave8(p0, p1); // a0c0e0g0...\n      dct_interleave8(p2, p3); // b0d0f0h0...\n\n      // transpose pass 3\n      dct_interleave8(p0, p2); // a0b0c0d0...\n      dct_interleave8(p1, p3); // a4b4c4d4...\n\n      // store\n      _mm_storel_epi64((__m128i *) out, p0); out += out_stride;\n      _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride;\n      _mm_storel_epi64((__m128i *) out, p2); out += out_stride;\n      _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride;\n      _mm_storel_epi64((__m128i *) out, p1); out += out_stride;\n      _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride;\n      _mm_storel_epi64((__m128i *) out, p3); out += out_stride;\n      _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e));\n   }\n\n#undef dct_const\n#undef dct_rot\n#undef dct_widen\n#undef dct_wadd\n#undef dct_wsub\n#undef dct_bfly32o\n#undef dct_interleave8\n#undef dct_interleave16\n#undef dct_pass\n}\n\n#endif // STBI_SSE2\n\n#ifdef STBI_NEON\n\n// NEON integer IDCT. should produce bit-identical\n// results to the generic C version.\nstatic void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])\n{\n   int16x8_t row0, row1, row2, row3, row4, row5, row6, row7;\n\n   int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f));\n   int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f));\n   int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f));\n   int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f));\n   int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f));\n   int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f));\n   int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f));\n   int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f));\n   int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f));\n   int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f));\n   int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f));\n   int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f));\n\n#define dct_long_mul(out, inq, coeff) \\\n   int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \\\n   int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff)\n\n#define dct_long_mac(out, acc, inq, coeff) \\\n   int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \\\n   int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff)\n\n#define dct_widen(out, inq) \\\n   int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \\\n   int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12)\n\n// wide add\n#define dct_wadd(out, a, b) \\\n   int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \\\n   int32x4_t out##_h = vaddq_s32(a##_h, b##_h)\n\n// wide sub\n#define dct_wsub(out, a, b) \\\n   int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \\\n   int32x4_t out##_h = vsubq_s32(a##_h, b##_h)\n\n// butterfly a/b, then shift using \"shiftop\" by \"s\" and pack\n#define dct_bfly32o(out0,out1, a,b,shiftop,s) \\\n   { \\\n      dct_wadd(sum, a, b); \\\n      dct_wsub(dif, a, b); \\\n      out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \\\n      out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \\\n   }\n\n#define dct_pass(shiftop, shift) \\\n   { \\\n      /* even part */ \\\n      int16x8_t sum26 = vaddq_s16(row2, row6); \\\n      dct_long_mul(p1e, sum26, rot0_0); \\\n      dct_long_mac(t2e, p1e, row6, rot0_1); \\\n      dct_long_mac(t3e, p1e, row2, rot0_2); \\\n      int16x8_t sum04 = vaddq_s16(row0, row4); \\\n      int16x8_t dif04 = vsubq_s16(row0, row4); \\\n      dct_widen(t0e, sum04); \\\n      dct_widen(t1e, dif04); \\\n      dct_wadd(x0, t0e, t3e); \\\n      dct_wsub(x3, t0e, t3e); \\\n      dct_wadd(x1, t1e, t2e); \\\n      dct_wsub(x2, t1e, t2e); \\\n      /* odd part */ \\\n      int16x8_t sum15 = vaddq_s16(row1, row5); \\\n      int16x8_t sum17 = vaddq_s16(row1, row7); \\\n      int16x8_t sum35 = vaddq_s16(row3, row5); \\\n      int16x8_t sum37 = vaddq_s16(row3, row7); \\\n      int16x8_t sumodd = vaddq_s16(sum17, sum35); \\\n      dct_long_mul(p5o, sumodd, rot1_0); \\\n      dct_long_mac(p1o, p5o, sum17, rot1_1); \\\n      dct_long_mac(p2o, p5o, sum35, rot1_2); \\\n      dct_long_mul(p3o, sum37, rot2_0); \\\n      dct_long_mul(p4o, sum15, rot2_1); \\\n      dct_wadd(sump13o, p1o, p3o); \\\n      dct_wadd(sump24o, p2o, p4o); \\\n      dct_wadd(sump23o, p2o, p3o); \\\n      dct_wadd(sump14o, p1o, p4o); \\\n      dct_long_mac(x4, sump13o, row7, rot3_0); \\\n      dct_long_mac(x5, sump24o, row5, rot3_1); \\\n      dct_long_mac(x6, sump23o, row3, rot3_2); \\\n      dct_long_mac(x7, sump14o, row1, rot3_3); \\\n      dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \\\n      dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \\\n      dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \\\n      dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \\\n   }\n\n   // load\n   row0 = vld1q_s16(data + 0*8);\n   row1 = vld1q_s16(data + 1*8);\n   row2 = vld1q_s16(data + 2*8);\n   row3 = vld1q_s16(data + 3*8);\n   row4 = vld1q_s16(data + 4*8);\n   row5 = vld1q_s16(data + 5*8);\n   row6 = vld1q_s16(data + 6*8);\n   row7 = vld1q_s16(data + 7*8);\n\n   // add DC bias\n   row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0));\n\n   // column pass\n   dct_pass(vrshrn_n_s32, 10);\n\n   // 16bit 8x8 transpose\n   {\n// these three map to a single VTRN.16, VTRN.32, and VSWP, respectively.\n// whether compilers actually get this is another story, sadly.\n#define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; }\n#define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); }\n#define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); }\n\n      // pass 1\n      dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6\n      dct_trn16(row2, row3);\n      dct_trn16(row4, row5);\n      dct_trn16(row6, row7);\n\n      // pass 2\n      dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4\n      dct_trn32(row1, row3);\n      dct_trn32(row4, row6);\n      dct_trn32(row5, row7);\n\n      // pass 3\n      dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0\n      dct_trn64(row1, row5);\n      dct_trn64(row2, row6);\n      dct_trn64(row3, row7);\n\n#undef dct_trn16\n#undef dct_trn32\n#undef dct_trn64\n   }\n\n   // row pass\n   // vrshrn_n_s32 only supports shifts up to 16, we need\n   // 17. so do a non-rounding shift of 16 first then follow\n   // up with a rounding shift by 1.\n   dct_pass(vshrn_n_s32, 16);\n\n   {\n      // pack and round\n      uint8x8_t p0 = vqrshrun_n_s16(row0, 1);\n      uint8x8_t p1 = vqrshrun_n_s16(row1, 1);\n      uint8x8_t p2 = vqrshrun_n_s16(row2, 1);\n      uint8x8_t p3 = vqrshrun_n_s16(row3, 1);\n      uint8x8_t p4 = vqrshrun_n_s16(row4, 1);\n      uint8x8_t p5 = vqrshrun_n_s16(row5, 1);\n      uint8x8_t p6 = vqrshrun_n_s16(row6, 1);\n      uint8x8_t p7 = vqrshrun_n_s16(row7, 1);\n\n      // again, these can translate into one instruction, but often don't.\n#define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; }\n#define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); }\n#define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); }\n\n      // sadly can't use interleaved stores here since we only write\n      // 8 bytes to each scan line!\n\n      // 8x8 8-bit transpose pass 1\n      dct_trn8_8(p0, p1);\n      dct_trn8_8(p2, p3);\n      dct_trn8_8(p4, p5);\n      dct_trn8_8(p6, p7);\n\n      // pass 2\n      dct_trn8_16(p0, p2);\n      dct_trn8_16(p1, p3);\n      dct_trn8_16(p4, p6);\n      dct_trn8_16(p5, p7);\n\n      // pass 3\n      dct_trn8_32(p0, p4);\n      dct_trn8_32(p1, p5);\n      dct_trn8_32(p2, p6);\n      dct_trn8_32(p3, p7);\n\n      // store\n      vst1_u8(out, p0); out += out_stride;\n      vst1_u8(out, p1); out += out_stride;\n      vst1_u8(out, p2); out += out_stride;\n      vst1_u8(out, p3); out += out_stride;\n      vst1_u8(out, p4); out += out_stride;\n      vst1_u8(out, p5); out += out_stride;\n      vst1_u8(out, p6); out += out_stride;\n      vst1_u8(out, p7);\n\n#undef dct_trn8_8\n#undef dct_trn8_16\n#undef dct_trn8_32\n   }\n\n#undef dct_long_mul\n#undef dct_long_mac\n#undef dct_widen\n#undef dct_wadd\n#undef dct_wsub\n#undef dct_bfly32o\n#undef dct_pass\n}\n\n#endif // STBI_NEON\n\n#define STBI__MARKER_none  0xff\n// if there's a pending marker from the entropy stream, return that\n// otherwise, fetch from the stream and get a marker. if there's no\n// marker, return 0xff, which is never a valid marker value\nstatic stbi_uc stbi__get_marker(stbi__jpeg *j)\n{\n   stbi_uc x;\n   if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; }\n   x = stbi__get8(j->s);\n   if (x != 0xff) return STBI__MARKER_none;\n   while (x == 0xff)\n      x = stbi__get8(j->s);\n   return x;\n}\n\n// in each scan, we'll have scan_n components, and the order\n// of the components is specified by order[]\n#define STBI__RESTART(x)     ((x) >= 0xd0 && (x) <= 0xd7)\n\n// after a restart interval, stbi__jpeg_reset the entropy decoder and\n// the dc prediction\nstatic void stbi__jpeg_reset(stbi__jpeg *j)\n{\n   j->code_bits = 0;\n   j->code_buffer = 0;\n   j->nomore = 0;\n   j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0;\n   j->marker = STBI__MARKER_none;\n   j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;\n   j->eob_run = 0;\n   // no more than 1<<31 MCUs if no restart_interal? that's plenty safe,\n   // since we don't even allow 1<<30 pixels\n}\n\nstatic int stbi__parse_entropy_coded_data(stbi__jpeg *z)\n{\n   stbi__jpeg_reset(z);\n   if (!z->progressive) {\n      if (z->scan_n == 1) {\n         int i,j;\n         STBI_SIMD_ALIGN(short, data[64]);\n         int n = z->order[0];\n         // non-interleaved data, we just need to process one block at a time,\n         // in trivial scanline order\n         // number of blocks to do just depends on how many actual \"pixels\" this\n         // component has, independent of interleaved MCU blocking and such\n         int w = (z->img_comp[n].x+7) >> 3;\n         int h = (z->img_comp[n].y+7) >> 3;\n         for (j=0; j < h; ++j) {\n            for (i=0; i < w; ++i) {\n               int ha = z->img_comp[n].ha;\n               if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;\n               z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);\n               // every data block is an MCU, so countdown the restart interval\n               if (--z->todo <= 0) {\n                  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);\n                  // if it's NOT a restart, then just bail, so we get corrupt data\n                  // rather than no data\n                  if (!STBI__RESTART(z->marker)) return 1;\n                  stbi__jpeg_reset(z);\n               }\n            }\n         }\n         return 1;\n      } else { // interleaved\n         int i,j,k,x,y;\n         STBI_SIMD_ALIGN(short, data[64]);\n         for (j=0; j < z->img_mcu_y; ++j) {\n            for (i=0; i < z->img_mcu_x; ++i) {\n               // scan an interleaved mcu... process scan_n components in order\n               for (k=0; k < z->scan_n; ++k) {\n                  int n = z->order[k];\n                  // scan out an mcu's worth of this component; that's just determined\n                  // by the basic H and V specified for the component\n                  for (y=0; y < z->img_comp[n].v; ++y) {\n                     for (x=0; x < z->img_comp[n].h; ++x) {\n                        int x2 = (i*z->img_comp[n].h + x)*8;\n                        int y2 = (j*z->img_comp[n].v + y)*8;\n                        int ha = z->img_comp[n].ha;\n                        if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;\n                        z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data);\n                     }\n                  }\n               }\n               // after all interleaved components, that's an interleaved MCU,\n               // so now count down the restart interval\n               if (--z->todo <= 0) {\n                  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);\n                  if (!STBI__RESTART(z->marker)) return 1;\n                  stbi__jpeg_reset(z);\n               }\n            }\n         }\n         return 1;\n      }\n   } else {\n      if (z->scan_n == 1) {\n         int i,j;\n         int n = z->order[0];\n         // non-interleaved data, we just need to process one block at a time,\n         // in trivial scanline order\n         // number of blocks to do just depends on how many actual \"pixels\" this\n         // component has, independent of interleaved MCU blocking and such\n         int w = (z->img_comp[n].x+7) >> 3;\n         int h = (z->img_comp[n].y+7) >> 3;\n         for (j=0; j < h; ++j) {\n            for (i=0; i < w; ++i) {\n               short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);\n               if (z->spec_start == 0) {\n                  if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))\n                     return 0;\n               } else {\n                  int ha = z->img_comp[n].ha;\n                  if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha]))\n                     return 0;\n               }\n               // every data block is an MCU, so countdown the restart interval\n               if (--z->todo <= 0) {\n                  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);\n                  if (!STBI__RESTART(z->marker)) return 1;\n                  stbi__jpeg_reset(z);\n               }\n            }\n         }\n         return 1;\n      } else { // interleaved\n         int i,j,k,x,y;\n         for (j=0; j < z->img_mcu_y; ++j) {\n            for (i=0; i < z->img_mcu_x; ++i) {\n               // scan an interleaved mcu... process scan_n components in order\n               for (k=0; k < z->scan_n; ++k) {\n                  int n = z->order[k];\n                  // scan out an mcu's worth of this component; that's just determined\n                  // by the basic H and V specified for the component\n                  for (y=0; y < z->img_comp[n].v; ++y) {\n                     for (x=0; x < z->img_comp[n].h; ++x) {\n                        int x2 = (i*z->img_comp[n].h + x);\n                        int y2 = (j*z->img_comp[n].v + y);\n                        short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w);\n                        if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))\n                           return 0;\n                     }\n                  }\n               }\n               // after all interleaved components, that's an interleaved MCU,\n               // so now count down the restart interval\n               if (--z->todo <= 0) {\n                  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);\n                  if (!STBI__RESTART(z->marker)) return 1;\n                  stbi__jpeg_reset(z);\n               }\n            }\n         }\n         return 1;\n      }\n   }\n}\n\nstatic void stbi__jpeg_dequantize(short *data, stbi_uc *dequant)\n{\n   int i;\n   for (i=0; i < 64; ++i)\n      data[i] *= dequant[i];\n}\n\nstatic void stbi__jpeg_finish(stbi__jpeg *z)\n{\n   if (z->progressive) {\n      // dequantize and idct the data\n      int i,j,n;\n      for (n=0; n < z->s->img_n; ++n) {\n         int w = (z->img_comp[n].x+7) >> 3;\n         int h = (z->img_comp[n].y+7) >> 3;\n         for (j=0; j < h; ++j) {\n            for (i=0; i < w; ++i) {\n               short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);\n               stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);\n               z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);\n            }\n         }\n      }\n   }\n}\n\nstatic int stbi__process_marker(stbi__jpeg *z, int m)\n{\n   int L;\n   switch (m) {\n      case STBI__MARKER_none: // no marker found\n         return stbi__err(\"expected marker\",\"Corrupt JPEG\");\n\n      case 0xDD: // DRI - specify restart interval\n         if (stbi__get16be(z->s) != 4) return stbi__err(\"bad DRI len\",\"Corrupt JPEG\");\n         z->restart_interval = stbi__get16be(z->s);\n         return 1;\n\n      case 0xDB: // DQT - define quantization table\n         L = stbi__get16be(z->s)-2;\n         while (L > 0) {\n            int q = stbi__get8(z->s);\n            int p = q >> 4;\n            int t = q & 15,i;\n            if (p != 0) return stbi__err(\"bad DQT type\",\"Corrupt JPEG\");\n            if (t > 3) return stbi__err(\"bad DQT table\",\"Corrupt JPEG\");\n            for (i=0; i < 64; ++i)\n               z->dequant[t][stbi__jpeg_dezigzag[i]] = stbi__get8(z->s);\n            L -= 65;\n         }\n         return L==0;\n\n      case 0xC4: // DHT - define huffman table\n         L = stbi__get16be(z->s)-2;\n         while (L > 0) {\n            stbi_uc *v;\n            int sizes[16],i,n=0;\n            int q = stbi__get8(z->s);\n            int tc = q >> 4;\n            int th = q & 15;\n            if (tc > 1 || th > 3) return stbi__err(\"bad DHT header\",\"Corrupt JPEG\");\n            for (i=0; i < 16; ++i) {\n               sizes[i] = stbi__get8(z->s);\n               n += sizes[i];\n            }\n            L -= 17;\n            if (tc == 0) {\n               if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0;\n               v = z->huff_dc[th].values;\n            } else {\n               if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0;\n               v = z->huff_ac[th].values;\n            }\n            for (i=0; i < n; ++i)\n               v[i] = stbi__get8(z->s);\n            if (tc != 0)\n               stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);\n            L -= n;\n         }\n         return L==0;\n   }\n   // check for comment block or APP blocks\n   if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {\n      stbi__skip(z->s, stbi__get16be(z->s)-2);\n      return 1;\n   }\n   return 0;\n}\n\n// after we see SOS\nstatic int stbi__process_scan_header(stbi__jpeg *z)\n{\n   int i;\n   int Ls = stbi__get16be(z->s);\n   z->scan_n = stbi__get8(z->s);\n   if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err(\"bad SOS component count\",\"Corrupt JPEG\");\n   if (Ls != 6+2*z->scan_n) return stbi__err(\"bad SOS len\",\"Corrupt JPEG\");\n   for (i=0; i < z->scan_n; ++i) {\n      int id = stbi__get8(z->s), which;\n      int q = stbi__get8(z->s);\n      for (which = 0; which < z->s->img_n; ++which)\n         if (z->img_comp[which].id == id)\n            break;\n      if (which == z->s->img_n) return 0; // no match\n      z->img_comp[which].hd = q >> 4;   if (z->img_comp[which].hd > 3) return stbi__err(\"bad DC huff\",\"Corrupt JPEG\");\n      z->img_comp[which].ha = q & 15;   if (z->img_comp[which].ha > 3) return stbi__err(\"bad AC huff\",\"Corrupt JPEG\");\n      z->order[i] = which;\n   }\n\n   {\n      int aa;\n      z->spec_start = stbi__get8(z->s);\n      z->spec_end   = stbi__get8(z->s); // should be 63, but might be 0\n      aa = stbi__get8(z->s);\n      z->succ_high = (aa >> 4);\n      z->succ_low  = (aa & 15);\n      if (z->progressive) {\n         if (z->spec_start > 63 || z->spec_end > 63  || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13)\n            return stbi__err(\"bad SOS\", \"Corrupt JPEG\");\n      } else {\n         if (z->spec_start != 0) return stbi__err(\"bad SOS\",\"Corrupt JPEG\");\n         if (z->succ_high != 0 || z->succ_low != 0) return stbi__err(\"bad SOS\",\"Corrupt JPEG\");\n         z->spec_end = 63;\n      }\n   }\n\n   return 1;\n}\n\nstatic int stbi__process_frame_header(stbi__jpeg *z, int scan)\n{\n   stbi__context *s = z->s;\n   int Lf,p,i,q, h_max=1,v_max=1,c;\n   Lf = stbi__get16be(s);         if (Lf < 11) return stbi__err(\"bad SOF len\",\"Corrupt JPEG\"); // JPEG\n   p  = stbi__get8(s);            if (p != 8) return stbi__err(\"only 8-bit\",\"JPEG format not supported: 8-bit only\"); // JPEG baseline\n   s->img_y = stbi__get16be(s);   if (s->img_y == 0) return stbi__err(\"no header height\", \"JPEG format not supported: delayed height\"); // Legal, but we don't handle it--but neither does IJG\n   s->img_x = stbi__get16be(s);   if (s->img_x == 0) return stbi__err(\"0 width\",\"Corrupt JPEG\"); // JPEG requires\n   c = stbi__get8(s);\n   if (c != 3 && c != 1) return stbi__err(\"bad component count\",\"Corrupt JPEG\");    // JFIF requires\n   s->img_n = c;\n   for (i=0; i < c; ++i) {\n      z->img_comp[i].data = NULL;\n      z->img_comp[i].linebuf = NULL;\n   }\n\n   if (Lf != 8+3*s->img_n) return stbi__err(\"bad SOF len\",\"Corrupt JPEG\");\n\n   for (i=0; i < s->img_n; ++i) {\n      z->img_comp[i].id = stbi__get8(s);\n      if (z->img_comp[i].id != i+1)   // JFIF requires\n         if (z->img_comp[i].id != i)  // some version of jpegtran outputs non-JFIF-compliant files!\n            return stbi__err(\"bad component ID\",\"Corrupt JPEG\");\n      q = stbi__get8(s);\n      z->img_comp[i].h = (q >> 4);  if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err(\"bad H\",\"Corrupt JPEG\");\n      z->img_comp[i].v = q & 15;    if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err(\"bad V\",\"Corrupt JPEG\");\n      z->img_comp[i].tq = stbi__get8(s);  if (z->img_comp[i].tq > 3) return stbi__err(\"bad TQ\",\"Corrupt JPEG\");\n   }\n\n   if (scan != STBI__SCAN_load) return 1;\n\n   if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err(\"too large\", \"Image too large to decode\");\n\n   for (i=0; i < s->img_n; ++i) {\n      if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;\n      if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;\n   }\n\n   // compute interleaved mcu info\n   z->img_h_max = h_max;\n   z->img_v_max = v_max;\n   z->img_mcu_w = h_max * 8;\n   z->img_mcu_h = v_max * 8;\n   z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;\n   z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;\n\n   for (i=0; i < s->img_n; ++i) {\n      // number of effective pixels (e.g. for non-interleaved MCU)\n      z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;\n      z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;\n      // to simplify generation, we'll allocate enough memory to decode\n      // the bogus oversized data from using interleaved MCUs and their\n      // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't\n      // discard the extra data until colorspace conversion\n      z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;\n      z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;\n      z->img_comp[i].raw_data = stbi__malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15);\n\n      if (z->img_comp[i].raw_data == NULL) {\n         for(--i; i >= 0; --i) {\n            STBI_FREE(z->img_comp[i].raw_data);\n            z->img_comp[i].data = NULL;\n         }\n         return stbi__err(\"outofmem\", \"Out of memory\");\n      }\n      // align blocks for idct using mmx/sse\n      z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);\n      z->img_comp[i].linebuf = NULL;\n      if (z->progressive) {\n         z->img_comp[i].coeff_w = (z->img_comp[i].w2 + 7) >> 3;\n         z->img_comp[i].coeff_h = (z->img_comp[i].h2 + 7) >> 3;\n         z->img_comp[i].raw_coeff = STBI_MALLOC(z->img_comp[i].coeff_w * z->img_comp[i].coeff_h * 64 * sizeof(short) + 15);\n         z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15);\n      } else {\n         z->img_comp[i].coeff = 0;\n         z->img_comp[i].raw_coeff = 0;\n      }\n   }\n\n   return 1;\n}\n\n// use comparisons since in some cases we handle more than one case (e.g. SOF)\n#define stbi__DNL(x)         ((x) == 0xdc)\n#define stbi__SOI(x)         ((x) == 0xd8)\n#define stbi__EOI(x)         ((x) == 0xd9)\n#define stbi__SOF(x)         ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2)\n#define stbi__SOS(x)         ((x) == 0xda)\n\n#define stbi__SOF_progressive(x)   ((x) == 0xc2)\n\nstatic int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)\n{\n   int m;\n   z->marker = STBI__MARKER_none; // initialize cached marker to empty\n   m = stbi__get_marker(z);\n   if (!stbi__SOI(m)) return stbi__err(\"no SOI\",\"Corrupt JPEG\");\n   if (scan == STBI__SCAN_type) return 1;\n   m = stbi__get_marker(z);\n   while (!stbi__SOF(m)) {\n      if (!stbi__process_marker(z,m)) return 0;\n      m = stbi__get_marker(z);\n      while (m == STBI__MARKER_none) {\n         // some files have extra padding after their blocks, so ok, we'll scan\n         if (stbi__at_eof(z->s)) return stbi__err(\"no SOF\", \"Corrupt JPEG\");\n         m = stbi__get_marker(z);\n      }\n   }\n   z->progressive = stbi__SOF_progressive(m);\n   if (!stbi__process_frame_header(z, scan)) return 0;\n   return 1;\n}\n\n// decode image to YCbCr format\nstatic int stbi__decode_jpeg_image(stbi__jpeg *j)\n{\n   int m;\n   j->restart_interval = 0;\n   if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0;\n   m = stbi__get_marker(j);\n   while (!stbi__EOI(m)) {\n      if (stbi__SOS(m)) {\n         if (!stbi__process_scan_header(j)) return 0;\n         if (!stbi__parse_entropy_coded_data(j)) return 0;\n         if (j->marker == STBI__MARKER_none ) {\n            // handle 0s at the end of image data from IP Kamera 9060\n            while (!stbi__at_eof(j->s)) {\n               int x = stbi__get8(j->s);\n               if (x == 255) {\n                  j->marker = stbi__get8(j->s);\n                  break;\n               } else if (x != 0) {\n                  return stbi__err(\"junk before marker\", \"Corrupt JPEG\");\n               }\n            }\n            // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0\n         }\n      } else {\n         if (!stbi__process_marker(j, m)) return 0;\n      }\n      m = stbi__get_marker(j);\n   }\n   if (j->progressive)\n      stbi__jpeg_finish(j);\n   return 1;\n}\n\n// static jfif-centered resampling (across block boundaries)\n\ntypedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1,\n                                    int w, int hs);\n\n#define stbi__div4(x) ((stbi_uc) ((x) >> 2))\n\nstatic stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n   STBI_NOTUSED(out);\n   STBI_NOTUSED(in_far);\n   STBI_NOTUSED(w);\n   STBI_NOTUSED(hs);\n   return in_near;\n}\n\nstatic stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n   // need to generate two samples vertically for every one in input\n   int i;\n   STBI_NOTUSED(hs);\n   for (i=0; i < w; ++i)\n      out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2);\n   return out;\n}\n\nstatic stbi_uc*  stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n   // need to generate two samples horizontally for every one in input\n   int i;\n   stbi_uc *input = in_near;\n\n   if (w == 1) {\n      // if only one sample, can't do any interpolation\n      out[0] = out[1] = input[0];\n      return out;\n   }\n\n   out[0] = input[0];\n   out[1] = stbi__div4(input[0]*3 + input[1] + 2);\n   for (i=1; i < w-1; ++i) {\n      int n = 3*input[i]+2;\n      out[i*2+0] = stbi__div4(n+input[i-1]);\n      out[i*2+1] = stbi__div4(n+input[i+1]);\n   }\n   out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2);\n   out[i*2+1] = input[w-1];\n\n   STBI_NOTUSED(in_far);\n   STBI_NOTUSED(hs);\n\n   return out;\n}\n\n#define stbi__div16(x) ((stbi_uc) ((x) >> 4))\n\nstatic stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n   // need to generate 2x2 samples for every one in input\n   int i,t0,t1;\n   if (w == 1) {\n      out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);\n      return out;\n   }\n\n   t1 = 3*in_near[0] + in_far[0];\n   out[0] = stbi__div4(t1+2);\n   for (i=1; i < w; ++i) {\n      t0 = t1;\n      t1 = 3*in_near[i]+in_far[i];\n      out[i*2-1] = stbi__div16(3*t0 + t1 + 8);\n      out[i*2  ] = stbi__div16(3*t1 + t0 + 8);\n   }\n   out[w*2-1] = stbi__div4(t1+2);\n\n   STBI_NOTUSED(hs);\n\n   return out;\n}\n\n#if defined(STBI_SSE2) || defined(STBI_NEON)\nstatic stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n   // need to generate 2x2 samples for every one in input\n   int i=0,t0,t1;\n\n   if (w == 1) {\n      out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);\n      return out;\n   }\n\n   t1 = 3*in_near[0] + in_far[0];\n   // process groups of 8 pixels for as long as we can.\n   // note we can't handle the last pixel in a row in this loop\n   // because we need to handle the filter boundary conditions.\n   for (; i < ((w-1) & ~7); i += 8) {\n#if defined(STBI_SSE2)\n      // load and perform the vertical filtering pass\n      // this uses 3*x + y = 4*x + (y - x)\n      __m128i zero  = _mm_setzero_si128();\n      __m128i farb  = _mm_loadl_epi64((__m128i *) (in_far + i));\n      __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i));\n      __m128i farw  = _mm_unpacklo_epi8(farb, zero);\n      __m128i nearw = _mm_unpacklo_epi8(nearb, zero);\n      __m128i diff  = _mm_sub_epi16(farw, nearw);\n      __m128i nears = _mm_slli_epi16(nearw, 2);\n      __m128i curr  = _mm_add_epi16(nears, diff); // current row\n\n      // horizontal filter works the same based on shifted vers of current\n      // row. \"prev\" is current row shifted right by 1 pixel; we need to\n      // insert the previous pixel value (from t1).\n      // \"next\" is current row shifted left by 1 pixel, with first pixel\n      // of next block of 8 pixels added in.\n      __m128i prv0 = _mm_slli_si128(curr, 2);\n      __m128i nxt0 = _mm_srli_si128(curr, 2);\n      __m128i prev = _mm_insert_epi16(prv0, t1, 0);\n      __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7);\n\n      // horizontal filter, polyphase implementation since it's convenient:\n      // even pixels = 3*cur + prev = cur*4 + (prev - cur)\n      // odd  pixels = 3*cur + next = cur*4 + (next - cur)\n      // note the shared term.\n      __m128i bias  = _mm_set1_epi16(8);\n      __m128i curs = _mm_slli_epi16(curr, 2);\n      __m128i prvd = _mm_sub_epi16(prev, curr);\n      __m128i nxtd = _mm_sub_epi16(next, curr);\n      __m128i curb = _mm_add_epi16(curs, bias);\n      __m128i even = _mm_add_epi16(prvd, curb);\n      __m128i odd  = _mm_add_epi16(nxtd, curb);\n\n      // interleave even and odd pixels, then undo scaling.\n      __m128i int0 = _mm_unpacklo_epi16(even, odd);\n      __m128i int1 = _mm_unpackhi_epi16(even, odd);\n      __m128i de0  = _mm_srli_epi16(int0, 4);\n      __m128i de1  = _mm_srli_epi16(int1, 4);\n\n      // pack and write output\n      __m128i outv = _mm_packus_epi16(de0, de1);\n      _mm_storeu_si128((__m128i *) (out + i*2), outv);\n#elif defined(STBI_NEON)\n      // load and perform the vertical filtering pass\n      // this uses 3*x + y = 4*x + (y - x)\n      uint8x8_t farb  = vld1_u8(in_far + i);\n      uint8x8_t nearb = vld1_u8(in_near + i);\n      int16x8_t diff  = vreinterpretq_s16_u16(vsubl_u8(farb, nearb));\n      int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2));\n      int16x8_t curr  = vaddq_s16(nears, diff); // current row\n\n      // horizontal filter works the same based on shifted vers of current\n      // row. \"prev\" is current row shifted right by 1 pixel; we need to\n      // insert the previous pixel value (from t1).\n      // \"next\" is current row shifted left by 1 pixel, with first pixel\n      // of next block of 8 pixels added in.\n      int16x8_t prv0 = vextq_s16(curr, curr, 7);\n      int16x8_t nxt0 = vextq_s16(curr, curr, 1);\n      int16x8_t prev = vsetq_lane_s16(t1, prv0, 0);\n      int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7);\n\n      // horizontal filter, polyphase implementation since it's convenient:\n      // even pixels = 3*cur + prev = cur*4 + (prev - cur)\n      // odd  pixels = 3*cur + next = cur*4 + (next - cur)\n      // note the shared term.\n      int16x8_t curs = vshlq_n_s16(curr, 2);\n      int16x8_t prvd = vsubq_s16(prev, curr);\n      int16x8_t nxtd = vsubq_s16(next, curr);\n      int16x8_t even = vaddq_s16(curs, prvd);\n      int16x8_t odd  = vaddq_s16(curs, nxtd);\n\n      // undo scaling and round, then store with even/odd phases interleaved\n      uint8x8x2_t o;\n      o.val[0] = vqrshrun_n_s16(even, 4);\n      o.val[1] = vqrshrun_n_s16(odd,  4);\n      vst2_u8(out + i*2, o);\n#endif\n\n      // \"previous\" value for next iter\n      t1 = 3*in_near[i+7] + in_far[i+7];\n   }\n\n   t0 = t1;\n   t1 = 3*in_near[i] + in_far[i];\n   out[i*2] = stbi__div16(3*t1 + t0 + 8);\n\n   for (++i; i < w; ++i) {\n      t0 = t1;\n      t1 = 3*in_near[i]+in_far[i];\n      out[i*2-1] = stbi__div16(3*t0 + t1 + 8);\n      out[i*2  ] = stbi__div16(3*t1 + t0 + 8);\n   }\n   out[w*2-1] = stbi__div4(t1+2);\n\n   STBI_NOTUSED(hs);\n\n   return out;\n}\n#endif\n\nstatic stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n   // resample with nearest-neighbor\n   int i,j;\n   STBI_NOTUSED(in_far);\n   for (i=0; i < w; ++i)\n      for (j=0; j < hs; ++j)\n         out[i*hs+j] = in_near[i];\n   return out;\n}\n\n#ifdef STBI_JPEG_OLD\n// this is the same YCbCr-to-RGB calculation that stb_image has used\n// historically before the algorithm changes in 1.49\n#define float2fixed(x)  ((int) ((x) * 65536 + 0.5))\nstatic void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)\n{\n   int i;\n   for (i=0; i < count; ++i) {\n      int y_fixed = (y[i] << 16) + 32768; // rounding\n      int r,g,b;\n      int cr = pcr[i] - 128;\n      int cb = pcb[i] - 128;\n      r = y_fixed + cr*float2fixed(1.40200f);\n      g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f);\n      b = y_fixed                            + cb*float2fixed(1.77200f);\n      r >>= 16;\n      g >>= 16;\n      b >>= 16;\n      if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }\n      if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }\n      if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }\n      out[0] = (stbi_uc)r;\n      out[1] = (stbi_uc)g;\n      out[2] = (stbi_uc)b;\n      out[3] = 255;\n      out += step;\n   }\n}\n#else\n// this is a reduced-precision calculation of YCbCr-to-RGB introduced\n// to make sure the code produces the same results in both SIMD and scalar\n#define float2fixed(x)  (((int) ((x) * 4096.0f + 0.5f)) << 8)\nstatic void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)\n{\n   int i;\n   for (i=0; i < count; ++i) {\n      int y_fixed = (y[i] << 20) + (1<<19); // rounding\n      int r,g,b;\n      int cr = pcr[i] - 128;\n      int cb = pcb[i] - 128;\n      r = y_fixed +  cr* float2fixed(1.40200f);\n      g = y_fixed + (cr*-float2fixed(0.71414f)) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);\n      b = y_fixed                               +   cb* float2fixed(1.77200f);\n      r >>= 20;\n      g >>= 20;\n      b >>= 20;\n      if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }\n      if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }\n      if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }\n      out[0] = (stbi_uc)r;\n      out[1] = (stbi_uc)g;\n      out[2] = (stbi_uc)b;\n      out[3] = 255;\n      out += step;\n   }\n}\n#endif\n\n#if defined(STBI_SSE2) || defined(STBI_NEON)\nstatic void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step)\n{\n   int i = 0;\n\n#ifdef STBI_SSE2\n   // step == 3 is pretty ugly on the final interleave, and i'm not convinced\n   // it's useful in practice (you wouldn't use it for textures, for example).\n   // so just accelerate step == 4 case.\n   if (step == 4) {\n      // this is a fairly straightforward implementation and not super-optimized.\n      __m128i signflip  = _mm_set1_epi8(-0x80);\n      __m128i cr_const0 = _mm_set1_epi16(   (short) ( 1.40200f*4096.0f+0.5f));\n      __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f));\n      __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f));\n      __m128i cb_const1 = _mm_set1_epi16(   (short) ( 1.77200f*4096.0f+0.5f));\n      __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128);\n      __m128i xw = _mm_set1_epi16(255); // alpha channel\n\n      for (; i+7 < count; i += 8) {\n         // load\n         __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i));\n         __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i));\n         __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i));\n         __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128\n         __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128\n\n         // unpack to short (and left-shift cr, cb by 8)\n         __m128i yw  = _mm_unpacklo_epi8(y_bias, y_bytes);\n         __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased);\n         __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased);\n\n         // color transform\n         __m128i yws = _mm_srli_epi16(yw, 4);\n         __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw);\n         __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw);\n         __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1);\n         __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1);\n         __m128i rws = _mm_add_epi16(cr0, yws);\n         __m128i gwt = _mm_add_epi16(cb0, yws);\n         __m128i bws = _mm_add_epi16(yws, cb1);\n         __m128i gws = _mm_add_epi16(gwt, cr1);\n\n         // descale\n         __m128i rw = _mm_srai_epi16(rws, 4);\n         __m128i bw = _mm_srai_epi16(bws, 4);\n         __m128i gw = _mm_srai_epi16(gws, 4);\n\n         // back to byte, set up for transpose\n         __m128i brb = _mm_packus_epi16(rw, bw);\n         __m128i gxb = _mm_packus_epi16(gw, xw);\n\n         // transpose to interleave channels\n         __m128i t0 = _mm_unpacklo_epi8(brb, gxb);\n         __m128i t1 = _mm_unpackhi_epi8(brb, gxb);\n         __m128i o0 = _mm_unpacklo_epi16(t0, t1);\n         __m128i o1 = _mm_unpackhi_epi16(t0, t1);\n\n         // store\n         _mm_storeu_si128((__m128i *) (out + 0), o0);\n         _mm_storeu_si128((__m128i *) (out + 16), o1);\n         out += 32;\n      }\n   }\n#endif\n\n#ifdef STBI_NEON\n   // in this version, step=3 support would be easy to add. but is there demand?\n   if (step == 4) {\n      // this is a fairly straightforward implementation and not super-optimized.\n      uint8x8_t signflip = vdup_n_u8(0x80);\n      int16x8_t cr_const0 = vdupq_n_s16(   (short) ( 1.40200f*4096.0f+0.5f));\n      int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f));\n      int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f));\n      int16x8_t cb_const1 = vdupq_n_s16(   (short) ( 1.77200f*4096.0f+0.5f));\n\n      for (; i+7 < count; i += 8) {\n         // load\n         uint8x8_t y_bytes  = vld1_u8(y + i);\n         uint8x8_t cr_bytes = vld1_u8(pcr + i);\n         uint8x8_t cb_bytes = vld1_u8(pcb + i);\n         int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip));\n         int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip));\n\n         // expand to s16\n         int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4));\n         int16x8_t crw = vshll_n_s8(cr_biased, 7);\n         int16x8_t cbw = vshll_n_s8(cb_biased, 7);\n\n         // color transform\n         int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0);\n         int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0);\n         int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1);\n         int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1);\n         int16x8_t rws = vaddq_s16(yws, cr0);\n         int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1);\n         int16x8_t bws = vaddq_s16(yws, cb1);\n\n         // undo scaling, round, convert to byte\n         uint8x8x4_t o;\n         o.val[0] = vqrshrun_n_s16(rws, 4);\n         o.val[1] = vqrshrun_n_s16(gws, 4);\n         o.val[2] = vqrshrun_n_s16(bws, 4);\n         o.val[3] = vdup_n_u8(255);\n\n         // store, interleaving r/g/b/a\n         vst4_u8(out, o);\n         out += 8*4;\n      }\n   }\n#endif\n\n   for (; i < count; ++i) {\n      int y_fixed = (y[i] << 20) + (1<<19); // rounding\n      int r,g,b;\n      int cr = pcr[i] - 128;\n      int cb = pcb[i] - 128;\n      r = y_fixed + cr* float2fixed(1.40200f);\n      g = y_fixed + cr*-float2fixed(0.71414f) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);\n      b = y_fixed                             +   cb* float2fixed(1.77200f);\n      r >>= 20;\n      g >>= 20;\n      b >>= 20;\n      if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }\n      if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }\n      if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }\n      out[0] = (stbi_uc)r;\n      out[1] = (stbi_uc)g;\n      out[2] = (stbi_uc)b;\n      out[3] = 255;\n      out += step;\n   }\n}\n#endif\n\n// set up the kernels\nstatic void stbi__setup_jpeg(stbi__jpeg *j)\n{\n   j->idct_block_kernel = stbi__idct_block;\n   j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row;\n   j->resample_row_hv_2_kernel = stbi__resample_row_hv_2;\n\n#ifdef STBI_SSE2\n   if (stbi__sse2_available()) {\n      j->idct_block_kernel = stbi__idct_simd;\n      #ifndef STBI_JPEG_OLD\n      j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;\n      #endif\n      j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;\n   }\n#endif\n\n#ifdef STBI_NEON\n   j->idct_block_kernel = stbi__idct_simd;\n   #ifndef STBI_JPEG_OLD\n   j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;\n   #endif\n   j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;\n#endif\n}\n\n// clean up the temporary component buffers\nstatic void stbi__cleanup_jpeg(stbi__jpeg *j)\n{\n   int i;\n   for (i=0; i < j->s->img_n; ++i) {\n      if (j->img_comp[i].raw_data) {\n         STBI_FREE(j->img_comp[i].raw_data);\n         j->img_comp[i].raw_data = NULL;\n         j->img_comp[i].data = NULL;\n      }\n      if (j->img_comp[i].raw_coeff) {\n         STBI_FREE(j->img_comp[i].raw_coeff);\n         j->img_comp[i].raw_coeff = 0;\n         j->img_comp[i].coeff = 0;\n      }\n      if (j->img_comp[i].linebuf) {\n         STBI_FREE(j->img_comp[i].linebuf);\n         j->img_comp[i].linebuf = NULL;\n      }\n   }\n}\n\ntypedef struct\n{\n   resample_row_func resample;\n   stbi_uc *line0,*line1;\n   int hs,vs;   // expansion factor in each axis\n   int w_lores; // horizontal pixels pre-expansion\n   int ystep;   // how far through vertical expansion we are\n   int ypos;    // which pre-expansion row we're on\n} stbi__resample;\n\nstatic stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)\n{\n   int n, decode_n;\n   z->s->img_n = 0; // make stbi__cleanup_jpeg safe\n\n   // validate req_comp\n   if (req_comp < 0 || req_comp > 4) return stbi__errpuc(\"bad req_comp\", \"Internal error\");\n\n   // load a jpeg image from whichever source, but leave in YCbCr format\n   if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; }\n\n   // determine actual number of components to generate\n   n = req_comp ? req_comp : z->s->img_n;\n\n   if (z->s->img_n == 3 && n < 3)\n      decode_n = 1;\n   else\n      decode_n = z->s->img_n;\n\n   // resample and color-convert\n   {\n      int k;\n      unsigned int i,j;\n      stbi_uc *output;\n      stbi_uc *coutput[4];\n\n      stbi__resample res_comp[4];\n\n      for (k=0; k < decode_n; ++k) {\n         stbi__resample *r = &res_comp[k];\n\n         // allocate line buffer big enough for upsampling off the edges\n         // with upsample factor of 4\n         z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3);\n         if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc(\"outofmem\", \"Out of memory\"); }\n\n         r->hs      = z->img_h_max / z->img_comp[k].h;\n         r->vs      = z->img_v_max / z->img_comp[k].v;\n         r->ystep   = r->vs >> 1;\n         r->w_lores = (z->s->img_x + r->hs-1) / r->hs;\n         r->ypos    = 0;\n         r->line0   = r->line1 = z->img_comp[k].data;\n\n         if      (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;\n         else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2;\n         else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2;\n         else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel;\n         else                               r->resample = stbi__resample_row_generic;\n      }\n\n      // can't error after this so, this is safe\n      output = (stbi_uc *) stbi__malloc(n * z->s->img_x * z->s->img_y + 1);\n      if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc(\"outofmem\", \"Out of memory\"); }\n\n      // now go ahead and resample\n      for (j=0; j < z->s->img_y; ++j) {\n         stbi_uc *out = output + n * z->s->img_x * j;\n         for (k=0; k < decode_n; ++k) {\n            stbi__resample *r = &res_comp[k];\n            int y_bot = r->ystep >= (r->vs >> 1);\n            coutput[k] = r->resample(z->img_comp[k].linebuf,\n                                     y_bot ? r->line1 : r->line0,\n                                     y_bot ? r->line0 : r->line1,\n                                     r->w_lores, r->hs);\n            if (++r->ystep >= r->vs) {\n               r->ystep = 0;\n               r->line0 = r->line1;\n               if (++r->ypos < z->img_comp[k].y)\n                  r->line1 += z->img_comp[k].w2;\n            }\n         }\n         if (n >= 3) {\n            stbi_uc *y = coutput[0];\n            if (z->s->img_n == 3) {\n               z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);\n            } else\n               for (i=0; i < z->s->img_x; ++i) {\n                  out[0] = out[1] = out[2] = y[i];\n                  out[3] = 255; // not used if n==3\n                  out += n;\n               }\n         } else {\n            stbi_uc *y = coutput[0];\n            if (n == 1)\n               for (i=0; i < z->s->img_x; ++i) out[i] = y[i];\n            else\n               for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255;\n         }\n      }\n      stbi__cleanup_jpeg(z);\n      *out_x = z->s->img_x;\n      *out_y = z->s->img_y;\n      if (comp) *comp  = z->s->img_n; // report original components, not output\n      return output;\n   }\n}\n\nstatic unsigned char *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   stbi__jpeg j;\n   j.s = s;\n   stbi__setup_jpeg(&j);\n   return load_jpeg_image(&j, x,y,comp,req_comp);\n}\n\nstatic int stbi__jpeg_test(stbi__context *s)\n{\n   int r;\n   stbi__jpeg j;\n   j.s = s;\n   stbi__setup_jpeg(&j);\n   r = stbi__decode_jpeg_header(&j, STBI__SCAN_type);\n   stbi__rewind(s);\n   return r;\n}\n\nstatic int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)\n{\n   if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) {\n      stbi__rewind( j->s );\n      return 0;\n   }\n   if (x) *x = j->s->img_x;\n   if (y) *y = j->s->img_y;\n   if (comp) *comp = j->s->img_n;\n   return 1;\n}\n\nstatic int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)\n{\n   stbi__jpeg j;\n   j.s = s;\n   return stbi__jpeg_info_raw(&j, x, y, comp);\n}\n#endif\n\n// public domain zlib decode    v0.2  Sean Barrett 2006-11-18\n//    simple implementation\n//      - all input must be provided in an upfront buffer\n//      - all output is written to a single output buffer (can malloc/realloc)\n//    performance\n//      - fast huffman\n\n#ifndef STBI_NO_ZLIB\n\n// fast-way is faster to check than jpeg huffman, but slow way is slower\n#define STBI__ZFAST_BITS  9 // accelerate all cases in default tables\n#define STBI__ZFAST_MASK  ((1 << STBI__ZFAST_BITS) - 1)\n\n// zlib-style huffman encoding\n// (jpegs packs from left, zlib from right, so can't share code)\ntypedef struct\n{\n   stbi__uint16 fast[1 << STBI__ZFAST_BITS];\n   stbi__uint16 firstcode[16];\n   int maxcode[17];\n   stbi__uint16 firstsymbol[16];\n   stbi_uc  size[288];\n   stbi__uint16 value[288];\n} stbi__zhuffman;\n\nstbi_inline static int stbi__bitreverse16(int n)\n{\n  n = ((n & 0xAAAA) >>  1) | ((n & 0x5555) << 1);\n  n = ((n & 0xCCCC) >>  2) | ((n & 0x3333) << 2);\n  n = ((n & 0xF0F0) >>  4) | ((n & 0x0F0F) << 4);\n  n = ((n & 0xFF00) >>  8) | ((n & 0x00FF) << 8);\n  return n;\n}\n\nstbi_inline static int stbi__bit_reverse(int v, int bits)\n{\n   STBI_ASSERT(bits <= 16);\n   // to bit reverse n bits, reverse 16 and shift\n   // e.g. 11 bits, bit reverse and shift away 5\n   return stbi__bitreverse16(v) >> (16-bits);\n}\n\nstatic int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num)\n{\n   int i,k=0;\n   int code, next_code[16], sizes[17];\n\n   // DEFLATE spec for generating codes\n   memset(sizes, 0, sizeof(sizes));\n   memset(z->fast, 0, sizeof(z->fast));\n   for (i=0; i < num; ++i)\n      ++sizes[sizelist[i]];\n   sizes[0] = 0;\n   for (i=1; i < 16; ++i)\n      STBI_ASSERT(sizes[i] <= (1 << i));\n   code = 0;\n   for (i=1; i < 16; ++i) {\n      next_code[i] = code;\n      z->firstcode[i] = (stbi__uint16) code;\n      z->firstsymbol[i] = (stbi__uint16) k;\n      code = (code + sizes[i]);\n      if (sizes[i])\n         if (code-1 >= (1 << i)) return stbi__err(\"bad codelengths\",\"Corrupt JPEG\");\n      z->maxcode[i] = code << (16-i); // preshift for inner loop\n      code <<= 1;\n      k += sizes[i];\n   }\n   z->maxcode[16] = 0x10000; // sentinel\n   for (i=0; i < num; ++i) {\n      int s = sizelist[i];\n      if (s) {\n         int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];\n         stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i);\n         z->size [c] = (stbi_uc     ) s;\n         z->value[c] = (stbi__uint16) i;\n         if (s <= STBI__ZFAST_BITS) {\n            int k = stbi__bit_reverse(next_code[s],s);\n            while (k < (1 << STBI__ZFAST_BITS)) {\n               z->fast[k] = fastv;\n               k += (1 << s);\n            }\n         }\n         ++next_code[s];\n      }\n   }\n   return 1;\n}\n\n// zlib-from-memory implementation for PNG reading\n//    because PNG allows splitting the zlib stream arbitrarily,\n//    and it's annoying structurally to have PNG call ZLIB call PNG,\n//    we require PNG read all the IDATs and combine them into a single\n//    memory buffer\n\ntypedef struct\n{\n   stbi_uc *zbuffer, *zbuffer_end;\n   int num_bits;\n   stbi__uint32 code_buffer;\n\n   char *zout;\n   char *zout_start;\n   char *zout_end;\n   int   z_expandable;\n\n   stbi__zhuffman z_length, z_distance;\n} stbi__zbuf;\n\nstbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)\n{\n   if (z->zbuffer >= z->zbuffer_end) return 0;\n   return *z->zbuffer++;\n}\n\nstatic void stbi__fill_bits(stbi__zbuf *z)\n{\n   do {\n      STBI_ASSERT(z->code_buffer < (1U << z->num_bits));\n      z->code_buffer |= stbi__zget8(z) << z->num_bits;\n      z->num_bits += 8;\n   } while (z->num_bits <= 24);\n}\n\nstbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n)\n{\n   unsigned int k;\n   if (z->num_bits < n) stbi__fill_bits(z);\n   k = z->code_buffer & ((1 << n) - 1);\n   z->code_buffer >>= n;\n   z->num_bits -= n;\n   return k;\n}\n\nstatic int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)\n{\n   int b,s,k;\n   // not resolved by fast table, so compute it the slow way\n   // use jpeg approach, which requires MSbits at top\n   k = stbi__bit_reverse(a->code_buffer, 16);\n   for (s=STBI__ZFAST_BITS+1; ; ++s)\n      if (k < z->maxcode[s])\n         break;\n   if (s == 16) return -1; // invalid code!\n   // code size is s, so:\n   b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];\n   STBI_ASSERT(z->size[b] == s);\n   a->code_buffer >>= s;\n   a->num_bits -= s;\n   return z->value[b];\n}\n\nstbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)\n{\n   int b,s;\n   if (a->num_bits < 16) stbi__fill_bits(a);\n   b = z->fast[a->code_buffer & STBI__ZFAST_MASK];\n   if (b) {\n      s = b >> 9;\n      a->code_buffer >>= s;\n      a->num_bits -= s;\n      return b & 511;\n   }\n   return stbi__zhuffman_decode_slowpath(a, z);\n}\n\nstatic int stbi__zexpand(stbi__zbuf *z, char *zout, int n)  // need to make room for n bytes\n{\n   char *q;\n   int cur, limit;\n   z->zout = zout;\n   if (!z->z_expandable) return stbi__err(\"output buffer limit\",\"Corrupt PNG\");\n   cur   = (int) (z->zout     - z->zout_start);\n   limit = (int) (z->zout_end - z->zout_start);\n   while (cur + n > limit)\n      limit *= 2;\n   q = (char *) STBI_REALLOC(z->zout_start, limit);\n   if (q == NULL) return stbi__err(\"outofmem\", \"Out of memory\");\n   z->zout_start = q;\n   z->zout       = q + cur;\n   z->zout_end   = q + limit;\n   return 1;\n}\n\nstatic int stbi__zlength_base[31] = {\n   3,4,5,6,7,8,9,10,11,13,\n   15,17,19,23,27,31,35,43,51,59,\n   67,83,99,115,131,163,195,227,258,0,0 };\n\nstatic int stbi__zlength_extra[31]=\n{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };\n\nstatic int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,\n257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0};\n\nstatic int stbi__zdist_extra[32] =\n{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};\n\nstatic int stbi__parse_huffman_block(stbi__zbuf *a)\n{\n   char *zout = a->zout;\n   for(;;) {\n      int z = stbi__zhuffman_decode(a, &a->z_length);\n      if (z < 256) {\n         if (z < 0) return stbi__err(\"bad huffman code\",\"Corrupt PNG\"); // error in huffman codes\n         if (zout >= a->zout_end) {\n            if (!stbi__zexpand(a, zout, 1)) return 0;\n            zout = a->zout;\n         }\n         *zout++ = (char) z;\n      } else {\n         stbi_uc *p;\n         int len,dist;\n         if (z == 256) {\n            a->zout = zout;\n            return 1;\n         }\n         z -= 257;\n         len = stbi__zlength_base[z];\n         if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]);\n         z = stbi__zhuffman_decode(a, &a->z_distance);\n         if (z < 0) return stbi__err(\"bad huffman code\",\"Corrupt PNG\");\n         dist = stbi__zdist_base[z];\n         if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]);\n         if (zout - a->zout_start < dist) return stbi__err(\"bad dist\",\"Corrupt PNG\");\n         if (zout + len > a->zout_end) {\n            if (!stbi__zexpand(a, zout, len)) return 0;\n            zout = a->zout;\n         }\n         p = (stbi_uc *) (zout - dist);\n         if (dist == 1) { // run of one byte; common in images.\n            stbi_uc v = *p;\n            do *zout++ = v; while (--len);\n         } else {\n            do *zout++ = *p++; while (--len);\n         }\n      }\n   }\n}\n\nstatic int stbi__compute_huffman_codes(stbi__zbuf *a)\n{\n   static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };\n   stbi__zhuffman z_codelength;\n   stbi_uc lencodes[286+32+137];//padding for maximum single op\n   stbi_uc codelength_sizes[19];\n   int i,n;\n\n   int hlit  = stbi__zreceive(a,5) + 257;\n   int hdist = stbi__zreceive(a,5) + 1;\n   int hclen = stbi__zreceive(a,4) + 4;\n\n   memset(codelength_sizes, 0, sizeof(codelength_sizes));\n   for (i=0; i < hclen; ++i) {\n      int s = stbi__zreceive(a,3);\n      codelength_sizes[length_dezigzag[i]] = (stbi_uc) s;\n   }\n   if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;\n\n   n = 0;\n   while (n < hlit + hdist) {\n      int c = stbi__zhuffman_decode(a, &z_codelength);\n      STBI_ASSERT(c >= 0 && c < 19);\n      if (c < 16)\n         lencodes[n++] = (stbi_uc) c;\n      else if (c == 16) {\n         c = stbi__zreceive(a,2)+3;\n         memset(lencodes+n, lencodes[n-1], c);\n         n += c;\n      } else if (c == 17) {\n         c = stbi__zreceive(a,3)+3;\n         memset(lencodes+n, 0, c);\n         n += c;\n      } else {\n         STBI_ASSERT(c == 18);\n         c = stbi__zreceive(a,7)+11;\n         memset(lencodes+n, 0, c);\n         n += c;\n      }\n   }\n   if (n != hlit+hdist) return stbi__err(\"bad codelengths\",\"Corrupt PNG\");\n   if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;\n   if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;\n   return 1;\n}\n\nstatic int stbi__parse_uncomperssed_block(stbi__zbuf *a)\n{\n   stbi_uc header[4];\n   int len,nlen,k;\n   if (a->num_bits & 7)\n      stbi__zreceive(a, a->num_bits & 7); // discard\n   // drain the bit-packed data into header\n   k = 0;\n   while (a->num_bits > 0) {\n      header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check\n      a->code_buffer >>= 8;\n      a->num_bits -= 8;\n   }\n   STBI_ASSERT(a->num_bits == 0);\n   // now fill header the normal way\n   while (k < 4)\n      header[k++] = stbi__zget8(a);\n   len  = header[1] * 256 + header[0];\n   nlen = header[3] * 256 + header[2];\n   if (nlen != (len ^ 0xffff)) return stbi__err(\"zlib corrupt\",\"Corrupt PNG\");\n   if (a->zbuffer + len > a->zbuffer_end) return stbi__err(\"read past buffer\",\"Corrupt PNG\");\n   if (a->zout + len > a->zout_end)\n      if (!stbi__zexpand(a, a->zout, len)) return 0;\n   memcpy(a->zout, a->zbuffer, len);\n   a->zbuffer += len;\n   a->zout += len;\n   return 1;\n}\n\nstatic int stbi__parse_zlib_header(stbi__zbuf *a)\n{\n   int cmf   = stbi__zget8(a);\n   int cm    = cmf & 15;\n   /* int cinfo = cmf >> 4; */\n   int flg   = stbi__zget8(a);\n   if ((cmf*256+flg) % 31 != 0) return stbi__err(\"bad zlib header\",\"Corrupt PNG\"); // zlib spec\n   if (flg & 32) return stbi__err(\"no preset dict\",\"Corrupt PNG\"); // preset dictionary not allowed in png\n   if (cm != 8) return stbi__err(\"bad compression\",\"Corrupt PNG\"); // DEFLATE required for png\n   // window = 1 << (8 + cinfo)... but who cares, we fully buffer output\n   return 1;\n}\n\n// @TODO: should statically initialize these for optimal thread safety\nstatic stbi_uc stbi__zdefault_length[288], stbi__zdefault_distance[32];\nstatic void stbi__init_zdefaults(void)\n{\n   int i;   // use <= to match clearly with spec\n   for (i=0; i <= 143; ++i)     stbi__zdefault_length[i]   = 8;\n   for (   ; i <= 255; ++i)     stbi__zdefault_length[i]   = 9;\n   for (   ; i <= 279; ++i)     stbi__zdefault_length[i]   = 7;\n   for (   ; i <= 287; ++i)     stbi__zdefault_length[i]   = 8;\n\n   for (i=0; i <=  31; ++i)     stbi__zdefault_distance[i] = 5;\n}\n\nstatic int stbi__parse_zlib(stbi__zbuf *a, int parse_header)\n{\n   int final, type;\n   if (parse_header)\n      if (!stbi__parse_zlib_header(a)) return 0;\n   a->num_bits = 0;\n   a->code_buffer = 0;\n   do {\n      final = stbi__zreceive(a,1);\n      type = stbi__zreceive(a,2);\n      if (type == 0) {\n         if (!stbi__parse_uncomperssed_block(a)) return 0;\n      } else if (type == 3) {\n         return 0;\n      } else {\n         if (type == 1) {\n            // use fixed code lengths\n            if (!stbi__zdefault_distance[31]) stbi__init_zdefaults();\n            if (!stbi__zbuild_huffman(&a->z_length  , stbi__zdefault_length  , 288)) return 0;\n            if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance,  32)) return 0;\n         } else {\n            if (!stbi__compute_huffman_codes(a)) return 0;\n         }\n         if (!stbi__parse_huffman_block(a)) return 0;\n      }\n   } while (!final);\n   return 1;\n}\n\nstatic int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header)\n{\n   a->zout_start = obuf;\n   a->zout       = obuf;\n   a->zout_end   = obuf + olen;\n   a->z_expandable = exp;\n\n   return stbi__parse_zlib(a, parse_header);\n}\n\nSTBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)\n{\n   stbi__zbuf a;\n   char *p = (char *) stbi__malloc(initial_size);\n   if (p == NULL) return NULL;\n   a.zbuffer = (stbi_uc *) buffer;\n   a.zbuffer_end = (stbi_uc *) buffer + len;\n   if (stbi__do_zlib(&a, p, initial_size, 1, 1)) {\n      if (outlen) *outlen = (int) (a.zout - a.zout_start);\n      return a.zout_start;\n   } else {\n      STBI_FREE(a.zout_start);\n      return NULL;\n   }\n}\n\nSTBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)\n{\n   return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);\n}\n\nSTBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)\n{\n   stbi__zbuf a;\n   char *p = (char *) stbi__malloc(initial_size);\n   if (p == NULL) return NULL;\n   a.zbuffer = (stbi_uc *) buffer;\n   a.zbuffer_end = (stbi_uc *) buffer + len;\n   if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) {\n      if (outlen) *outlen = (int) (a.zout - a.zout_start);\n      return a.zout_start;\n   } else {\n      STBI_FREE(a.zout_start);\n      return NULL;\n   }\n}\n\nSTBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen)\n{\n   stbi__zbuf a;\n   a.zbuffer = (stbi_uc *) ibuffer;\n   a.zbuffer_end = (stbi_uc *) ibuffer + ilen;\n   if (stbi__do_zlib(&a, obuffer, olen, 0, 1))\n      return (int) (a.zout - a.zout_start);\n   else\n      return -1;\n}\n\nSTBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)\n{\n   stbi__zbuf a;\n   char *p = (char *) stbi__malloc(16384);\n   if (p == NULL) return NULL;\n   a.zbuffer = (stbi_uc *) buffer;\n   a.zbuffer_end = (stbi_uc *) buffer+len;\n   if (stbi__do_zlib(&a, p, 16384, 1, 0)) {\n      if (outlen) *outlen = (int) (a.zout - a.zout_start);\n      return a.zout_start;\n   } else {\n      STBI_FREE(a.zout_start);\n      return NULL;\n   }\n}\n\nSTBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)\n{\n   stbi__zbuf a;\n   a.zbuffer = (stbi_uc *) ibuffer;\n   a.zbuffer_end = (stbi_uc *) ibuffer + ilen;\n   if (stbi__do_zlib(&a, obuffer, olen, 0, 0))\n      return (int) (a.zout - a.zout_start);\n   else\n      return -1;\n}\n#endif\n\n// public domain \"baseline\" PNG decoder   v0.10  Sean Barrett 2006-11-18\n//    simple implementation\n//      - only 8-bit samples\n//      - no CRC checking\n//      - allocates lots of intermediate memory\n//        - avoids problem of streaming data between subsystems\n//        - avoids explicit window management\n//    performance\n//      - uses stb_zlib, a PD zlib implementation with fast huffman decoding\n\n#ifndef STBI_NO_PNG\ntypedef struct\n{\n   stbi__uint32 length;\n   stbi__uint32 type;\n} stbi__pngchunk;\n\nstatic stbi__pngchunk stbi__get_chunk_header(stbi__context *s)\n{\n   stbi__pngchunk c;\n   c.length = stbi__get32be(s);\n   c.type   = stbi__get32be(s);\n   return c;\n}\n\nstatic int stbi__check_png_header(stbi__context *s)\n{\n   static stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 };\n   int i;\n   for (i=0; i < 8; ++i)\n      if (stbi__get8(s) != png_sig[i]) return stbi__err(\"bad png sig\",\"Not a PNG\");\n   return 1;\n}\n\ntypedef struct\n{\n   stbi__context *s;\n   stbi_uc *idata, *expanded, *out;\n} stbi__png;\n\n\nenum {\n   STBI__F_none=0,\n   STBI__F_sub=1,\n   STBI__F_up=2,\n   STBI__F_avg=3,\n   STBI__F_paeth=4,\n   // synthetic filters used for first scanline to avoid needing a dummy row of 0s\n   STBI__F_avg_first,\n   STBI__F_paeth_first\n};\n\nstatic stbi_uc first_row_filter[5] =\n{\n   STBI__F_none,\n   STBI__F_sub,\n   STBI__F_none,\n   STBI__F_avg_first,\n   STBI__F_paeth_first\n};\n\nstatic int stbi__paeth(int a, int b, int c)\n{\n   int p = a + b - c;\n   int pa = abs(p-a);\n   int pb = abs(p-b);\n   int pc = abs(p-c);\n   if (pa <= pb && pa <= pc) return a;\n   if (pb <= pc) return b;\n   return c;\n}\n\nstatic stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };\n\n// create the png data from post-deflated data\nstatic int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color)\n{\n   stbi__context *s = a->s;\n   stbi__uint32 i,j,stride = x*out_n;\n   stbi__uint32 img_len, img_width_bytes;\n   int k;\n   int img_n = s->img_n; // copy it into a local for later\n\n   STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);\n   a->out = (stbi_uc *) stbi__malloc(x * y * out_n); // extra bytes to write off the end into\n   if (!a->out) return stbi__err(\"outofmem\", \"Out of memory\");\n\n   img_width_bytes = (((img_n * x * depth) + 7) >> 3);\n   img_len = (img_width_bytes + 1) * y;\n   if (s->img_x == x && s->img_y == y) {\n      if (raw_len != img_len) return stbi__err(\"not enough pixels\",\"Corrupt PNG\");\n   } else { // interlaced:\n      if (raw_len < img_len) return stbi__err(\"not enough pixels\",\"Corrupt PNG\");\n   }\n\n   for (j=0; j < y; ++j) {\n      stbi_uc *cur = a->out + stride*j;\n      stbi_uc *prior = cur - stride;\n      int filter = *raw++;\n      int filter_bytes = img_n;\n      int width = x;\n      if (filter > 4)\n         return stbi__err(\"invalid filter\",\"Corrupt PNG\");\n\n      if (depth < 8) {\n         STBI_ASSERT(img_width_bytes <= x);\n         cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place\n         filter_bytes = 1;\n         width = img_width_bytes;\n      }\n\n      // if first row, use special filter that doesn't sample previous row\n      if (j == 0) filter = first_row_filter[filter];\n\n      // handle first byte explicitly\n      for (k=0; k < filter_bytes; ++k) {\n         switch (filter) {\n            case STBI__F_none       : cur[k] = raw[k]; break;\n            case STBI__F_sub        : cur[k] = raw[k]; break;\n            case STBI__F_up         : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;\n            case STBI__F_avg        : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break;\n            case STBI__F_paeth      : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break;\n            case STBI__F_avg_first  : cur[k] = raw[k]; break;\n            case STBI__F_paeth_first: cur[k] = raw[k]; break;\n         }\n      }\n\n      if (depth == 8) {\n         if (img_n != out_n)\n            cur[img_n] = 255; // first pixel\n         raw += img_n;\n         cur += out_n;\n         prior += out_n;\n      } else {\n         raw += 1;\n         cur += 1;\n         prior += 1;\n      }\n\n      // this is a little gross, so that we don't switch per-pixel or per-component\n      if (depth < 8 || img_n == out_n) {\n         int nk = (width - 1)*img_n;\n         #define CASE(f) \\\n             case f:     \\\n                for (k=0; k < nk; ++k)\n         switch (filter) {\n            // \"none\" filter turns into a memcpy here; make that explicit.\n            case STBI__F_none:         memcpy(cur, raw, nk); break;\n            CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break;\n            CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;\n            CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break;\n            CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break;\n            CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break;\n            CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break;\n         }\n         #undef CASE\n         raw += nk;\n      } else {\n         STBI_ASSERT(img_n+1 == out_n);\n         #define CASE(f) \\\n             case f:     \\\n                for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \\\n                   for (k=0; k < img_n; ++k)\n         switch (filter) {\n            CASE(STBI__F_none)         cur[k] = raw[k]; break;\n            CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-out_n]); break;\n            CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;\n            CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-out_n])>>1)); break;\n            CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;\n            CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-out_n] >> 1)); break;\n            CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],0,0)); break;\n         }\n         #undef CASE\n      }\n   }\n\n   // we make a separate pass to expand bits to pixels; for performance,\n   // this could run two scanlines behind the above code, so it won't\n   // intefere with filtering but will still be in the cache.\n   if (depth < 8) {\n      for (j=0; j < y; ++j) {\n         stbi_uc *cur = a->out + stride*j;\n         stbi_uc *in  = a->out + stride*j + x*out_n - img_width_bytes;\n         // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit\n         // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop\n         stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range\n\n         // note that the final byte might overshoot and write more data than desired.\n         // we can allocate enough data that this never writes out of memory, but it\n         // could also overwrite the next scanline. can it overwrite non-empty data\n         // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel.\n         // so we need to explicitly clamp the final ones\n\n         if (depth == 4) {\n            for (k=x*img_n; k >= 2; k-=2, ++in) {\n               *cur++ = scale * ((*in >> 4)       );\n               *cur++ = scale * ((*in     ) & 0x0f);\n            }\n            if (k > 0) *cur++ = scale * ((*in >> 4)       );\n         } else if (depth == 2) {\n            for (k=x*img_n; k >= 4; k-=4, ++in) {\n               *cur++ = scale * ((*in >> 6)       );\n               *cur++ = scale * ((*in >> 4) & 0x03);\n               *cur++ = scale * ((*in >> 2) & 0x03);\n               *cur++ = scale * ((*in     ) & 0x03);\n            }\n            if (k > 0) *cur++ = scale * ((*in >> 6)       );\n            if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03);\n            if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03);\n         } else if (depth == 1) {\n            for (k=x*img_n; k >= 8; k-=8, ++in) {\n               *cur++ = scale * ((*in >> 7)       );\n               *cur++ = scale * ((*in >> 6) & 0x01);\n               *cur++ = scale * ((*in >> 5) & 0x01);\n               *cur++ = scale * ((*in >> 4) & 0x01);\n               *cur++ = scale * ((*in >> 3) & 0x01);\n               *cur++ = scale * ((*in >> 2) & 0x01);\n               *cur++ = scale * ((*in >> 1) & 0x01);\n               *cur++ = scale * ((*in     ) & 0x01);\n            }\n            if (k > 0) *cur++ = scale * ((*in >> 7)       );\n            if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01);\n            if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01);\n            if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01);\n            if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01);\n            if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01);\n            if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01);\n         }\n         if (img_n != out_n) {\n            // insert alpha = 255\n            stbi_uc *cur = a->out + stride*j;\n            int i;\n            if (img_n == 1) {\n               for (i=x-1; i >= 0; --i) {\n                  cur[i*2+1] = 255;\n                  cur[i*2+0] = cur[i];\n               }\n            } else {\n               STBI_ASSERT(img_n == 3);\n               for (i=x-1; i >= 0; --i) {\n                  cur[i*4+3] = 255;\n                  cur[i*4+2] = cur[i*3+2];\n                  cur[i*4+1] = cur[i*3+1];\n                  cur[i*4+0] = cur[i*3+0];\n               }\n            }\n         }\n      }\n   }\n\n   return 1;\n}\n\nstatic int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced)\n{\n   stbi_uc *final;\n   int p;\n   if (!interlaced)\n      return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color);\n\n   // de-interlacing\n   final = (stbi_uc *) stbi__malloc(a->s->img_x * a->s->img_y * out_n);\n   for (p=0; p < 7; ++p) {\n      int xorig[] = { 0,4,0,2,0,1,0 };\n      int yorig[] = { 0,0,4,0,2,0,1 };\n      int xspc[]  = { 8,8,4,4,2,2,1 };\n      int yspc[]  = { 8,8,8,4,4,2,2 };\n      int i,j,x,y;\n      // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1\n      x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];\n      y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];\n      if (x && y) {\n         stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;\n         if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) {\n            STBI_FREE(final);\n            return 0;\n         }\n         for (j=0; j < y; ++j) {\n            for (i=0; i < x; ++i) {\n               int out_y = j*yspc[p]+yorig[p];\n               int out_x = i*xspc[p]+xorig[p];\n               memcpy(final + out_y*a->s->img_x*out_n + out_x*out_n,\n                      a->out + (j*x+i)*out_n, out_n);\n            }\n         }\n         STBI_FREE(a->out);\n         image_data += img_len;\n         image_data_len -= img_len;\n      }\n   }\n   a->out = final;\n\n   return 1;\n}\n\nstatic int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n)\n{\n   stbi__context *s = z->s;\n   stbi__uint32 i, pixel_count = s->img_x * s->img_y;\n   stbi_uc *p = z->out;\n\n   // compute color-based transparency, assuming we've\n   // already got 255 as the alpha value in the output\n   STBI_ASSERT(out_n == 2 || out_n == 4);\n\n   if (out_n == 2) {\n      for (i=0; i < pixel_count; ++i) {\n         p[1] = (p[0] == tc[0] ? 0 : 255);\n         p += 2;\n      }\n   } else {\n      for (i=0; i < pixel_count; ++i) {\n         if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])\n            p[3] = 0;\n         p += 4;\n      }\n   }\n   return 1;\n}\n\nstatic int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n)\n{\n   stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;\n   stbi_uc *p, *temp_out, *orig = a->out;\n\n   p = (stbi_uc *) stbi__malloc(pixel_count * pal_img_n);\n   if (p == NULL) return stbi__err(\"outofmem\", \"Out of memory\");\n\n   // between here and free(out) below, exitting would leak\n   temp_out = p;\n\n   if (pal_img_n == 3) {\n      for (i=0; i < pixel_count; ++i) {\n         int n = orig[i]*4;\n         p[0] = palette[n  ];\n         p[1] = palette[n+1];\n         p[2] = palette[n+2];\n         p += 3;\n      }\n   } else {\n      for (i=0; i < pixel_count; ++i) {\n         int n = orig[i]*4;\n         p[0] = palette[n  ];\n         p[1] = palette[n+1];\n         p[2] = palette[n+2];\n         p[3] = palette[n+3];\n         p += 4;\n      }\n   }\n   STBI_FREE(a->out);\n   a->out = temp_out;\n\n   STBI_NOTUSED(len);\n\n   return 1;\n}\n\nstatic int stbi__unpremultiply_on_load = 0;\nstatic int stbi__de_iphone_flag = 0;\n\nSTBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply)\n{\n   stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply;\n}\n\nSTBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)\n{\n   stbi__de_iphone_flag = flag_true_if_should_convert;\n}\n\nstatic void stbi__de_iphone(stbi__png *z)\n{\n   stbi__context *s = z->s;\n   stbi__uint32 i, pixel_count = s->img_x * s->img_y;\n   stbi_uc *p = z->out;\n\n   if (s->img_out_n == 3) {  // convert bgr to rgb\n      for (i=0; i < pixel_count; ++i) {\n         stbi_uc t = p[0];\n         p[0] = p[2];\n         p[2] = t;\n         p += 3;\n      }\n   } else {\n      STBI_ASSERT(s->img_out_n == 4);\n      if (stbi__unpremultiply_on_load) {\n         // convert bgr to rgb and unpremultiply\n         for (i=0; i < pixel_count; ++i) {\n            stbi_uc a = p[3];\n            stbi_uc t = p[0];\n            if (a) {\n               p[0] = p[2] * 255 / a;\n               p[1] = p[1] * 255 / a;\n               p[2] =  t   * 255 / a;\n            } else {\n               p[0] = p[2];\n               p[2] = t;\n            }\n            p += 4;\n         }\n      } else {\n         // convert bgr to rgb\n         for (i=0; i < pixel_count; ++i) {\n            stbi_uc t = p[0];\n            p[0] = p[2];\n            p[2] = t;\n            p += 4;\n         }\n      }\n   }\n}\n\n#define STBI__PNG_TYPE(a,b,c,d)  (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))\n\nstatic int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)\n{\n   stbi_uc palette[1024], pal_img_n=0;\n   stbi_uc has_trans=0, tc[3];\n   stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;\n   int first=1,k,interlace=0, color=0, depth=0, is_iphone=0;\n   stbi__context *s = z->s;\n\n   z->expanded = NULL;\n   z->idata = NULL;\n   z->out = NULL;\n\n   if (!stbi__check_png_header(s)) return 0;\n\n   if (scan == STBI__SCAN_type) return 1;\n\n   for (;;) {\n      stbi__pngchunk c = stbi__get_chunk_header(s);\n      switch (c.type) {\n         case STBI__PNG_TYPE('C','g','B','I'):\n            is_iphone = 1;\n            stbi__skip(s, c.length);\n            break;\n         case STBI__PNG_TYPE('I','H','D','R'): {\n            int comp,filter;\n            if (!first) return stbi__err(\"multiple IHDR\",\"Corrupt PNG\");\n            first = 0;\n            if (c.length != 13) return stbi__err(\"bad IHDR len\",\"Corrupt PNG\");\n            s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err(\"too large\",\"Very large image (corrupt?)\");\n            s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err(\"too large\",\"Very large image (corrupt?)\");\n            depth = stbi__get8(s);  if (depth != 1 && depth != 2 && depth != 4 && depth != 8)  return stbi__err(\"1/2/4/8-bit only\",\"PNG not supported: 1/2/4/8-bit only\");\n            color = stbi__get8(s);  if (color > 6)         return stbi__err(\"bad ctype\",\"Corrupt PNG\");\n            if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err(\"bad ctype\",\"Corrupt PNG\");\n            comp  = stbi__get8(s);  if (comp) return stbi__err(\"bad comp method\",\"Corrupt PNG\");\n            filter= stbi__get8(s);  if (filter) return stbi__err(\"bad filter method\",\"Corrupt PNG\");\n            interlace = stbi__get8(s); if (interlace>1) return stbi__err(\"bad interlace method\",\"Corrupt PNG\");\n            if (!s->img_x || !s->img_y) return stbi__err(\"0-pixel image\",\"Corrupt PNG\");\n            if (!pal_img_n) {\n               s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);\n               if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err(\"too large\", \"Image too large to decode\");\n               if (scan == STBI__SCAN_header) return 1;\n            } else {\n               // if paletted, then pal_n is our final components, and\n               // img_n is # components to decompress/filter.\n               s->img_n = 1;\n               if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err(\"too large\",\"Corrupt PNG\");\n               // if SCAN_header, have to scan to see if we have a tRNS\n            }\n            break;\n         }\n\n         case STBI__PNG_TYPE('P','L','T','E'):  {\n            if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n            if (c.length > 256*3) return stbi__err(\"invalid PLTE\",\"Corrupt PNG\");\n            pal_len = c.length / 3;\n            if (pal_len * 3 != c.length) return stbi__err(\"invalid PLTE\",\"Corrupt PNG\");\n            for (i=0; i < pal_len; ++i) {\n               palette[i*4+0] = stbi__get8(s);\n               palette[i*4+1] = stbi__get8(s);\n               palette[i*4+2] = stbi__get8(s);\n               palette[i*4+3] = 255;\n            }\n            break;\n         }\n\n         case STBI__PNG_TYPE('t','R','N','S'): {\n            if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n            if (z->idata) return stbi__err(\"tRNS after IDAT\",\"Corrupt PNG\");\n            if (pal_img_n) {\n               if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; }\n               if (pal_len == 0) return stbi__err(\"tRNS before PLTE\",\"Corrupt PNG\");\n               if (c.length > pal_len) return stbi__err(\"bad tRNS len\",\"Corrupt PNG\");\n               pal_img_n = 4;\n               for (i=0; i < c.length; ++i)\n                  palette[i*4+3] = stbi__get8(s);\n            } else {\n               if (!(s->img_n & 1)) return stbi__err(\"tRNS with alpha\",\"Corrupt PNG\");\n               if (c.length != (stbi__uint32) s->img_n*2) return stbi__err(\"bad tRNS len\",\"Corrupt PNG\");\n               has_trans = 1;\n               for (k=0; k < s->img_n; ++k)\n                  tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[depth]; // non 8-bit images will be larger\n            }\n            break;\n         }\n\n         case STBI__PNG_TYPE('I','D','A','T'): {\n            if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n            if (pal_img_n && !pal_len) return stbi__err(\"no PLTE\",\"Corrupt PNG\");\n            if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; }\n            if (ioff + c.length > idata_limit) {\n               stbi_uc *p;\n               if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;\n               while (ioff + c.length > idata_limit)\n                  idata_limit *= 2;\n               p = (stbi_uc *) STBI_REALLOC(z->idata, idata_limit); if (p == NULL) return stbi__err(\"outofmem\", \"Out of memory\");\n               z->idata = p;\n            }\n            if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err(\"outofdata\",\"Corrupt PNG\");\n            ioff += c.length;\n            break;\n         }\n\n         case STBI__PNG_TYPE('I','E','N','D'): {\n            stbi__uint32 raw_len, bpl;\n            if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n            if (scan != STBI__SCAN_load) return 1;\n            if (z->idata == NULL) return stbi__err(\"no IDAT\",\"Corrupt PNG\");\n            // initial guess for decoded data size to avoid unnecessary reallocs\n            bpl = (s->img_x * depth + 7) / 8; // bytes per line, per component\n            raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */;\n            z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone);\n            if (z->expanded == NULL) return 0; // zlib should set error\n            STBI_FREE(z->idata); z->idata = NULL;\n            if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)\n               s->img_out_n = s->img_n+1;\n            else\n               s->img_out_n = s->img_n;\n            if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, depth, color, interlace)) return 0;\n            if (has_trans)\n               if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0;\n            if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)\n               stbi__de_iphone(z);\n            if (pal_img_n) {\n               // pal_img_n == 3 or 4\n               s->img_n = pal_img_n; // record the actual colors we had\n               s->img_out_n = pal_img_n;\n               if (req_comp >= 3) s->img_out_n = req_comp;\n               if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n))\n                  return 0;\n            }\n            STBI_FREE(z->expanded); z->expanded = NULL;\n            return 1;\n         }\n\n         default:\n            // if critical, fail\n            if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n            if ((c.type & (1 << 29)) == 0) {\n               #ifndef STBI_NO_FAILURE_STRINGS\n               // not threadsafe\n               static char invalid_chunk[] = \"XXXX PNG chunk not known\";\n               invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);\n               invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);\n               invalid_chunk[2] = STBI__BYTECAST(c.type >>  8);\n               invalid_chunk[3] = STBI__BYTECAST(c.type >>  0);\n               #endif\n               return stbi__err(invalid_chunk, \"PNG not supported: unknown PNG chunk type\");\n            }\n            stbi__skip(s, c.length);\n            break;\n      }\n      // end of PNG chunk, read and skip CRC\n      stbi__get32be(s);\n   }\n}\n\nstatic unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp)\n{\n   unsigned char *result=NULL;\n   if (req_comp < 0 || req_comp > 4) return stbi__errpuc(\"bad req_comp\", \"Internal error\");\n   if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {\n      result = p->out;\n      p->out = NULL;\n      if (req_comp && req_comp != p->s->img_out_n) {\n         result = stbi__convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);\n         p->s->img_out_n = req_comp;\n         if (result == NULL) return result;\n      }\n      *x = p->s->img_x;\n      *y = p->s->img_y;\n      if (n) *n = p->s->img_out_n;\n   }\n   STBI_FREE(p->out);      p->out      = NULL;\n   STBI_FREE(p->expanded); p->expanded = NULL;\n   STBI_FREE(p->idata);    p->idata    = NULL;\n\n   return result;\n}\n\nstatic unsigned char *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   stbi__png p;\n   p.s = s;\n   return stbi__do_png(&p, x,y,comp,req_comp);\n}\n\nstatic int stbi__png_test(stbi__context *s)\n{\n   int r;\n   r = stbi__check_png_header(s);\n   stbi__rewind(s);\n   return r;\n}\n\nstatic int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)\n{\n   if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) {\n      stbi__rewind( p->s );\n      return 0;\n   }\n   if (x) *x = p->s->img_x;\n   if (y) *y = p->s->img_y;\n   if (comp) *comp = p->s->img_n;\n   return 1;\n}\n\nstatic int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)\n{\n   stbi__png p;\n   p.s = s;\n   return stbi__png_info_raw(&p, x, y, comp);\n}\n#endif\n\n// Microsoft/Windows BMP image\n\n#ifndef STBI_NO_BMP\nstatic int stbi__bmp_test_raw(stbi__context *s)\n{\n   int r;\n   int sz;\n   if (stbi__get8(s) != 'B') return 0;\n   if (stbi__get8(s) != 'M') return 0;\n   stbi__get32le(s); // discard filesize\n   stbi__get16le(s); // discard reserved\n   stbi__get16le(s); // discard reserved\n   stbi__get32le(s); // discard data offset\n   sz = stbi__get32le(s);\n   r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124);\n   return r;\n}\n\nstatic int stbi__bmp_test(stbi__context *s)\n{\n   int r = stbi__bmp_test_raw(s);\n   stbi__rewind(s);\n   return r;\n}\n\n\n// returns 0..31 for the highest set bit\nstatic int stbi__high_bit(unsigned int z)\n{\n   int n=0;\n   if (z == 0) return -1;\n   if (z >= 0x10000) n += 16, z >>= 16;\n   if (z >= 0x00100) n +=  8, z >>=  8;\n   if (z >= 0x00010) n +=  4, z >>=  4;\n   if (z >= 0x00004) n +=  2, z >>=  2;\n   if (z >= 0x00002) n +=  1, z >>=  1;\n   return n;\n}\n\nstatic int stbi__bitcount(unsigned int a)\n{\n   a = (a & 0x55555555) + ((a >>  1) & 0x55555555); // max 2\n   a = (a & 0x33333333) + ((a >>  2) & 0x33333333); // max 4\n   a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits\n   a = (a + (a >> 8)); // max 16 per 8 bits\n   a = (a + (a >> 16)); // max 32 per 8 bits\n   return a & 0xff;\n}\n\nstatic int stbi__shiftsigned(int v, int shift, int bits)\n{\n   int result;\n   int z=0;\n\n   if (shift < 0) v <<= -shift;\n   else v >>= shift;\n   result = v;\n\n   z = bits;\n   while (z < 8) {\n      result += v >> z;\n      z += bits;\n   }\n   return result;\n}\n\nstatic stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   stbi_uc *out;\n   unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0;\n   stbi_uc pal[256][4];\n   int psize=0,i,j,compress=0,width;\n   int bpp, flip_vertically, pad, target, offset, hsz;\n   if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc(\"not BMP\", \"Corrupt BMP\");\n   stbi__get32le(s); // discard filesize\n   stbi__get16le(s); // discard reserved\n   stbi__get16le(s); // discard reserved\n   offset = stbi__get32le(s);\n   hsz = stbi__get32le(s);\n   if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc(\"unknown BMP\", \"BMP type not supported: unknown\");\n   if (hsz == 12) {\n      s->img_x = stbi__get16le(s);\n      s->img_y = stbi__get16le(s);\n   } else {\n      s->img_x = stbi__get32le(s);\n      s->img_y = stbi__get32le(s);\n   }\n   if (stbi__get16le(s) != 1) return stbi__errpuc(\"bad BMP\", \"bad BMP\");\n   bpp = stbi__get16le(s);\n   if (bpp == 1) return stbi__errpuc(\"monochrome\", \"BMP type not supported: 1-bit\");\n   flip_vertically = ((int) s->img_y) > 0;\n   s->img_y = abs((int) s->img_y);\n   if (hsz == 12) {\n      if (bpp < 24)\n         psize = (offset - 14 - 24) / 3;\n   } else {\n      compress = stbi__get32le(s);\n      if (compress == 1 || compress == 2) return stbi__errpuc(\"BMP RLE\", \"BMP type not supported: RLE\");\n      stbi__get32le(s); // discard sizeof\n      stbi__get32le(s); // discard hres\n      stbi__get32le(s); // discard vres\n      stbi__get32le(s); // discard colorsused\n      stbi__get32le(s); // discard max important\n      if (hsz == 40 || hsz == 56) {\n         if (hsz == 56) {\n            stbi__get32le(s);\n            stbi__get32le(s);\n            stbi__get32le(s);\n            stbi__get32le(s);\n         }\n         if (bpp == 16 || bpp == 32) {\n            mr = mg = mb = 0;\n            if (compress == 0) {\n               if (bpp == 32) {\n                  mr = 0xffu << 16;\n                  mg = 0xffu <<  8;\n                  mb = 0xffu <<  0;\n                  ma = 0xffu << 24;\n                  fake_a = 1; // @TODO: check for cases like alpha value is all 0 and switch it to 255\n                  STBI_NOTUSED(fake_a);\n               } else {\n                  mr = 31u << 10;\n                  mg = 31u <<  5;\n                  mb = 31u <<  0;\n               }\n            } else if (compress == 3) {\n               mr = stbi__get32le(s);\n               mg = stbi__get32le(s);\n               mb = stbi__get32le(s);\n               // not documented, but generated by photoshop and handled by mspaint\n               if (mr == mg && mg == mb) {\n                  // ?!?!?\n                  return stbi__errpuc(\"bad BMP\", \"bad BMP\");\n               }\n            } else\n               return stbi__errpuc(\"bad BMP\", \"bad BMP\");\n         }\n      } else {\n         STBI_ASSERT(hsz == 108 || hsz == 124);\n         mr = stbi__get32le(s);\n         mg = stbi__get32le(s);\n         mb = stbi__get32le(s);\n         ma = stbi__get32le(s);\n         stbi__get32le(s); // discard color space\n         for (i=0; i < 12; ++i)\n            stbi__get32le(s); // discard color space parameters\n         if (hsz == 124) {\n            stbi__get32le(s); // discard rendering intent\n            stbi__get32le(s); // discard offset of profile data\n            stbi__get32le(s); // discard size of profile data\n            stbi__get32le(s); // discard reserved\n         }\n      }\n      if (bpp < 16)\n         psize = (offset - 14 - hsz) >> 2;\n   }\n   s->img_n = ma ? 4 : 3;\n   if (req_comp && req_comp >= 3) // we can directly decode 3 or 4\n      target = req_comp;\n   else\n      target = s->img_n; // if they want monochrome, we'll post-convert\n   out = (stbi_uc *) stbi__malloc(target * s->img_x * s->img_y);\n   if (!out) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n   if (bpp < 16) {\n      int z=0;\n      if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc(\"invalid\", \"Corrupt BMP\"); }\n      for (i=0; i < psize; ++i) {\n         pal[i][2] = stbi__get8(s);\n         pal[i][1] = stbi__get8(s);\n         pal[i][0] = stbi__get8(s);\n         if (hsz != 12) stbi__get8(s);\n         pal[i][3] = 255;\n      }\n      stbi__skip(s, offset - 14 - hsz - psize * (hsz == 12 ? 3 : 4));\n      if (bpp == 4) width = (s->img_x + 1) >> 1;\n      else if (bpp == 8) width = s->img_x;\n      else { STBI_FREE(out); return stbi__errpuc(\"bad bpp\", \"Corrupt BMP\"); }\n      pad = (-width)&3;\n      for (j=0; j < (int) s->img_y; ++j) {\n         for (i=0; i < (int) s->img_x; i += 2) {\n            int v=stbi__get8(s),v2=0;\n            if (bpp == 4) {\n               v2 = v & 15;\n               v >>= 4;\n            }\n            out[z++] = pal[v][0];\n            out[z++] = pal[v][1];\n            out[z++] = pal[v][2];\n            if (target == 4) out[z++] = 255;\n            if (i+1 == (int) s->img_x) break;\n            v = (bpp == 8) ? stbi__get8(s) : v2;\n            out[z++] = pal[v][0];\n            out[z++] = pal[v][1];\n            out[z++] = pal[v][2];\n            if (target == 4) out[z++] = 255;\n         }\n         stbi__skip(s, pad);\n      }\n   } else {\n      int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0;\n      int z = 0;\n      int easy=0;\n      stbi__skip(s, offset - 14 - hsz);\n      if (bpp == 24) width = 3 * s->img_x;\n      else if (bpp == 16) width = 2*s->img_x;\n      else /* bpp = 32 and pad = 0 */ width=0;\n      pad = (-width) & 3;\n      if (bpp == 24) {\n         easy = 1;\n      } else if (bpp == 32) {\n         if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000)\n            easy = 2;\n      }\n      if (!easy) {\n         if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc(\"bad masks\", \"Corrupt BMP\"); }\n         // right shift amt to put high bit in position #7\n         rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr);\n         gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg);\n         bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb);\n         ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma);\n      }\n      for (j=0; j < (int) s->img_y; ++j) {\n         if (easy) {\n            for (i=0; i < (int) s->img_x; ++i) {\n               unsigned char a;\n               out[z+2] = stbi__get8(s);\n               out[z+1] = stbi__get8(s);\n               out[z+0] = stbi__get8(s);\n               z += 3;\n               a = (easy == 2 ? stbi__get8(s) : 255);\n               if (target == 4) out[z++] = a;\n            }\n         } else {\n            for (i=0; i < (int) s->img_x; ++i) {\n               stbi__uint32 v = (stbi__uint32) (bpp == 16 ? stbi__get16le(s) : stbi__get32le(s));\n               int a;\n               out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount));\n               out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount));\n               out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount));\n               a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255);\n               if (target == 4) out[z++] = STBI__BYTECAST(a);\n            }\n         }\n         stbi__skip(s, pad);\n      }\n   }\n   if (flip_vertically) {\n      stbi_uc t;\n      for (j=0; j < (int) s->img_y>>1; ++j) {\n         stbi_uc *p1 = out +      j     *s->img_x*target;\n         stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;\n         for (i=0; i < (int) s->img_x*target; ++i) {\n            t = p1[i], p1[i] = p2[i], p2[i] = t;\n         }\n      }\n   }\n\n   if (req_comp && req_comp != target) {\n      out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y);\n      if (out == NULL) return out; // stbi__convert_format frees input on failure\n   }\n\n   *x = s->img_x;\n   *y = s->img_y;\n   if (comp) *comp = s->img_n;\n   return out;\n}\n#endif\n\n// Targa Truevision - TGA\n// by Jonathan Dummer\n#ifndef STBI_NO_TGA\nstatic int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)\n{\n    int tga_w, tga_h, tga_comp;\n    int sz;\n    stbi__get8(s);                   // discard Offset\n    sz = stbi__get8(s);              // color type\n    if( sz > 1 ) {\n        stbi__rewind(s);\n        return 0;      // only RGB or indexed allowed\n    }\n    sz = stbi__get8(s);              // image type\n    // only RGB or grey allowed, +/- RLE\n    if ((sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11)) return 0;\n    stbi__skip(s,9);\n    tga_w = stbi__get16le(s);\n    if( tga_w < 1 ) {\n        stbi__rewind(s);\n        return 0;   // test width\n    }\n    tga_h = stbi__get16le(s);\n    if( tga_h < 1 ) {\n        stbi__rewind(s);\n        return 0;   // test height\n    }\n    sz = stbi__get8(s);               // bits per pixel\n    // only RGB or RGBA or grey allowed\n    if ((sz != 8) && (sz != 16) && (sz != 24) && (sz != 32)) {\n        stbi__rewind(s);\n        return 0;\n    }\n    tga_comp = sz;\n    if (x) *x = tga_w;\n    if (y) *y = tga_h;\n    if (comp) *comp = tga_comp / 8;\n    return 1;                   // seems to have passed everything\n}\n\nstatic int stbi__tga_test(stbi__context *s)\n{\n   int res;\n   int sz;\n   stbi__get8(s);      //   discard Offset\n   sz = stbi__get8(s);   //   color type\n   if ( sz > 1 ) return 0;   //   only RGB or indexed allowed\n   sz = stbi__get8(s);   //   image type\n   if ( (sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11) ) return 0;   //   only RGB or grey allowed, +/- RLE\n   stbi__get16be(s);      //   discard palette start\n   stbi__get16be(s);      //   discard palette length\n   stbi__get8(s);         //   discard bits per palette color entry\n   stbi__get16be(s);      //   discard x origin\n   stbi__get16be(s);      //   discard y origin\n   if ( stbi__get16be(s) < 1 ) return 0;      //   test width\n   if ( stbi__get16be(s) < 1 ) return 0;      //   test height\n   sz = stbi__get8(s);   //   bits per pixel\n   if ( (sz != 8) && (sz != 16) && (sz != 24) && (sz != 32) )\n      res = 0;\n   else\n      res = 1;\n   stbi__rewind(s);\n   return res;\n}\n\nstatic stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   //   read in the TGA header stuff\n   int tga_offset = stbi__get8(s);\n   int tga_indexed = stbi__get8(s);\n   int tga_image_type = stbi__get8(s);\n   int tga_is_RLE = 0;\n   int tga_palette_start = stbi__get16le(s);\n   int tga_palette_len = stbi__get16le(s);\n   int tga_palette_bits = stbi__get8(s);\n   int tga_x_origin = stbi__get16le(s);\n   int tga_y_origin = stbi__get16le(s);\n   int tga_width = stbi__get16le(s);\n   int tga_height = stbi__get16le(s);\n   int tga_bits_per_pixel = stbi__get8(s);\n   int tga_comp = tga_bits_per_pixel / 8;\n   int tga_inverted = stbi__get8(s);\n   //   image data\n   unsigned char *tga_data;\n   unsigned char *tga_palette = NULL;\n   int i, j;\n   unsigned char raw_data[4];\n   int RLE_count = 0;\n   int RLE_repeating = 0;\n   int read_next_pixel = 1;\n\n   //   do a tiny bit of precessing\n   if ( tga_image_type >= 8 )\n   {\n      tga_image_type -= 8;\n      tga_is_RLE = 1;\n   }\n   /* int tga_alpha_bits = tga_inverted & 15; */\n   tga_inverted = 1 - ((tga_inverted >> 5) & 1);\n\n   //   error check\n   if ( //(tga_indexed) ||\n      (tga_width < 1) || (tga_height < 1) ||\n      (tga_image_type < 1) || (tga_image_type > 3) ||\n      ((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16) &&\n      (tga_bits_per_pixel != 24) && (tga_bits_per_pixel != 32))\n      )\n   {\n      return NULL; // we don't report this as a bad TGA because we don't even know if it's TGA\n   }\n\n   //   If I'm paletted, then I'll use the number of bits from the palette\n   if ( tga_indexed )\n   {\n      tga_comp = tga_palette_bits / 8;\n   }\n\n   //   tga info\n   *x = tga_width;\n   *y = tga_height;\n   if (comp) *comp = tga_comp;\n\n   tga_data = (unsigned char*)stbi__malloc( tga_width * tga_height * tga_comp );\n   if (!tga_data) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n\n   // skip to the data's starting position (offset usually = 0)\n   stbi__skip(s, tga_offset );\n\n   if ( !tga_indexed && !tga_is_RLE) {\n      for (i=0; i < tga_height; ++i) {\n         int y = tga_inverted ? tga_height -i - 1 : i;\n         stbi_uc *tga_row = tga_data + y*tga_width*tga_comp;\n         stbi__getn(s, tga_row, tga_width * tga_comp);\n      }\n   } else  {\n      //   do I need to load a palette?\n      if ( tga_indexed)\n      {\n         //   any data to skip? (offset usually = 0)\n         stbi__skip(s, tga_palette_start );\n         //   load the palette\n         tga_palette = (unsigned char*)stbi__malloc( tga_palette_len * tga_palette_bits / 8 );\n         if (!tga_palette) {\n            STBI_FREE(tga_data);\n            return stbi__errpuc(\"outofmem\", \"Out of memory\");\n         }\n         if (!stbi__getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 )) {\n            STBI_FREE(tga_data);\n            STBI_FREE(tga_palette);\n            return stbi__errpuc(\"bad palette\", \"Corrupt TGA\");\n         }\n      }\n      //   load the data\n      for (i=0; i < tga_width * tga_height; ++i)\n      {\n         //   if I'm in RLE mode, do I need to get a RLE stbi__pngchunk?\n         if ( tga_is_RLE )\n         {\n            if ( RLE_count == 0 )\n            {\n               //   yep, get the next byte as a RLE command\n               int RLE_cmd = stbi__get8(s);\n               RLE_count = 1 + (RLE_cmd & 127);\n               RLE_repeating = RLE_cmd >> 7;\n               read_next_pixel = 1;\n            } else if ( !RLE_repeating )\n            {\n               read_next_pixel = 1;\n            }\n         } else\n         {\n            read_next_pixel = 1;\n         }\n         //   OK, if I need to read a pixel, do it now\n         if ( read_next_pixel )\n         {\n            //   load however much data we did have\n            if ( tga_indexed )\n            {\n               //   read in 1 byte, then perform the lookup\n               int pal_idx = stbi__get8(s);\n               if ( pal_idx >= tga_palette_len )\n               {\n                  //   invalid index\n                  pal_idx = 0;\n               }\n               pal_idx *= tga_bits_per_pixel / 8;\n               for (j = 0; j*8 < tga_bits_per_pixel; ++j)\n               {\n                  raw_data[j] = tga_palette[pal_idx+j];\n               }\n            } else\n            {\n               //   read in the data raw\n               for (j = 0; j*8 < tga_bits_per_pixel; ++j)\n               {\n                  raw_data[j] = stbi__get8(s);\n               }\n            }\n            //   clear the reading flag for the next pixel\n            read_next_pixel = 0;\n         } // end of reading a pixel\n\n         // copy data\n         for (j = 0; j < tga_comp; ++j)\n           tga_data[i*tga_comp+j] = raw_data[j];\n\n         //   in case we're in RLE mode, keep counting down\n         --RLE_count;\n      }\n      //   do I need to invert the image?\n      if ( tga_inverted )\n      {\n         for (j = 0; j*2 < tga_height; ++j)\n         {\n            int index1 = j * tga_width * tga_comp;\n            int index2 = (tga_height - 1 - j) * tga_width * tga_comp;\n            for (i = tga_width * tga_comp; i > 0; --i)\n            {\n               unsigned char temp = tga_data[index1];\n               tga_data[index1] = tga_data[index2];\n               tga_data[index2] = temp;\n               ++index1;\n               ++index2;\n            }\n         }\n      }\n      //   clear my palette, if I had one\n      if ( tga_palette != NULL )\n      {\n         STBI_FREE( tga_palette );\n      }\n   }\n\n   // swap RGB\n   if (tga_comp >= 3)\n   {\n      unsigned char* tga_pixel = tga_data;\n      for (i=0; i < tga_width * tga_height; ++i)\n      {\n         unsigned char temp = tga_pixel[0];\n         tga_pixel[0] = tga_pixel[2];\n         tga_pixel[2] = temp;\n         tga_pixel += tga_comp;\n      }\n   }\n\n   // convert to target component count\n   if (req_comp && req_comp != tga_comp)\n      tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height);\n\n   //   the things I do to get rid of an error message, and yet keep\n   //   Microsoft's C compilers happy... [8^(\n   tga_palette_start = tga_palette_len = tga_palette_bits =\n         tga_x_origin = tga_y_origin = 0;\n   //   OK, done\n   return tga_data;\n}\n#endif\n\n// *************************************************************************************************\n// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB\n\n#ifndef STBI_NO_PSD\nstatic int stbi__psd_test(stbi__context *s)\n{\n   int r = (stbi__get32be(s) == 0x38425053);\n   stbi__rewind(s);\n   return r;\n}\n\nstatic stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   int   pixelCount;\n   int channelCount, compression;\n   int channel, i, count, len;\n   int w,h;\n   stbi_uc *out;\n\n   // Check identifier\n   if (stbi__get32be(s) != 0x38425053)   // \"8BPS\"\n      return stbi__errpuc(\"not PSD\", \"Corrupt PSD image\");\n\n   // Check file type version.\n   if (stbi__get16be(s) != 1)\n      return stbi__errpuc(\"wrong version\", \"Unsupported version of PSD image\");\n\n   // Skip 6 reserved bytes.\n   stbi__skip(s, 6 );\n\n   // Read the number of channels (R, G, B, A, etc).\n   channelCount = stbi__get16be(s);\n   if (channelCount < 0 || channelCount > 16)\n      return stbi__errpuc(\"wrong channel count\", \"Unsupported number of channels in PSD image\");\n\n   // Read the rows and columns of the image.\n   h = stbi__get32be(s);\n   w = stbi__get32be(s);\n\n   // Make sure the depth is 8 bits.\n   if (stbi__get16be(s) != 8)\n      return stbi__errpuc(\"unsupported bit depth\", \"PSD bit depth is not 8 bit\");\n\n   // Make sure the color mode is RGB.\n   // Valid options are:\n   //   0: Bitmap\n   //   1: Grayscale\n   //   2: Indexed color\n   //   3: RGB color\n   //   4: CMYK color\n   //   7: Multichannel\n   //   8: Duotone\n   //   9: Lab color\n   if (stbi__get16be(s) != 3)\n      return stbi__errpuc(\"wrong color format\", \"PSD is not in RGB color format\");\n\n   // Skip the Mode Data.  (It's the palette for indexed color; other info for other modes.)\n   stbi__skip(s,stbi__get32be(s) );\n\n   // Skip the image resources.  (resolution, pen tool paths, etc)\n   stbi__skip(s, stbi__get32be(s) );\n\n   // Skip the reserved data.\n   stbi__skip(s, stbi__get32be(s) );\n\n   // Find out if the data is compressed.\n   // Known values:\n   //   0: no compression\n   //   1: RLE compressed\n   compression = stbi__get16be(s);\n   if (compression > 1)\n      return stbi__errpuc(\"bad compression\", \"PSD has an unknown compression format\");\n\n   // Create the destination image.\n   out = (stbi_uc *) stbi__malloc(4 * w*h);\n   if (!out) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n   pixelCount = w*h;\n\n   // Initialize the data to zero.\n   //memset( out, 0, pixelCount * 4 );\n\n   // Finally, the image data.\n   if (compression) {\n      // RLE as used by .PSD and .TIFF\n      // Loop until you get the number of unpacked bytes you are expecting:\n      //     Read the next source byte into n.\n      //     If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.\n      //     Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.\n      //     Else if n is 128, noop.\n      // Endloop\n\n      // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data,\n      // which we're going to just skip.\n      stbi__skip(s, h * channelCount * 2 );\n\n      // Read the RLE data by channel.\n      for (channel = 0; channel < 4; channel++) {\n         stbi_uc *p;\n\n         p = out+channel;\n         if (channel >= channelCount) {\n            // Fill this channel with default data.\n            for (i = 0; i < pixelCount; i++) *p = (channel == 3 ? 255 : 0), p += 4;\n         } else {\n            // Read the RLE data.\n            count = 0;\n            while (count < pixelCount) {\n               len = stbi__get8(s);\n               if (len == 128) {\n                  // No-op.\n               } else if (len < 128) {\n                  // Copy next len+1 bytes literally.\n                  len++;\n                  count += len;\n                  while (len) {\n                     *p = stbi__get8(s);\n                     p += 4;\n                     len--;\n                  }\n               } else if (len > 128) {\n                  stbi_uc   val;\n                  // Next -len+1 bytes in the dest are replicated from next source byte.\n                  // (Interpret len as a negative 8-bit int.)\n                  len ^= 0x0FF;\n                  len += 2;\n                  val = stbi__get8(s);\n                  count += len;\n                  while (len) {\n                     *p = val;\n                     p += 4;\n                     len--;\n                  }\n               }\n            }\n         }\n      }\n\n   } else {\n      // We're at the raw image data.  It's each channel in order (Red, Green, Blue, Alpha, ...)\n      // where each channel consists of an 8-bit value for each pixel in the image.\n\n      // Read the data by channel.\n      for (channel = 0; channel < 4; channel++) {\n         stbi_uc *p;\n\n         p = out + channel;\n         if (channel > channelCount) {\n            // Fill this channel with default data.\n            for (i = 0; i < pixelCount; i++) *p = channel == 3 ? 255 : 0, p += 4;\n         } else {\n            // Read the data.\n            for (i = 0; i < pixelCount; i++)\n               *p = stbi__get8(s), p += 4;\n         }\n      }\n   }\n\n   if (req_comp && req_comp != 4) {\n      out = stbi__convert_format(out, 4, req_comp, w, h);\n      if (out == NULL) return out; // stbi__convert_format frees input on failure\n   }\n\n   if (comp) *comp = channelCount;\n   *y = h;\n   *x = w;\n\n   return out;\n}\n#endif\n\n// *************************************************************************************************\n// Softimage PIC loader\n// by Tom Seddon\n//\n// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format\n// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/\n\n#ifndef STBI_NO_PIC\nstatic int stbi__pic_is4(stbi__context *s,const char *str)\n{\n   int i;\n   for (i=0; i<4; ++i)\n      if (stbi__get8(s) != (stbi_uc)str[i])\n         return 0;\n\n   return 1;\n}\n\nstatic int stbi__pic_test_core(stbi__context *s)\n{\n   int i;\n\n   if (!stbi__pic_is4(s,\"\\x53\\x80\\xF6\\x34\"))\n      return 0;\n\n   for(i=0;i<84;++i)\n      stbi__get8(s);\n\n   if (!stbi__pic_is4(s,\"PICT\"))\n      return 0;\n\n   return 1;\n}\n\ntypedef struct\n{\n   stbi_uc size,type,channel;\n} stbi__pic_packet;\n\nstatic stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest)\n{\n   int mask=0x80, i;\n\n   for (i=0; i<4; ++i, mask>>=1) {\n      if (channel & mask) {\n         if (stbi__at_eof(s)) return stbi__errpuc(\"bad file\",\"PIC file too short\");\n         dest[i]=stbi__get8(s);\n      }\n   }\n\n   return dest;\n}\n\nstatic void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src)\n{\n   int mask=0x80,i;\n\n   for (i=0;i<4; ++i, mask>>=1)\n      if (channel&mask)\n         dest[i]=src[i];\n}\n\nstatic stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result)\n{\n   int act_comp=0,num_packets=0,y,chained;\n   stbi__pic_packet packets[10];\n\n   // this will (should...) cater for even some bizarre stuff like having data\n    // for the same channel in multiple packets.\n   do {\n      stbi__pic_packet *packet;\n\n      if (num_packets==sizeof(packets)/sizeof(packets[0]))\n         return stbi__errpuc(\"bad format\",\"too many packets\");\n\n      packet = &packets[num_packets++];\n\n      chained = stbi__get8(s);\n      packet->size    = stbi__get8(s);\n      packet->type    = stbi__get8(s);\n      packet->channel = stbi__get8(s);\n\n      act_comp |= packet->channel;\n\n      if (stbi__at_eof(s))          return stbi__errpuc(\"bad file\",\"file too short (reading packets)\");\n      if (packet->size != 8)  return stbi__errpuc(\"bad format\",\"packet isn't 8bpp\");\n   } while (chained);\n\n   *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?\n\n   for(y=0; y<height; ++y) {\n      int packet_idx;\n\n      for(packet_idx=0; packet_idx < num_packets; ++packet_idx) {\n         stbi__pic_packet *packet = &packets[packet_idx];\n         stbi_uc *dest = result+y*width*4;\n\n         switch (packet->type) {\n            default:\n               return stbi__errpuc(\"bad format\",\"packet has bad compression type\");\n\n            case 0: {//uncompressed\n               int x;\n\n               for(x=0;x<width;++x, dest+=4)\n                  if (!stbi__readval(s,packet->channel,dest))\n                     return 0;\n               break;\n            }\n\n            case 1://Pure RLE\n               {\n                  int left=width, i;\n\n                  while (left>0) {\n                     stbi_uc count,value[4];\n\n                     count=stbi__get8(s);\n                     if (stbi__at_eof(s))   return stbi__errpuc(\"bad file\",\"file too short (pure read count)\");\n\n                     if (count > left)\n                        count = (stbi_uc) left;\n\n                     if (!stbi__readval(s,packet->channel,value))  return 0;\n\n                     for(i=0; i<count; ++i,dest+=4)\n                        stbi__copyval(packet->channel,dest,value);\n                     left -= count;\n                  }\n               }\n               break;\n\n            case 2: {//Mixed RLE\n               int left=width;\n               while (left>0) {\n                  int count = stbi__get8(s), i;\n                  if (stbi__at_eof(s))  return stbi__errpuc(\"bad file\",\"file too short (mixed read count)\");\n\n                  if (count >= 128) { // Repeated\n                     stbi_uc value[4];\n                     int i;\n\n                     if (count==128)\n                        count = stbi__get16be(s);\n                     else\n                        count -= 127;\n                     if (count > left)\n                        return stbi__errpuc(\"bad file\",\"scanline overrun\");\n\n                     if (!stbi__readval(s,packet->channel,value))\n                        return 0;\n\n                     for(i=0;i<count;++i, dest += 4)\n                        stbi__copyval(packet->channel,dest,value);\n                  } else { // Raw\n                     ++count;\n                     if (count>left) return stbi__errpuc(\"bad file\",\"scanline overrun\");\n\n                     for(i=0;i<count;++i, dest+=4)\n                        if (!stbi__readval(s,packet->channel,dest))\n                           return 0;\n                  }\n                  left-=count;\n               }\n               break;\n            }\n         }\n      }\n   }\n\n   return result;\n}\n\nstatic stbi_uc *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp)\n{\n   stbi_uc *result;\n   int i, x,y;\n\n   for (i=0; i<92; ++i)\n      stbi__get8(s);\n\n   x = stbi__get16be(s);\n   y = stbi__get16be(s);\n   if (stbi__at_eof(s))  return stbi__errpuc(\"bad file\",\"file too short (pic header)\");\n   if ((1 << 28) / x < y) return stbi__errpuc(\"too large\", \"Image too large to decode\");\n\n   stbi__get32be(s); //skip `ratio'\n   stbi__get16be(s); //skip `fields'\n   stbi__get16be(s); //skip `pad'\n\n   // intermediate buffer is RGBA\n   result = (stbi_uc *) stbi__malloc(x*y*4);\n   memset(result, 0xff, x*y*4);\n\n   if (!stbi__pic_load_core(s,x,y,comp, result)) {\n      STBI_FREE(result);\n      result=0;\n   }\n   *px = x;\n   *py = y;\n   if (req_comp == 0) req_comp = *comp;\n   result=stbi__convert_format(result,4,req_comp,x,y);\n\n   return result;\n}\n\nstatic int stbi__pic_test(stbi__context *s)\n{\n   int r = stbi__pic_test_core(s);\n   stbi__rewind(s);\n   return r;\n}\n#endif\n\n// *************************************************************************************************\n// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb\n\n#ifndef STBI_NO_GIF\ntypedef struct\n{\n   stbi__int16 prefix;\n   stbi_uc first;\n   stbi_uc suffix;\n} stbi__gif_lzw;\n\ntypedef struct\n{\n   int w,h;\n   stbi_uc *out;                 // output buffer (always 4 components)\n   int flags, bgindex, ratio, transparent, eflags;\n   stbi_uc  pal[256][4];\n   stbi_uc lpal[256][4];\n   stbi__gif_lzw codes[4096];\n   stbi_uc *color_table;\n   int parse, step;\n   int lflags;\n   int start_x, start_y;\n   int max_x, max_y;\n   int cur_x, cur_y;\n   int line_size;\n} stbi__gif;\n\nstatic int stbi__gif_test_raw(stbi__context *s)\n{\n   int sz;\n   if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0;\n   sz = stbi__get8(s);\n   if (sz != '9' && sz != '7') return 0;\n   if (stbi__get8(s) != 'a') return 0;\n   return 1;\n}\n\nstatic int stbi__gif_test(stbi__context *s)\n{\n   int r = stbi__gif_test_raw(s);\n   stbi__rewind(s);\n   return r;\n}\n\nstatic void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp)\n{\n   int i;\n   for (i=0; i < num_entries; ++i) {\n      pal[i][2] = stbi__get8(s);\n      pal[i][1] = stbi__get8(s);\n      pal[i][0] = stbi__get8(s);\n      pal[i][3] = transp == i ? 0 : 255;\n   }\n}\n\nstatic int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info)\n{\n   stbi_uc version;\n   if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8')\n      return stbi__err(\"not GIF\", \"Corrupt GIF\");\n\n   version = stbi__get8(s);\n   if (version != '7' && version != '9')    return stbi__err(\"not GIF\", \"Corrupt GIF\");\n   if (stbi__get8(s) != 'a')                return stbi__err(\"not GIF\", \"Corrupt GIF\");\n\n   stbi__g_failure_reason = \"\";\n   g->w = stbi__get16le(s);\n   g->h = stbi__get16le(s);\n   g->flags = stbi__get8(s);\n   g->bgindex = stbi__get8(s);\n   g->ratio = stbi__get8(s);\n   g->transparent = -1;\n\n   if (comp != 0) *comp = 4;  // can't actually tell whether it's 3 or 4 until we parse the comments\n\n   if (is_info) return 1;\n\n   if (g->flags & 0x80)\n      stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);\n\n   return 1;\n}\n\nstatic int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp)\n{\n   stbi__gif g;\n   if (!stbi__gif_header(s, &g, comp, 1)) {\n      stbi__rewind( s );\n      return 0;\n   }\n   if (x) *x = g.w;\n   if (y) *y = g.h;\n   return 1;\n}\n\nstatic void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)\n{\n   stbi_uc *p, *c;\n\n   // recurse to decode the prefixes, since the linked-list is backwards,\n   // and working backwards through an interleaved image would be nasty\n   if (g->codes[code].prefix >= 0)\n      stbi__out_gif_code(g, g->codes[code].prefix);\n\n   if (g->cur_y >= g->max_y) return;\n\n   p = &g->out[g->cur_x + g->cur_y];\n   c = &g->color_table[g->codes[code].suffix * 4];\n\n   if (c[3] >= 128) {\n      p[0] = c[2];\n      p[1] = c[1];\n      p[2] = c[0];\n      p[3] = c[3];\n   }\n   g->cur_x += 4;\n\n   if (g->cur_x >= g->max_x) {\n      g->cur_x = g->start_x;\n      g->cur_y += g->step;\n\n      while (g->cur_y >= g->max_y && g->parse > 0) {\n         g->step = (1 << g->parse) * g->line_size;\n         g->cur_y = g->start_y + (g->step >> 1);\n         --g->parse;\n      }\n   }\n}\n\nstatic stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)\n{\n   stbi_uc lzw_cs;\n   stbi__int32 len, code;\n   stbi__uint32 first;\n   stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;\n   stbi__gif_lzw *p;\n\n   lzw_cs = stbi__get8(s);\n   clear = 1 << lzw_cs;\n   first = 1;\n   codesize = lzw_cs + 1;\n   codemask = (1 << codesize) - 1;\n   bits = 0;\n   valid_bits = 0;\n   for (code = 0; code < clear; code++) {\n      g->codes[code].prefix = -1;\n      g->codes[code].first = (stbi_uc) code;\n      g->codes[code].suffix = (stbi_uc) code;\n   }\n\n   // support no starting clear code\n   avail = clear+2;\n   oldcode = -1;\n\n   len = 0;\n   for(;;) {\n      if (valid_bits < codesize) {\n         if (len == 0) {\n            len = stbi__get8(s); // start new block\n            if (len == 0)\n               return g->out;\n         }\n         --len;\n         bits |= (stbi__int32) stbi__get8(s) << valid_bits;\n         valid_bits += 8;\n      } else {\n         stbi__int32 code = bits & codemask;\n         bits >>= codesize;\n         valid_bits -= codesize;\n         // @OPTIMIZE: is there some way we can accelerate the non-clear path?\n         if (code == clear) {  // clear code\n            codesize = lzw_cs + 1;\n            codemask = (1 << codesize) - 1;\n            avail = clear + 2;\n            oldcode = -1;\n            first = 0;\n         } else if (code == clear + 1) { // end of stream code\n            stbi__skip(s, len);\n            while ((len = stbi__get8(s)) > 0)\n               stbi__skip(s,len);\n            return g->out;\n         } else if (code <= avail) {\n            if (first) return stbi__errpuc(\"no clear code\", \"Corrupt GIF\");\n\n            if (oldcode >= 0) {\n               p = &g->codes[avail++];\n               if (avail > 4096)        return stbi__errpuc(\"too many codes\", \"Corrupt GIF\");\n               p->prefix = (stbi__int16) oldcode;\n               p->first = g->codes[oldcode].first;\n               p->suffix = (code == avail) ? p->first : g->codes[code].first;\n            } else if (code == avail)\n               return stbi__errpuc(\"illegal code in raster\", \"Corrupt GIF\");\n\n            stbi__out_gif_code(g, (stbi__uint16) code);\n\n            if ((avail & codemask) == 0 && avail <= 0x0FFF) {\n               codesize++;\n               codemask = (1 << codesize) - 1;\n            }\n\n            oldcode = code;\n         } else {\n            return stbi__errpuc(\"illegal code in raster\", \"Corrupt GIF\");\n         }\n      }\n   }\n}\n\nstatic void stbi__fill_gif_background(stbi__gif *g)\n{\n   int i;\n   stbi_uc *c = g->pal[g->bgindex];\n   // @OPTIMIZE: write a dword at a time\n   for (i = 0; i < g->w * g->h * 4; i += 4) {\n      stbi_uc *p  = &g->out[i];\n      p[0] = c[2];\n      p[1] = c[1];\n      p[2] = c[0];\n      p[3] = c[3];\n   }\n}\n\n// this function is designed to support animated gifs, although stb_image doesn't support it\nstatic stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp)\n{\n   int i;\n   stbi_uc *old_out = 0;\n\n   if (g->out == 0) {\n      if (!stbi__gif_header(s, g, comp,0))     return 0; // stbi__g_failure_reason set by stbi__gif_header\n      g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h);\n      if (g->out == 0)                      return stbi__errpuc(\"outofmem\", \"Out of memory\");\n      stbi__fill_gif_background(g);\n   } else {\n      // animated-gif-only path\n      if (((g->eflags & 0x1C) >> 2) == 3) {\n         old_out = g->out;\n         g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h);\n         if (g->out == 0)                   return stbi__errpuc(\"outofmem\", \"Out of memory\");\n         memcpy(g->out, old_out, g->w*g->h*4);\n      }\n   }\n\n   for (;;) {\n      switch (stbi__get8(s)) {\n         case 0x2C: /* Image Descriptor */\n         {\n            stbi__int32 x, y, w, h;\n            stbi_uc *o;\n\n            x = stbi__get16le(s);\n            y = stbi__get16le(s);\n            w = stbi__get16le(s);\n            h = stbi__get16le(s);\n            if (((x + w) > (g->w)) || ((y + h) > (g->h)))\n               return stbi__errpuc(\"bad Image Descriptor\", \"Corrupt GIF\");\n\n            g->line_size = g->w * 4;\n            g->start_x = x * 4;\n            g->start_y = y * g->line_size;\n            g->max_x   = g->start_x + w * 4;\n            g->max_y   = g->start_y + h * g->line_size;\n            g->cur_x   = g->start_x;\n            g->cur_y   = g->start_y;\n\n            g->lflags = stbi__get8(s);\n\n            if (g->lflags & 0x40) {\n               g->step = 8 * g->line_size; // first interlaced spacing\n               g->parse = 3;\n            } else {\n               g->step = g->line_size;\n               g->parse = 0;\n            }\n\n            if (g->lflags & 0x80) {\n               stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);\n               g->color_table = (stbi_uc *) g->lpal;\n            } else if (g->flags & 0x80) {\n               for (i=0; i < 256; ++i)  // @OPTIMIZE: stbi__jpeg_reset only the previous transparent\n                  g->pal[i][3] = 255;\n               if (g->transparent >= 0 && (g->eflags & 0x01))\n                  g->pal[g->transparent][3] = 0;\n               g->color_table = (stbi_uc *) g->pal;\n            } else\n               return stbi__errpuc(\"missing color table\", \"Corrupt GIF\");\n\n            o = stbi__process_gif_raster(s, g);\n            if (o == NULL) return NULL;\n\n            if (req_comp && req_comp != 4)\n               o = stbi__convert_format(o, 4, req_comp, g->w, g->h);\n            return o;\n         }\n\n         case 0x21: // Comment Extension.\n         {\n            int len;\n            if (stbi__get8(s) == 0xF9) { // Graphic Control Extension.\n               len = stbi__get8(s);\n               if (len == 4) {\n                  g->eflags = stbi__get8(s);\n                  stbi__get16le(s); // delay\n                  g->transparent = stbi__get8(s);\n               } else {\n                  stbi__skip(s, len);\n                  break;\n               }\n            }\n            while ((len = stbi__get8(s)) != 0)\n               stbi__skip(s, len);\n            break;\n         }\n\n         case 0x3B: // gif stream termination code\n            return (stbi_uc *) s; // using '1' causes warning on some compilers\n\n         default:\n            return stbi__errpuc(\"unknown code\", \"Corrupt GIF\");\n      }\n   }\n}\n\nstatic stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   stbi_uc *u = 0;\n   stbi__gif g;\n   memset(&g, 0, sizeof(g));\n\n   u = stbi__gif_load_next(s, &g, comp, req_comp);\n   if (u == (stbi_uc *) s) u = 0;  // end of animated gif marker\n   if (u) {\n      *x = g.w;\n      *y = g.h;\n   }\n\n   return u;\n}\n\nstatic int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)\n{\n   return stbi__gif_info_raw(s,x,y,comp);\n}\n#endif\n\n// *************************************************************************************************\n// Radiance RGBE HDR loader\n// originally by Nicolas Schulz\n#ifndef STBI_NO_HDR\nstatic int stbi__hdr_test_core(stbi__context *s)\n{\n   const char *signature = \"#?RADIANCE\\n\";\n   int i;\n   for (i=0; signature[i]; ++i)\n      if (stbi__get8(s) != signature[i])\n         return 0;\n   return 1;\n}\n\nstatic int stbi__hdr_test(stbi__context* s)\n{\n   int r = stbi__hdr_test_core(s);\n   stbi__rewind(s);\n   return r;\n}\n\n#define STBI__HDR_BUFLEN  1024\nstatic char *stbi__hdr_gettoken(stbi__context *z, char *buffer)\n{\n   int len=0;\n   char c = '\\0';\n\n   c = (char) stbi__get8(z);\n\n   while (!stbi__at_eof(z) && c != '\\n') {\n      buffer[len++] = c;\n      if (len == STBI__HDR_BUFLEN-1) {\n         // flush to end of line\n         while (!stbi__at_eof(z) && stbi__get8(z) != '\\n')\n            ;\n         break;\n      }\n      c = (char) stbi__get8(z);\n   }\n\n   buffer[len] = 0;\n   return buffer;\n}\n\nstatic void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)\n{\n   if ( input[3] != 0 ) {\n      float f1;\n      // Exponent\n      f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));\n      if (req_comp <= 2)\n         output[0] = (input[0] + input[1] + input[2]) * f1 / 3;\n      else {\n         output[0] = input[0] * f1;\n         output[1] = input[1] * f1;\n         output[2] = input[2] * f1;\n      }\n      if (req_comp == 2) output[1] = 1;\n      if (req_comp == 4) output[3] = 1;\n   } else {\n      switch (req_comp) {\n         case 4: output[3] = 1; /* fallthrough */\n         case 3: output[0] = output[1] = output[2] = 0;\n                 break;\n         case 2: output[1] = 1; /* fallthrough */\n         case 1: output[0] = 0;\n                 break;\n      }\n   }\n}\n\nstatic float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   char buffer[STBI__HDR_BUFLEN];\n   char *token;\n   int valid = 0;\n   int width, height;\n   stbi_uc *scanline;\n   float *hdr_data;\n   int len;\n   unsigned char count, value;\n   int i, j, k, c1,c2, z;\n\n\n   // Check identifier\n   if (strcmp(stbi__hdr_gettoken(s,buffer), \"#?RADIANCE\") != 0)\n      return stbi__errpf(\"not HDR\", \"Corrupt HDR image\");\n\n   // Parse header\n   for(;;) {\n      token = stbi__hdr_gettoken(s,buffer);\n      if (token[0] == 0) break;\n      if (strcmp(token, \"FORMAT=32-bit_rle_rgbe\") == 0) valid = 1;\n   }\n\n   if (!valid)    return stbi__errpf(\"unsupported format\", \"Unsupported HDR format\");\n\n   // Parse width and height\n   // can't use sscanf() if we're not using stdio!\n   token = stbi__hdr_gettoken(s,buffer);\n   if (strncmp(token, \"-Y \", 3))  return stbi__errpf(\"unsupported data layout\", \"Unsupported HDR format\");\n   token += 3;\n   height = (int) strtol(token, &token, 10);\n   while (*token == ' ') ++token;\n   if (strncmp(token, \"+X \", 3))  return stbi__errpf(\"unsupported data layout\", \"Unsupported HDR format\");\n   token += 3;\n   width = (int) strtol(token, NULL, 10);\n\n   *x = width;\n   *y = height;\n\n   if (comp) *comp = 3;\n   if (req_comp == 0) req_comp = 3;\n\n   // Read data\n   hdr_data = (float *) stbi__malloc(height * width * req_comp * sizeof(float));\n\n   // Load image data\n   // image data is stored as some number of sca\n   if ( width < 8 || width >= 32768) {\n      // Read flat data\n      for (j=0; j < height; ++j) {\n         for (i=0; i < width; ++i) {\n            stbi_uc rgbe[4];\n           main_decode_loop:\n            stbi__getn(s, rgbe, 4);\n            stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp);\n         }\n      }\n   } else {\n      // Read RLE-encoded data\n      scanline = NULL;\n\n      for (j = 0; j < height; ++j) {\n         c1 = stbi__get8(s);\n         c2 = stbi__get8(s);\n         len = stbi__get8(s);\n         if (c1 != 2 || c2 != 2 || (len & 0x80)) {\n            // not run-length encoded, so we have to actually use THIS data as a decoded\n            // pixel (note this can't be a valid pixel--one of RGB must be >= 128)\n            stbi_uc rgbe[4];\n            rgbe[0] = (stbi_uc) c1;\n            rgbe[1] = (stbi_uc) c2;\n            rgbe[2] = (stbi_uc) len;\n            rgbe[3] = (stbi_uc) stbi__get8(s);\n            stbi__hdr_convert(hdr_data, rgbe, req_comp);\n            i = 1;\n            j = 0;\n            STBI_FREE(scanline);\n            goto main_decode_loop; // yes, this makes no sense\n         }\n         len <<= 8;\n         len |= stbi__get8(s);\n         if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf(\"invalid decoded scanline length\", \"corrupt HDR\"); }\n         if (scanline == NULL) scanline = (stbi_uc *) stbi__malloc(width * 4);\n\n         for (k = 0; k < 4; ++k) {\n            i = 0;\n            while (i < width) {\n               count = stbi__get8(s);\n               if (count > 128) {\n                  // Run\n                  value = stbi__get8(s);\n                  count -= 128;\n                  for (z = 0; z < count; ++z)\n                     scanline[i++ * 4 + k] = value;\n               } else {\n                  // Dump\n                  for (z = 0; z < count; ++z)\n                     scanline[i++ * 4 + k] = stbi__get8(s);\n               }\n            }\n         }\n         for (i=0; i < width; ++i)\n            stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);\n      }\n      STBI_FREE(scanline);\n   }\n\n   return hdr_data;\n}\n\nstatic int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)\n{\n   char buffer[STBI__HDR_BUFLEN];\n   char *token;\n   int valid = 0;\n\n   if (strcmp(stbi__hdr_gettoken(s,buffer), \"#?RADIANCE\") != 0) {\n       stbi__rewind( s );\n       return 0;\n   }\n\n   for(;;) {\n      token = stbi__hdr_gettoken(s,buffer);\n      if (token[0] == 0) break;\n      if (strcmp(token, \"FORMAT=32-bit_rle_rgbe\") == 0) valid = 1;\n   }\n\n   if (!valid) {\n       stbi__rewind( s );\n       return 0;\n   }\n   token = stbi__hdr_gettoken(s,buffer);\n   if (strncmp(token, \"-Y \", 3)) {\n       stbi__rewind( s );\n       return 0;\n   }\n   token += 3;\n   *y = (int) strtol(token, &token, 10);\n   while (*token == ' ') ++token;\n   if (strncmp(token, \"+X \", 3)) {\n       stbi__rewind( s );\n       return 0;\n   }\n   token += 3;\n   *x = (int) strtol(token, NULL, 10);\n   *comp = 3;\n   return 1;\n}\n#endif // STBI_NO_HDR\n\n#ifndef STBI_NO_BMP\nstatic int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)\n{\n   int hsz;\n   if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') {\n       stbi__rewind( s );\n       return 0;\n   }\n   stbi__skip(s,12);\n   hsz = stbi__get32le(s);\n   if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) {\n       stbi__rewind( s );\n       return 0;\n   }\n   if (hsz == 12) {\n      *x = stbi__get16le(s);\n      *y = stbi__get16le(s);\n   } else {\n      *x = stbi__get32le(s);\n      *y = stbi__get32le(s);\n   }\n   if (stbi__get16le(s) != 1) {\n       stbi__rewind( s );\n       return 0;\n   }\n   *comp = stbi__get16le(s) / 8;\n   return 1;\n}\n#endif\n\n#ifndef STBI_NO_PSD\nstatic int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)\n{\n   int channelCount;\n   if (stbi__get32be(s) != 0x38425053) {\n       stbi__rewind( s );\n       return 0;\n   }\n   if (stbi__get16be(s) != 1) {\n       stbi__rewind( s );\n       return 0;\n   }\n   stbi__skip(s, 6);\n   channelCount = stbi__get16be(s);\n   if (channelCount < 0 || channelCount > 16) {\n       stbi__rewind( s );\n       return 0;\n   }\n   *y = stbi__get32be(s);\n   *x = stbi__get32be(s);\n   if (stbi__get16be(s) != 8) {\n       stbi__rewind( s );\n       return 0;\n   }\n   if (stbi__get16be(s) != 3) {\n       stbi__rewind( s );\n       return 0;\n   }\n   *comp = 4;\n   return 1;\n}\n#endif\n\n#ifndef STBI_NO_PIC\nstatic int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)\n{\n   int act_comp=0,num_packets=0,chained;\n   stbi__pic_packet packets[10];\n\n   stbi__skip(s, 92);\n\n   *x = stbi__get16be(s);\n   *y = stbi__get16be(s);\n   if (stbi__at_eof(s))  return 0;\n   if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) {\n       stbi__rewind( s );\n       return 0;\n   }\n\n   stbi__skip(s, 8);\n\n   do {\n      stbi__pic_packet *packet;\n\n      if (num_packets==sizeof(packets)/sizeof(packets[0]))\n         return 0;\n\n      packet = &packets[num_packets++];\n      chained = stbi__get8(s);\n      packet->size    = stbi__get8(s);\n      packet->type    = stbi__get8(s);\n      packet->channel = stbi__get8(s);\n      act_comp |= packet->channel;\n\n      if (stbi__at_eof(s)) {\n          stbi__rewind( s );\n          return 0;\n      }\n      if (packet->size != 8) {\n          stbi__rewind( s );\n          return 0;\n      }\n   } while (chained);\n\n   *comp = (act_comp & 0x10 ? 4 : 3);\n\n   return 1;\n}\n#endif\n\n// *************************************************************************************************\n// Portable Gray Map and Portable Pixel Map loader\n// by Ken Miller\n//\n// PGM: http://netpbm.sourceforge.net/doc/pgm.html\n// PPM: http://netpbm.sourceforge.net/doc/ppm.html\n//\n// Known limitations:\n//    Does not support comments in the header section\n//    Does not support ASCII image data (formats P2 and P3)\n//    Does not support 16-bit-per-channel\n\n#ifndef STBI_NO_PNM\n\nstatic int      stbi__pnm_test(stbi__context *s)\n{\n   char p, t;\n   p = (char) stbi__get8(s);\n   t = (char) stbi__get8(s);\n   if (p != 'P' || (t != '5' && t != '6')) {\n       stbi__rewind( s );\n       return 0;\n   }\n   return 1;\n}\n\nstatic stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n   stbi_uc *out;\n   if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n))\n      return 0;\n   *x = s->img_x;\n   *y = s->img_y;\n   *comp = s->img_n;\n\n   out = (stbi_uc *) stbi__malloc(s->img_n * s->img_x * s->img_y);\n   if (!out) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n   stbi__getn(s, out, s->img_n * s->img_x * s->img_y);\n\n   if (req_comp && req_comp != s->img_n) {\n      out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);\n      if (out == NULL) return out; // stbi__convert_format frees input on failure\n   }\n   return out;\n}\n\nstatic int      stbi__pnm_isspace(char c)\n{\n   return c == ' ' || c == '\\t' || c == '\\n' || c == '\\v' || c == '\\f' || c == '\\r';\n}\n\nstatic void     stbi__pnm_skip_whitespace(stbi__context *s, char *c)\n{\n   while (!stbi__at_eof(s) && stbi__pnm_isspace(*c))\n      *c = (char) stbi__get8(s);\n}\n\nstatic int      stbi__pnm_isdigit(char c)\n{\n   return c >= '0' && c <= '9';\n}\n\nstatic int      stbi__pnm_getinteger(stbi__context *s, char *c)\n{\n   int value = 0;\n\n   while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {\n      value = value*10 + (*c - '0');\n      *c = (char) stbi__get8(s);\n   }\n\n   return value;\n}\n\nstatic int      stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)\n{\n   int maxv;\n   char c, p, t;\n\n   stbi__rewind( s );\n\n   // Get identifier\n   p = (char) stbi__get8(s);\n   t = (char) stbi__get8(s);\n   if (p != 'P' || (t != '5' && t != '6')) {\n       stbi__rewind( s );\n       return 0;\n   }\n\n   *comp = (t == '6') ? 3 : 1;  // '5' is 1-component .pgm; '6' is 3-component .ppm\n\n   c = (char) stbi__get8(s);\n   stbi__pnm_skip_whitespace(s, &c);\n\n   *x = stbi__pnm_getinteger(s, &c); // read width\n   stbi__pnm_skip_whitespace(s, &c);\n\n   *y = stbi__pnm_getinteger(s, &c); // read height\n   stbi__pnm_skip_whitespace(s, &c);\n\n   maxv = stbi__pnm_getinteger(s, &c);  // read max value\n\n   if (maxv > 255)\n      return stbi__err(\"max value > 255\", \"PPM image not 8-bit\");\n   else\n      return 1;\n}\n#endif\n\nstatic int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)\n{\n   #ifndef STBI_NO_JPEG\n   if (stbi__jpeg_info(s, x, y, comp)) return 1;\n   #endif\n\n   #ifndef STBI_NO_PNG\n   if (stbi__png_info(s, x, y, comp))  return 1;\n   #endif\n\n   #ifndef STBI_NO_GIF\n   if (stbi__gif_info(s, x, y, comp))  return 1;\n   #endif\n\n   #ifndef STBI_NO_BMP\n   if (stbi__bmp_info(s, x, y, comp))  return 1;\n   #endif\n\n   #ifndef STBI_NO_PSD\n   if (stbi__psd_info(s, x, y, comp))  return 1;\n   #endif\n\n   #ifndef STBI_NO_PIC\n   if (stbi__pic_info(s, x, y, comp))  return 1;\n   #endif\n\n   #ifndef STBI_NO_PNM\n   if (stbi__pnm_info(s, x, y, comp))  return 1;\n   #endif\n\n   #ifndef STBI_NO_HDR\n   if (stbi__hdr_info(s, x, y, comp))  return 1;\n   #endif\n\n   // test tga last because it's a crappy test!\n   #ifndef STBI_NO_TGA\n   if (stbi__tga_info(s, x, y, comp))\n       return 1;\n   #endif\n   return stbi__err(\"unknown image type\", \"Image not of any known type, or corrupt\");\n}\n\n#ifndef STBI_NO_STDIO\nSTBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)\n{\n    FILE *f = stbi__fopen(filename, \"rb\");\n    int result;\n    if (!f) return stbi__err(\"can't fopen\", \"Unable to open file\");\n    result = stbi_info_from_file(f, x, y, comp);\n    fclose(f);\n    return result;\n}\n\nSTBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)\n{\n   int r;\n   stbi__context s;\n   long pos = ftell(f);\n   stbi__start_file(&s, f);\n   r = stbi__info_main(&s,x,y,comp);\n   fseek(f,pos,SEEK_SET);\n   return r;\n}\n#endif // !STBI_NO_STDIO\n\nSTBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)\n{\n   stbi__context s;\n   stbi__start_mem(&s,buffer,len);\n   return stbi__info_main(&s,x,y,comp);\n}\n\nSTBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp)\n{\n   stbi__context s;\n   stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user);\n   return stbi__info_main(&s,x,y,comp);\n}\n\n#endif // STB_IMAGE_IMPLEMENTATION\n\n/*\n   revision history:\n      2.02  (2015-01-19) fix incorrect assert, fix warning\n      2.01  (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2\n      2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG\n      2.00  (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg)\n                         progressive JPEG (stb)\n                         PGM/PPM support (Ken Miller)\n                         STBI_MALLOC,STBI_REALLOC,STBI_FREE\n                         GIF bugfix -- seemingly never worked\n                         STBI_NO_*, STBI_ONLY_*\n      1.48  (2014-12-14) fix incorrectly-named assert()\n      1.47  (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)\n                         optimize PNG (ryg)\n                         fix bug in interlaced PNG with user-specified channel count (stb)\n      1.46  (2014-08-26)\n              fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG\n      1.45  (2014-08-16)\n              fix MSVC-ARM internal compiler error by wrapping malloc\n      1.44  (2014-08-07)\n              various warning fixes from Ronny Chevalier\n      1.43  (2014-07-15)\n              fix MSVC-only compiler problem in code changed in 1.42\n      1.42  (2014-07-09)\n              don't define _CRT_SECURE_NO_WARNINGS (affects user code)\n              fixes to stbi__cleanup_jpeg path\n              added STBI_ASSERT to avoid requiring assert.h\n      1.41  (2014-06-25)\n              fix search&replace from 1.36 that messed up comments/error messages\n      1.40  (2014-06-22)\n              fix gcc struct-initialization warning\n      1.39  (2014-06-15)\n              fix to TGA optimization when req_comp != number of components in TGA;\n              fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite)\n              add support for BMP version 5 (more ignored fields)\n      1.38  (2014-06-06)\n              suppress MSVC warnings on integer casts truncating values\n              fix accidental rename of 'skip' field of I/O\n      1.37  (2014-06-04)\n              remove duplicate typedef\n      1.36  (2014-06-03)\n              convert to header file single-file library\n              if de-iphone isn't set, load iphone images color-swapped instead of returning NULL\n      1.35  (2014-05-27)\n              various warnings\n              fix broken STBI_SIMD path\n              fix bug where stbi_load_from_file no longer left file pointer in correct place\n              fix broken non-easy path for 32-bit BMP (possibly never used)\n              TGA optimization by Arseny Kapoulkine\n      1.34  (unknown)\n              use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case\n      1.33  (2011-07-14)\n              make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements\n      1.32  (2011-07-13)\n              support for \"info\" function for all supported filetypes (SpartanJ)\n      1.31  (2011-06-20)\n              a few more leak fixes, bug in PNG handling (SpartanJ)\n      1.30  (2011-06-11)\n              added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)\n              removed deprecated format-specific test/load functions\n              removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway\n              error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)\n              fix inefficiency in decoding 32-bit BMP (David Woo)\n      1.29  (2010-08-16)\n              various warning fixes from Aurelien Pocheville\n      1.28  (2010-08-01)\n              fix bug in GIF palette transparency (SpartanJ)\n      1.27  (2010-08-01)\n              cast-to-stbi_uc to fix warnings\n      1.26  (2010-07-24)\n              fix bug in file buffering for PNG reported by SpartanJ\n      1.25  (2010-07-17)\n              refix trans_data warning (Won Chun)\n      1.24  (2010-07-12)\n              perf improvements reading from files on platforms with lock-heavy fgetc()\n              minor perf improvements for jpeg\n              deprecated type-specific functions so we'll get feedback if they're needed\n              attempt to fix trans_data warning (Won Chun)\n      1.23    fixed bug in iPhone support\n      1.22  (2010-07-10)\n              removed image *writing* support\n              stbi_info support from Jetro Lauha\n              GIF support from Jean-Marc Lienher\n              iPhone PNG-extensions from James Brown\n              warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)\n      1.21    fix use of 'stbi_uc' in header (reported by jon blow)\n      1.20    added support for Softimage PIC, by Tom Seddon\n      1.19    bug in interlaced PNG corruption check (found by ryg)\n      1.18 2008-08-02\n              fix a threading bug (local mutable static)\n      1.17    support interlaced PNG\n      1.16    major bugfix - stbi__convert_format converted one too many pixels\n      1.15    initialize some fields for thread safety\n      1.14    fix threadsafe conversion bug\n              header-file-only version (#define STBI_HEADER_FILE_ONLY before including)\n      1.13    threadsafe\n      1.12    const qualifiers in the API\n      1.11    Support installable IDCT, colorspace conversion routines\n      1.10    Fixes for 64-bit (don't use \"unsigned long\")\n              optimized upsampling by Fabian \"ryg\" Giesen\n      1.09    Fix format-conversion for PSD code (bad global variables!)\n      1.08    Thatcher Ulrich's PSD code integrated by Nicolas Schulz\n      1.07    attempt to fix C++ warning/errors again\n      1.06    attempt to fix C++ warning/errors again\n      1.05    fix TGA loading to return correct *comp and use good luminance calc\n      1.04    default float alpha is 1, not 255; use 'void *' for stbi_image_free\n      1.03    bugfixes to STBI_NO_STDIO, STBI_NO_HDR\n      1.02    support for (subset of) HDR files, float interface for preferred access to them\n      1.01    fix bug: possible bug in handling right-side up bmps... not sure\n              fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all\n      1.00    interface to zlib that skips zlib header\n      0.99    correct handling of alpha in palette\n      0.98    TGA loader by lonesock; dynamically add loaders (untested)\n      0.97    jpeg errors on too large a file; also catch another malloc failure\n      0.96    fix detection of invalid v value - particleman@mollyrocket forum\n      0.95    during header scan, seek to markers in case of padding\n      0.94    STBI_NO_STDIO to disable stdio usage; rename all #defines the same\n      0.93    handle jpegtran output; verbose errors\n      0.92    read 4,8,16,24,32-bit BMP files of several formats\n      0.91    output 24-bit Windows 3.0 BMP files\n      0.90    fix a few more warnings; bump version number to approach 1.0\n      0.61    bugfixes due to Marc LeBlanc, Christopher Lloyd\n      0.60    fix compiling as c++\n      0.59    fix warnings: merge Dave Moore's -Wall fixes\n      0.58    fix bug: zlib uncompressed mode len/nlen was wrong endian\n      0.57    fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available\n      0.56    fix bug: zlib uncompressed mode len vs. nlen\n      0.55    fix bug: restart_interval not initialized to 0\n      0.54    allow NULL for 'int *comp'\n      0.53    fix bug in png 3->4; speedup png decoding\n      0.52    png handles req_comp=3,4 directly; minor cleanup; jpeg comments\n      0.51    obey req_comp requests, 1-component jpegs return as 1-component,\n              on 'test' only check type, not whether we support this variant\n      0.50    first released version\n*/\n"
  },
  {
    "path": "tests/3rdparty/tinycthread/CMakeLists.txt",
    "content": "## Find source and headers\nFILE(GLOB HEADERS source/*.h)\nFILE(GLOB SOURCES source/*.c*)\n\nIF(CMAKE_HAS_SORT)\n  LIST(SORT HEADERS)\n  LIST(SORT SOURCES)\nENDIF(CMAKE_HAS_SORT)\n\n## Build\nINCLUDE_DIRECTORIES(\n  source\n)\n\nADD_LIBRARY(tinycthread ${SOURCES} ${HEADERS})\n"
  },
  {
    "path": "tests/3rdparty/tinycthread/README.txt",
    "content": "TinyCThread v1.1\n================\n\nhttp://tinycthread.bitsnbites.eu\n\n\nAbout\n-----\n\nTinyCThread is a minimalist, portable, threading library for C, intended to\nmake it easy to create multi threaded C applications.\n\nThe library is closesly modeled after the C11 standard, but only a subset is\nimplemented at the moment.\n\nSee the documentation in the doc/html directory for more information.\n\n\nUsing TinyCThread\n-----------------\n\nTo use TinyCThread in your own project, just add tinycthread.c and\ntinycthread.h to your project. In your own code, do:\n\n#include <tinycthread.h>\n\n\nBuilding the test programs\n--------------------------\n\nFrom the test folder, issue one of the following commands:\n\nLinux, Mac OS X, OpenSolaris etc:\n  make   (you may need to use gmake on some systems)\n\nWindows/MinGW:\n  mingw32-make\n\nWindows/MS Visual Studio:\n  nmake /f Makefile.msvc\n\n\nHistory\n-------\n\nv1.1 - 2012.9.8\n  - First release.\n  - Updated API to better match the final specification (e.g. removed xtime).\n  - Some functionality still missing (mtx_timedlock, TSS destructors under\n    Windows, ...).\n\nv1.0 - Never released\n  - Development version based on C11 specification draft.\n\n\n\nLicense\n-------\n\nCopyright (c) 2012 Marcus Geelnard\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would be\n    appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not be\n    misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n\n"
  },
  {
    "path": "tests/3rdparty/tinycthread/source/tinycthread.c",
    "content": "/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-\nCopyright (c) 2012 Marcus Geelnard\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would be\n    appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not be\n    misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n*/\n\n#include \"tinycthread.h\"\n#include <stdlib.h>\n\n/* Platform specific includes */\n#if defined(_TTHREAD_POSIX_)\n  #include <signal.h>\n  #include <sched.h>\n  #include <unistd.h>\n  #include <sys/time.h>\n  #include <errno.h>\n#elif defined(_TTHREAD_WIN32_)\n  #include <process.h>\n  #include <sys/timeb.h>\n#endif\n\n/* Standard, good-to-have defines */\n#ifndef NULL\n  #define NULL (void*)0\n#endif\n#ifndef TRUE\n  #define TRUE 1\n#endif\n#ifndef FALSE\n  #define FALSE 0\n#endif\n\nint mtx_init(mtx_t *mtx, int type)\n{\n#if defined(_TTHREAD_WIN32_)\n  mtx->mAlreadyLocked = FALSE;\n  mtx->mRecursive = type & mtx_recursive;\n  InitializeCriticalSection(&mtx->mHandle);\n  return thrd_success;\n#else\n  int ret;\n  pthread_mutexattr_t attr;\n  pthread_mutexattr_init(&attr);\n  if (type & mtx_recursive)\n  {\n    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);\n  }\n  ret = pthread_mutex_init(mtx, &attr);\n  pthread_mutexattr_destroy(&attr);\n  return ret == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nvoid mtx_destroy(mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  DeleteCriticalSection(&mtx->mHandle);\n#else\n  pthread_mutex_destroy(mtx);\n#endif\n}\n\nint mtx_lock(mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  EnterCriticalSection(&mtx->mHandle);\n  if (!mtx->mRecursive)\n  {\n    while(mtx->mAlreadyLocked) Sleep(1000); /* Simulate deadlock... */\n    mtx->mAlreadyLocked = TRUE;\n  }\n  return thrd_success;\n#else\n  return pthread_mutex_lock(mtx) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nint mtx_timedlock(mtx_t *mtx, const struct timespec *ts)\n{\n  /* FIXME! */\n  (void)mtx;\n  (void)ts;\n  return thrd_error;\n}\n\nint mtx_trylock(mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  int ret = TryEnterCriticalSection(&mtx->mHandle) ? thrd_success : thrd_busy;\n  if ((!mtx->mRecursive) && (ret == thrd_success) && mtx->mAlreadyLocked)\n  {\n    LeaveCriticalSection(&mtx->mHandle);\n    ret = thrd_busy;\n  }\n  return ret;\n#else\n  return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;\n#endif\n}\n\nint mtx_unlock(mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  mtx->mAlreadyLocked = FALSE;\n  LeaveCriticalSection(&mtx->mHandle);\n  return thrd_success;\n#else\n  return pthread_mutex_unlock(mtx) == 0 ? thrd_success : thrd_error;;\n#endif\n}\n\n#if defined(_TTHREAD_WIN32_)\n#define _CONDITION_EVENT_ONE 0\n#define _CONDITION_EVENT_ALL 1\n#endif\n\nint cnd_init(cnd_t *cond)\n{\n#if defined(_TTHREAD_WIN32_)\n  cond->mWaitersCount = 0;\n\n  /* Init critical section */\n  InitializeCriticalSection(&cond->mWaitersCountLock);\n\n  /* Init events */\n  cond->mEvents[_CONDITION_EVENT_ONE] = CreateEvent(NULL, FALSE, FALSE, NULL);\n  if (cond->mEvents[_CONDITION_EVENT_ONE] == NULL)\n  {\n    cond->mEvents[_CONDITION_EVENT_ALL] = NULL;\n    return thrd_error;\n  }\n  cond->mEvents[_CONDITION_EVENT_ALL] = CreateEvent(NULL, TRUE, FALSE, NULL);\n  if (cond->mEvents[_CONDITION_EVENT_ALL] == NULL)\n  {\n    CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);\n    cond->mEvents[_CONDITION_EVENT_ONE] = NULL;\n    return thrd_error;\n  }\n\n  return thrd_success;\n#else\n  return pthread_cond_init(cond, NULL) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nvoid cnd_destroy(cnd_t *cond)\n{\n#if defined(_TTHREAD_WIN32_)\n  if (cond->mEvents[_CONDITION_EVENT_ONE] != NULL)\n  {\n    CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);\n  }\n  if (cond->mEvents[_CONDITION_EVENT_ALL] != NULL)\n  {\n    CloseHandle(cond->mEvents[_CONDITION_EVENT_ALL]);\n  }\n  DeleteCriticalSection(&cond->mWaitersCountLock);\n#else\n  pthread_cond_destroy(cond);\n#endif\n}\n\nint cnd_signal(cnd_t *cond)\n{\n#if defined(_TTHREAD_WIN32_)\n  int haveWaiters;\n\n  /* Are there any waiters? */\n  EnterCriticalSection(&cond->mWaitersCountLock);\n  haveWaiters = (cond->mWaitersCount > 0);\n  LeaveCriticalSection(&cond->mWaitersCountLock);\n\n  /* If we have any waiting threads, send them a signal */\n  if(haveWaiters)\n  {\n    if (SetEvent(cond->mEvents[_CONDITION_EVENT_ONE]) == 0)\n    {\n      return thrd_error;\n    }\n  }\n\n  return thrd_success;\n#else\n  return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nint cnd_broadcast(cnd_t *cond)\n{\n#if defined(_TTHREAD_WIN32_)\n  int haveWaiters;\n\n  /* Are there any waiters? */\n  EnterCriticalSection(&cond->mWaitersCountLock);\n  haveWaiters = (cond->mWaitersCount > 0);\n  LeaveCriticalSection(&cond->mWaitersCountLock);\n\n  /* If we have any waiting threads, send them a signal */\n  if(haveWaiters)\n  {\n    if (SetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)\n    {\n      return thrd_error;\n    }\n  }\n\n  return thrd_success;\n#else\n  return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\n#if defined(_TTHREAD_WIN32_)\nstatic int _cnd_timedwait_win32(cnd_t *cond, mtx_t *mtx, DWORD timeout)\n{\n  int result, lastWaiter;\n\n  /* Increment number of waiters */\n  EnterCriticalSection(&cond->mWaitersCountLock);\n  ++ cond->mWaitersCount;\n  LeaveCriticalSection(&cond->mWaitersCountLock);\n\n  /* Release the mutex while waiting for the condition (will decrease\n     the number of waiters when done)... */\n  mtx_unlock(mtx);\n\n  /* Wait for either event to become signaled due to cnd_signal() or\n     cnd_broadcast() being called */\n  result = WaitForMultipleObjects(2, cond->mEvents, FALSE, timeout);\n  if (result == WAIT_TIMEOUT)\n  {\n    return thrd_timeout;\n  }\n  else if (result == (int)WAIT_FAILED)\n  {\n    return thrd_error;\n  }\n\n  /* Check if we are the last waiter */\n  EnterCriticalSection(&cond->mWaitersCountLock);\n  -- cond->mWaitersCount;\n  lastWaiter = (result == (WAIT_OBJECT_0 + _CONDITION_EVENT_ALL)) &&\n               (cond->mWaitersCount == 0);\n  LeaveCriticalSection(&cond->mWaitersCountLock);\n\n  /* If we are the last waiter to be notified to stop waiting, reset the event */\n  if (lastWaiter)\n  {\n    if (ResetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)\n    {\n      return thrd_error;\n    }\n  }\n\n  /* Re-acquire the mutex */\n  mtx_lock(mtx);\n\n  return thrd_success;\n}\n#endif\n\nint cnd_wait(cnd_t *cond, mtx_t *mtx)\n{\n#if defined(_TTHREAD_WIN32_)\n  return _cnd_timedwait_win32(cond, mtx, INFINITE);\n#else\n  return pthread_cond_wait(cond, mtx) == 0 ? thrd_success : thrd_error;\n#endif\n}\n\nint cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts)\n{\n#if defined(_TTHREAD_WIN32_)\n  struct timespec now;\n  if (clock_gettime(TIME_UTC, &now) == 0)\n  {\n    DWORD delta = (ts->tv_sec - now.tv_sec) * 1000 +\n                  (ts->tv_nsec - now.tv_nsec + 500000) / 1000000;\n    return _cnd_timedwait_win32(cond, mtx, delta);\n  }\n  else\n    return thrd_error;\n#else\n  int ret;\n  ret = pthread_cond_timedwait(cond, mtx, ts);\n  if (ret == ETIMEDOUT)\n  {\n    return thrd_timeout;\n  }\n  return ret == 0 ? thrd_success : thrd_error;\n#endif\n}\n\n\n/** Information to pass to the new thread (what to run). */\ntypedef struct {\n  thrd_start_t mFunction; /**< Pointer to the function to be executed. */\n  void * mArg;            /**< Function argument for the thread function. */\n} _thread_start_info;\n\n/* Thread wrapper function. */\n#if defined(_TTHREAD_WIN32_)\nstatic unsigned WINAPI _thrd_wrapper_function(void * aArg)\n#elif defined(_TTHREAD_POSIX_)\nstatic void * _thrd_wrapper_function(void * aArg)\n#endif\n{\n  thrd_start_t fun;\n  void *arg;\n  int  res;\n#if defined(_TTHREAD_POSIX_)\n  void *pres;\n#endif\n\n  /* Get thread startup information */\n  _thread_start_info *ti = (_thread_start_info *) aArg;\n  fun = ti->mFunction;\n  arg = ti->mArg;\n\n  /* The thread is responsible for freeing the startup information */\n  free((void *)ti);\n\n  /* Call the actual client thread function */\n  res = fun(arg);\n\n#if defined(_TTHREAD_WIN32_)\n  return res;\n#else\n  pres = malloc(sizeof(int));\n  if (pres != NULL)\n  {\n    *(int*)pres = res;\n  }\n  return pres;\n#endif\n}\n\nint thrd_create(thrd_t *thr, thrd_start_t func, void *arg)\n{\n  /* Fill out the thread startup information (passed to the thread wrapper,\n     which will eventually free it) */\n  _thread_start_info* ti = (_thread_start_info*)malloc(sizeof(_thread_start_info));\n  if (ti == NULL)\n  {\n    return thrd_nomem;\n  }\n  ti->mFunction = func;\n  ti->mArg = arg;\n\n  /* Create the thread */\n#if defined(_TTHREAD_WIN32_)\n  *thr = (HANDLE)_beginthreadex(NULL, 0, _thrd_wrapper_function, (void *)ti, 0, NULL);\n#elif defined(_TTHREAD_POSIX_)\n  if(pthread_create(thr, NULL, _thrd_wrapper_function, (void *)ti) != 0)\n  {\n    *thr = 0;\n  }\n#endif\n\n  /* Did we fail to create the thread? */\n  if(!*thr)\n  {\n    free(ti);\n    return thrd_error;\n  }\n\n  return thrd_success;\n}\n\nthrd_t thrd_current(void)\n{\n#if defined(_TTHREAD_WIN32_)\n  return GetCurrentThread();\n#else\n  return pthread_self();\n#endif\n}\n\nint thrd_detach(thrd_t thr)\n{\n  /* FIXME! */\n  (void)thr;\n  return thrd_error;\n}\n\nint thrd_equal(thrd_t thr0, thrd_t thr1)\n{\n#if defined(_TTHREAD_WIN32_)\n  return thr0 == thr1;\n#else\n  return pthread_equal(thr0, thr1);\n#endif\n}\n\nvoid thrd_exit(int res)\n{\n#if defined(_TTHREAD_WIN32_)\n  ExitThread(res);\n#else\n  void *pres = malloc(sizeof(int));\n  if (pres != NULL)\n  {\n    *(int*)pres = res;\n  }\n  pthread_exit(pres);\n#endif\n}\n\nint thrd_join(thrd_t thr, int *res)\n{\n#if defined(_TTHREAD_WIN32_)\n  if (WaitForSingleObject(thr, INFINITE) == WAIT_FAILED)\n  {\n    return thrd_error;\n  }\n  if (res != NULL)\n  {\n    DWORD dwRes;\n    GetExitCodeThread(thr, &dwRes);\n    *res = dwRes;\n  }\n#elif defined(_TTHREAD_POSIX_)\n  void *pres;\n  int ires = 0;\n  if (pthread_join(thr, &pres) != 0)\n  {\n    return thrd_error;\n  }\n  if (pres != NULL)\n  {\n    ires = *(int*)pres;\n    free(pres);\n  }\n  if (res != NULL)\n  {\n    *res = ires;\n  }\n#endif\n  return thrd_success;\n}\n\nint thrd_sleep(const struct timespec *time_point, struct timespec *remaining)\n{\n  struct timespec now;\n#if defined(_TTHREAD_WIN32_)\n  DWORD delta;\n#else\n  long delta;\n#endif\n\n  /* Get the current time */\n  if (clock_gettime(TIME_UTC, &now) != 0)\n    return -2;  // FIXME: Some specific error code?\n\n#if defined(_TTHREAD_WIN32_)\n  /* Delta in milliseconds */\n  delta = (time_point->tv_sec - now.tv_sec) * 1000 +\n          (time_point->tv_nsec - now.tv_nsec + 500000) / 1000000;\n  if (delta > 0)\n  {\n    Sleep(delta);\n  }\n#else\n  /* Delta in microseconds */\n  delta = (time_point->tv_sec - now.tv_sec) * 1000000L +\n          (time_point->tv_nsec - now.tv_nsec + 500L) / 1000L;\n\n  /* On some systems, the usleep argument must be < 1000000 */\n  while (delta > 999999L)\n  {\n    usleep(999999);\n    delta -= 999999L;\n  }\n  if (delta > 0L)\n  {\n    usleep((useconds_t)delta);\n  }\n#endif\n\n  /* We don't support waking up prematurely (yet) */\n  if (remaining)\n  {\n    remaining->tv_sec = 0;\n    remaining->tv_nsec = 0;\n  }\n  return 0;\n}\n\nvoid thrd_yield(void)\n{\n#if defined(_TTHREAD_WIN32_)\n  Sleep(0);\n#else\n  sched_yield();\n#endif\n}\n\nint tss_create(tss_t *key, tss_dtor_t dtor)\n{\n#if defined(_TTHREAD_WIN32_)\n  /* FIXME: The destructor function is not supported yet... */\n  if (dtor != NULL)\n  {\n    return thrd_error;\n  }\n  *key = TlsAlloc();\n  if (*key == TLS_OUT_OF_INDEXES)\n  {\n    return thrd_error;\n  }\n#else\n  if (pthread_key_create(key, dtor) != 0)\n  {\n    return thrd_error;\n  }\n#endif\n  return thrd_success;\n}\n\nvoid tss_delete(tss_t key)\n{\n#if defined(_TTHREAD_WIN32_)\n  TlsFree(key);\n#else\n  pthread_key_delete(key);\n#endif\n}\n\nvoid *tss_get(tss_t key)\n{\n#if defined(_TTHREAD_WIN32_)\n  return TlsGetValue(key);\n#else\n  return pthread_getspecific(key);\n#endif\n}\n\nint tss_set(tss_t key, void *val)\n{\n#if defined(_TTHREAD_WIN32_)\n  if (TlsSetValue(key, val) == 0)\n  {\n    return thrd_error;\n  }\n#else\n  if (pthread_setspecific(key, val) != 0)\n  {\n    return thrd_error;\n  }\n#endif\n  return thrd_success;\n}\n\n#if defined(_TTHREAD_EMULATE_CLOCK_GETTIME_)\nint _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts)\n{\n#if defined(_TTHREAD_WIN32_)\n  struct _timeb tb;\n  _ftime(&tb);\n  ts->tv_sec = (time_t)tb.time;\n  ts->tv_nsec = 1000000L * (long)tb.millitm;\n#else\n  struct timeval tv;\n  gettimeofday(&tv, NULL);\n  ts->tv_sec = (time_t)tv.tv_sec;\n  ts->tv_nsec = 1000L * (long)tv.tv_usec;\n#endif\n  return 0;\n}\n#endif // _TTHREAD_EMULATE_CLOCK_GETTIME_\n\n"
  },
  {
    "path": "tests/3rdparty/tinycthread/source/tinycthread.h",
    "content": "/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-\nCopyright (c) 2012 Marcus Geelnard\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would be\n    appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not be\n    misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n*/\n\n#ifndef _TINYCTHREAD_H_\n#define _TINYCTHREAD_H_\n\n/**\n* @file\n* @mainpage TinyCThread API Reference\n*\n* @section intro_sec Introduction\n* TinyCThread is a minimal, portable implementation of basic threading\n* classes for C.\n*\n* They closely mimic the functionality and naming of the C11 standard, and\n* should be easily replaceable with the corresponding standard variants.\n*\n* @section port_sec Portability\n* The Win32 variant uses the native Win32 API for implementing the thread\n* classes, while for other systems, the POSIX threads API (pthread) is used.\n*\n* @section misc_sec Miscellaneous\n* The following special keywords are available: #_Thread_local.\n*\n* For more detailed information, browse the different sections of this\n* documentation. A good place to start is:\n* tinycthread.h.\n*/\n\n/* begin C linkage */\n#ifdef __cplusplus \n\textern \"C\" {\n#endif\n\n/* Which platform are we on? */\n#if !defined(_TTHREAD_PLATFORM_DEFINED_)\n  #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)\n    #define _TTHREAD_WIN32_\n  #else\n    #define _TTHREAD_POSIX_\n  #endif\n  #define _TTHREAD_PLATFORM_DEFINED_\n#endif\n\n/* Activate some POSIX functionality (e.g. clock_gettime and recursive mutexes) */\n#if defined(_TTHREAD_POSIX_)\n  #undef _FEATURES_H\n  #if !defined(_GNU_SOURCE)\n    #define _GNU_SOURCE\n  #endif\n  #if !defined(_POSIX_C_SOURCE) || ((_POSIX_C_SOURCE - 0) < 199309L)\n    #undef _POSIX_C_SOURCE\n    #define _POSIX_C_SOURCE 199309L\n  #endif\n  #if !defined(_XOPEN_SOURCE) || ((_XOPEN_SOURCE - 0) < 500)\n    #undef _XOPEN_SOURCE\n    #define _XOPEN_SOURCE 500\n  #endif\n#endif\n\n/* Generic includes */\n#include <time.h>\n\n/* Platform specific includes */\n#if defined(_TTHREAD_POSIX_)\n  #include <pthread.h>\n#elif defined(_TTHREAD_WIN32_)\n  #ifndef WIN32_LEAN_AND_MEAN\n    #define WIN32_LEAN_AND_MEAN\n    #define __UNDEF_LEAN_AND_MEAN\n  #endif\n  #include <windows.h>\n  #ifdef __UNDEF_LEAN_AND_MEAN\n    #undef WIN32_LEAN_AND_MEAN\n    #undef __UNDEF_LEAN_AND_MEAN\n  #endif\n#endif\n\n/* Workaround for missing TIME_UTC: If time.h doesn't provide TIME_UTC,\n   it's quite likely that libc does not support it either. Hence, fall back to\n   the only other supported time specifier: CLOCK_REALTIME (and if that fails,\n   we're probably emulating clock_gettime anyway, so anything goes). */\n#ifndef TIME_UTC\n  #ifdef CLOCK_REALTIME\n    #define TIME_UTC CLOCK_REALTIME\n  #else\n    #define TIME_UTC 0\n  #endif\n#endif\n\n/* Workaround for missing clock_gettime (most Windows compilers, afaik) */\n#if defined(_TTHREAD_WIN32_) || defined(__APPLE__)\n#define _TTHREAD_EMULATE_CLOCK_GETTIME_\n\n#if defined(_TTHREAD_WIN32_)\n/* Emulate struct timespec */\nstruct _ttherad_timespec {\n  time_t tv_sec;\n  long   tv_nsec;\n};\n#define timespec _ttherad_timespec\n#endif\n\n/* Emulate clockid_t */\ntypedef int _tthread_clockid_t;\n#define clockid_t _tthread_clockid_t\n\n/* Emulate clock_gettime */\nint _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts);\n#define clock_gettime _tthread_clock_gettime\n#endif\n\n\n/** TinyCThread version (major number). */\n#define TINYCTHREAD_VERSION_MAJOR 1\n/** TinyCThread version (minor number). */\n#define TINYCTHREAD_VERSION_MINOR 1\n/** TinyCThread version (full version). */\n#define TINYCTHREAD_VERSION (TINYCTHREAD_VERSION_MAJOR * 100 + TINYCTHREAD_VERSION_MINOR)\n\n/**\n* @def _Thread_local\n* Thread local storage keyword.\n* A variable that is declared with the @c _Thread_local keyword makes the\n* value of the variable local to each thread (known as thread-local storage,\n* or TLS). Example usage:\n* @code\n* // This variable is local to each thread.\n* _Thread_local int variable;\n* @endcode\n* @note The @c _Thread_local keyword is a macro that maps to the corresponding\n* compiler directive (e.g. @c __declspec(thread)).\n* @note This directive is currently not supported on Mac OS X (it will give\n* a compiler error), since compile-time TLS is not supported in the Mac OS X\n* executable format. Also, some older versions of MinGW (before GCC 4.x) do\n* not support this directive.\n* @hideinitializer\n*/\n\n/* FIXME: Check for a PROPER value of __STDC_VERSION__ to know if we have C11 */\n#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201102L)) && !defined(_Thread_local)\n #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)\n  #define _Thread_local __thread\n #else\n  #define _Thread_local __declspec(thread)\n #endif\n#endif\n\n/* Macros */\n#define TSS_DTOR_ITERATIONS 0\n\n/* Function return values */\n#define thrd_error    0 /**< The requested operation failed */\n#define thrd_success  1 /**< The requested operation succeeded */\n#define thrd_timeout  2 /**< The time specified in the call was reached without acquiring the requested resource */\n#define thrd_busy     3 /**< The requested operation failed because a tesource requested by a test and return function is already in use */\n#define thrd_nomem    4 /**< The requested operation failed because it was unable to allocate memory */\n\n/* Mutex types */\n#define mtx_plain     1\n#define mtx_timed     2\n#define mtx_try       4\n#define mtx_recursive 8\n\n/* Mutex */\n#if defined(_TTHREAD_WIN32_)\ntypedef struct {\n  CRITICAL_SECTION mHandle;   /* Critical section handle */\n  int mAlreadyLocked;         /* TRUE if the mutex is already locked */\n  int mRecursive;             /* TRUE if the mutex is recursive */\n} mtx_t;\n#else\ntypedef pthread_mutex_t mtx_t;\n#endif\n\n/** Create a mutex object.\n* @param mtx A mutex object.\n* @param type Bit-mask that must have one of the following six values:\n*   @li @c mtx_plain for a simple non-recursive mutex\n*   @li @c mtx_timed for a non-recursive mutex that supports timeout\n*   @li @c mtx_try for a non-recursive mutex that supports test and return\n*   @li @c mtx_plain | @c mtx_recursive (same as @c mtx_plain, but recursive)\n*   @li @c mtx_timed | @c mtx_recursive (same as @c mtx_timed, but recursive)\n*   @li @c mtx_try | @c mtx_recursive (same as @c mtx_try, but recursive)\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint mtx_init(mtx_t *mtx, int type);\n\n/** Release any resources used by the given mutex.\n* @param mtx A mutex object.\n*/\nvoid mtx_destroy(mtx_t *mtx);\n\n/** Lock the given mutex.\n* Blocks until the given mutex can be locked. If the mutex is non-recursive, and\n* the calling thread already has a lock on the mutex, this call will block\n* forever.\n* @param mtx A mutex object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint mtx_lock(mtx_t *mtx);\n\n/** NOT YET IMPLEMENTED.\n*/\nint mtx_timedlock(mtx_t *mtx, const struct timespec *ts);\n\n/** Try to lock the given mutex.\n* The specified mutex shall support either test and return or timeout. If the\n* mutex is already locked, the function returns without blocking.\n* @param mtx A mutex object.\n* @return @ref thrd_success on success, or @ref thrd_busy if the resource\n* requested is already in use, or @ref thrd_error if the request could not be\n* honored.\n*/\nint mtx_trylock(mtx_t *mtx);\n\n/** Unlock the given mutex.\n* @param mtx A mutex object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint mtx_unlock(mtx_t *mtx);\n\n/* Condition variable */\n#if defined(_TTHREAD_WIN32_)\ntypedef struct {\n  HANDLE mEvents[2];                  /* Signal and broadcast event HANDLEs. */\n  unsigned int mWaitersCount;         /* Count of the number of waiters. */\n  CRITICAL_SECTION mWaitersCountLock; /* Serialize access to mWaitersCount. */\n} cnd_t;\n#else\ntypedef pthread_cond_t cnd_t;\n#endif\n\n/** Create a condition variable object.\n* @param cond A condition variable object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint cnd_init(cnd_t *cond);\n\n/** Release any resources used by the given condition variable.\n* @param cond A condition variable object.\n*/\nvoid cnd_destroy(cnd_t *cond);\n\n/** Signal a condition variable.\n* Unblocks one of the threads that are blocked on the given condition variable\n* at the time of the call. If no threads are blocked on the condition variable\n* at the time of the call, the function does nothing and return success.\n* @param cond A condition variable object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint cnd_signal(cnd_t *cond);\n\n/** Broadcast a condition variable.\n* Unblocks all of the threads that are blocked on the given condition variable\n* at the time of the call. If no threads are blocked on the condition variable\n* at the time of the call, the function does nothing and return success.\n* @param cond A condition variable object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint cnd_broadcast(cnd_t *cond);\n\n/** Wait for a condition variable to become signaled.\n* The function atomically unlocks the given mutex and endeavors to block until\n* the given condition variable is signaled by a call to cnd_signal or to\n* cnd_broadcast. When the calling thread becomes unblocked it locks the mutex\n* before it returns.\n* @param cond A condition variable object.\n* @param mtx A mutex object.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint cnd_wait(cnd_t *cond, mtx_t *mtx);\n\n/** Wait for a condition variable to become signaled.\n* The function atomically unlocks the given mutex and endeavors to block until\n* the given condition variable is signaled by a call to cnd_signal or to\n* cnd_broadcast, or until after the specified time. When the calling thread\n* becomes unblocked it locks the mutex before it returns.\n* @param cond A condition variable object.\n* @param mtx A mutex object.\n* @param xt A point in time at which the request will time out (absolute time).\n* @return @ref thrd_success upon success, or @ref thrd_timeout if the time\n* specified in the call was reached without acquiring the requested resource, or\n* @ref thrd_error if the request could not be honored.\n*/\nint cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts);\n\n/* Thread */\n#if defined(_TTHREAD_WIN32_)\ntypedef HANDLE thrd_t;\n#else\ntypedef pthread_t thrd_t;\n#endif\n\n/** Thread start function.\n* Any thread that is started with the @ref thrd_create() function must be\n* started through a function of this type.\n* @param arg The thread argument (the @c arg argument of the corresponding\n*        @ref thrd_create() call).\n* @return The thread return value, which can be obtained by another thread\n* by using the @ref thrd_join() function.\n*/\ntypedef int (*thrd_start_t)(void *arg);\n\n/** Create a new thread.\n* @param thr Identifier of the newly created thread.\n* @param func A function pointer to the function that will be executed in\n*        the new thread.\n* @param arg An argument to the thread function.\n* @return @ref thrd_success on success, or @ref thrd_nomem if no memory could\n* be allocated for the thread requested, or @ref thrd_error if the request\n* could not be honored.\n* @note A thread’s identifier may be reused for a different thread once the\n* original thread has exited and either been detached or joined to another\n* thread.\n*/\nint thrd_create(thrd_t *thr, thrd_start_t func, void *arg);\n\n/** Identify the calling thread.\n* @return The identifier of the calling thread.\n*/\nthrd_t thrd_current(void);\n\n/** NOT YET IMPLEMENTED.\n*/\nint thrd_detach(thrd_t thr);\n\n/** Compare two thread identifiers.\n* The function determines if two thread identifiers refer to the same thread.\n* @return Zero if the two thread identifiers refer to different threads.\n* Otherwise a nonzero value is returned.\n*/\nint thrd_equal(thrd_t thr0, thrd_t thr1);\n\n/** Terminate execution of the calling thread.\n* @param res Result code of the calling thread.\n*/\nvoid thrd_exit(int res);\n\n/** Wait for a thread to terminate.\n* The function joins the given thread with the current thread by blocking\n* until the other thread has terminated.\n* @param thr The thread to join with.\n* @param res If this pointer is not NULL, the function will store the result\n*        code of the given thread in the integer pointed to by @c res.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint thrd_join(thrd_t thr, int *res);\n\n/** Put the calling thread to sleep.\n* Suspend execution of the calling thread.\n* @param time_point A point in time at which the thread will resume (absolute time).\n* @param remaining If non-NULL, this parameter will hold the remaining time until\n*                  time_point upon return. This will typically be zero, but if\n*                  the thread was woken up by a signal that is not ignored before\n*                  time_point was reached @c remaining will hold a positive\n*                  time.\n* @return 0 (zero) on successful sleep, or -1 if an interrupt occurred.\n*/\nint thrd_sleep(const struct timespec *time_point, struct timespec *remaining);\n\n/** Yield execution to another thread.\n* Permit other threads to run, even if the current thread would ordinarily\n* continue to run.\n*/\nvoid thrd_yield(void);\n\n/* Thread local storage */\n#if defined(_TTHREAD_WIN32_)\ntypedef DWORD tss_t;\n#else\ntypedef pthread_key_t tss_t;\n#endif\n\n/** Destructor function for a thread-specific storage.\n* @param val The value of the destructed thread-specific storage.\n*/\ntypedef void (*tss_dtor_t)(void *val);\n\n/** Create a thread-specific storage.\n* @param key The unique key identifier that will be set if the function is\n*        successful.\n* @param dtor Destructor function. This can be NULL.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n* @note The destructor function is not supported under Windows. If @c dtor is\n* not NULL when calling this function under Windows, the function will fail\n* and return @ref thrd_error.\n*/\nint tss_create(tss_t *key, tss_dtor_t dtor);\n\n/** Delete a thread-specific storage.\n* The function releases any resources used by the given thread-specific\n* storage.\n* @param key The key that shall be deleted.\n*/\nvoid tss_delete(tss_t key);\n\n/** Get the value for a thread-specific storage.\n* @param key The thread-specific storage identifier.\n* @return The value for the current thread held in the given thread-specific\n* storage.\n*/\nvoid *tss_get(tss_t key);\n\n/** Set the value for a thread-specific storage.\n* @param key The thread-specific storage identifier.\n* @param val The value of the thread-specific storage to set for the current\n*        thread.\n* @return @ref thrd_success on success, or @ref thrd_error if the request could\n* not be honored.\n*/\nint tss_set(tss_t key, void *val);\n\n/* end C linkage */\n#ifdef __cplusplus\n\t}\n#endif\n\n#endif /* _TINYTHREAD_H_ */\n\n"
  },
  {
    "path": "tests/raster/CMakeLists.txt",
    "content": "## Find source and headers\nFILE(GLOB HEADERS\n  *.h\n  ${MTCL_INCLUDE_DIR}/*.h\n)\nFILE(GLOB SOURCES\n  *.c*\n)\n\nIF(CMAKE_HAS_SORT)\n  LIST(SORT HEADERS)\n  LIST(SORT SOURCES)\nENDIF(CMAKE_HAS_SORT)\n\n## Build\nINCLUDE_DIRECTORIES(\n  ## Maratis\n  ${MTCL_INCLUDE_DIR}\n\n  ## 3rdparty\n  ${GLFW_INCLUDE_DIR}\n  ${TINYCTHREAD_INCLUDE_DIR}\n)\n\nADD_EXECUTABLE(RasterTest ${SOURCES} ${HEADERS})\n\nTARGET_LINK_LIBRARIES(RasterTest\n\n  ## 3rdparty\n  ${GLFW_LIBRARIES}\n  ${TINYCTHREAD_LIBRARIES}\n\n  ## System libraries\n  ${OPENGL_LIBRARIES}\n  ${PLATFORM_LIBRARIES}\n  ${OS_SPECIFIC_LIBRARIES}\n)\n\n## Install\nINSTALL(TARGETS RasterTest DESTINATION ${MTCL_INSTALL_DIR})\n\nIF(APPLE)\n  SET_TARGET_PROPERTIES(\n    RasterTest\n    PROPERTIES\n    BUILD_WITH_INSTALL_RPATH 1\n    INSTALL_RPATH \"@loader_path/\"\n  )\nENDIF(APPLE)\n\nIF(UNIX AND NOT APPLE)\n  SET_TARGET_PROPERTIES(\n    RasterTest\n    PROPERTIES\n    BUILD_WITH_INSTALL_RPATH 1\n    INSTALL_RPATH \"$ORIGIN/\"\n  )\nENDIF(UNIX AND NOT APPLE)\n"
  },
  {
    "path": "tests/raster/main.c",
    "content": "/*======================================================================\n Maratis Tiny C Library\n version 1.0\n------------------------------------------------------------------------\n Copyright (c) 2015 Anael Seghezzi <www.maratis3d.com>\n\n This software is provided 'as-is', without any express or implied\n warranty. In no event will the authors be held liable for any damages\n arising from the use of this software.\n\n Permission is granted to anyone to use this software for any purpose,\n including commercial applications, and to alter it and redistribute it\n freely, subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would\n    be appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must not\n    be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source\n    distribution.\n\n========================================================================*/\n\n/* software rasterization test */\n\n#define M_MATH_IMPLEMENTATION\n#define M_IMAGE_IMPLEMENTATION\n#define M_RASTER_IMPLEMENTATION\n#include <m_math.h>\n#include <m_image.h>\n#include <m_raster.h>\n\n#include \"../test.h\"\n\nstatic struct m_image test_buffer = M_IMAGE_IDENTITY();\n\nfloat3 vertices[8] = {\n\t{-1, -1, -1},\n\t{ 1, -1, -1},\n\t{ 1,  1, -1},\n\t{-1,  1, -1},\n\t{-1, -1,  1},\n\t{ 1, -1,  1},\n\t{ 1,  1,  1},\n\t{-1,  1,  1}\n};\n\nvoid draw(void)\n{\n\tfloat2 pr[8];\n\tfloat3 pos;\n\tfloat color[3] = {1, 1, 1};\n\tfloat *data;\n\tint i;\n\t\n\t/* move */\n\tpos.x = sinf(test_t * 0.025f);\n\tpos.y = sinf(test_t * 0.02f) * 0.25f;\n\tpos.z = 5 + sinf(test_t * 0.035f) * 2.0f;\n\t\n\t/* projection */\n\tfor (i = 0; i < 8; i++) {\n\t\tfloat3 v; float iz;\n\t\t\n\t\tM_ADD3(v, pos, vertices[i]);\n\t\tiz = 1.0f / v.z;\n\t\t\n\t\tpr[i].x = ((v.x * iz) + 0.5f) * test_buffer.width;\n\t\tpr[i].y = ((v.y * iz) + 0.5f) * test_buffer.height;\n\t}\n\t\n\t/* clear */\n\tmemset(test_buffer.data, 0, test_buffer.size * sizeof(float));\n\t\n\t/* draw lines */\n\tfor (i = 0; i < 4; i++) {\n\t\tint i2 = i == 3 ? 0 : i + 1;\n\t\tm_raster_line((float *)test_buffer.data, test_buffer.width, test_buffer.height, test_buffer.comp, &pr[i].x, &pr[i2].x, color);\n\t}\n\tfor (i = 4; i < 8; i++) {\n\t\tint i2 = i == 7 ? 4 : i + 1;\n\t\tm_raster_line((float *)test_buffer.data, test_buffer.width, test_buffer.height, test_buffer.comp, &pr[i].x, &pr[i2].x, color);\n\t}\n\tfor (i = 0; i < 4; i++) {\n\t\tint i2 = i + 4;\n\t\tm_raster_line((float *)test_buffer.data, test_buffer.width, test_buffer.height, test_buffer.comp, &pr[i].x, &pr[i2].x, color);\n\t}\n\t\n\t/* add some noise */\n\tdata = (float *)test_buffer.data;\n\tfor (i = 0; i < test_buffer.size; i++) {\n\t\tdata[i] += ((float)rand() / (float)RAND_MAX) * 0.25f;\n\t}\n}\n\nvoid main_loop(void)\n{\t\n\tdraw();\n\ttest_swap_buffer(&test_buffer);\n\ttest_update();\n}\n\nint main(int argc, char **argv)\n{\t\n\tif (! test_create(\"M - RasterToy\", 256, 256))\n\t\treturn EXIT_FAILURE;\n\t\n\tm_image_create(&test_buffer, M_FLOAT, 256, 256, 3);\n\n\t#ifdef __EMSCRIPTEN__\n\temscripten_set_main_loop(main_loop, 0, 1);\n\t#else\n\twhile (test_state) {\n\t\tmain_loop();\n\t\tthrd_yield();\n\t}\n\t#endif\n\n\tm_image_destroy(&test_buffer);\n\ttest_destroy();\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "tests/raytracing/CMakeLists.txt",
    "content": "## Find source and headers\nFILE(GLOB HEADERS\n  *.h\n  ${MTCL_INCLUDE_DIR}/*.h\n)\nFILE(GLOB SOURCES\n  *.c*\n)\n\nIF(CMAKE_HAS_SORT)\n  LIST(SORT HEADERS)\n  LIST(SORT SOURCES)\nENDIF(CMAKE_HAS_SORT)\n\n## Build\nINCLUDE_DIRECTORIES(\n  ## Maratis\n  ${MTCL_INCLUDE_DIR}\n\n  ## 3rdparty\n  ${GLFW_INCLUDE_DIR}\n  ${TINYCTHREAD_INCLUDE_DIR}\n)\n\nADD_EXECUTABLE(RaytracingTest ${SOURCES} ${HEADERS})\n\nTARGET_LINK_LIBRARIES(RaytracingTest\n  ## 3rdparty\n  ${GLFW_LIBRARIES}\n  ${TINYCTHREAD_LIBRARIES}\n\n  ## System libraries\n  ${OPENGL_LIBRARIES}\n  ${PLATFORM_LIBRARIES}\n  ${OS_SPECIFIC_LIBRARIES}\n)\n\n## Install\nINSTALL(TARGETS RaytracingTest DESTINATION ${MTCL_INSTALL_DIR})\n\nIF(APPLE)\n  SET_TARGET_PROPERTIES(\n    RaytracingTest\n    PROPERTIES\n    BUILD_WITH_INSTALL_RPATH 1\n    INSTALL_RPATH \"@loader_path/\"\n  )\nENDIF(APPLE)\n\nIF(UNIX AND NOT APPLE)\n  SET_TARGET_PROPERTIES(\n    RaytracingTest\n    PROPERTIES\n    BUILD_WITH_INSTALL_RPATH 1\n    INSTALL_RPATH \"$ORIGIN/\"\n  )\nENDIF(UNIX AND NOT APPLE)\n"
  },
  {
    "path": "tests/raytracing/main.c",
    "content": "/*======================================================================\n Maratis Tiny C Library\n version 1.0\n------------------------------------------------------------------------\n Copyright (c) 2015 Anael Seghezzi <www.maratis3d.com>\n\n This software is provided 'as-is', without any express or implied\n warranty. In no event will the authors be held liable for any damages\n arising from the use of this software.\n\n Permission is granted to anyone to use this software for any purpose,\n including commercial applications, and to alter it and redistribute it\n freely, subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would\n    be appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must not\n    be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source\n    distribution.\n\n========================================================================*/\n\n/* raytracing test */\n\n#define M_MATH_IMPLEMENTATION\n#define M_IMAGE_IMPLEMENTATION\n#include <m_math.h>\n#include <m_image.h>\n\n#include \"../test.h\"\n\n#define USE_NOISE /* comment to disable 3d noise (simple sphere raytracing) */\n\nstatic struct m_image test_buffer = M_IMAGE_IDENTITY();\n\n/* approximative noise */\nstatic struct m_image rand_image = M_IMAGE_IDENTITY();\nstatic struct m_image tmp = M_IMAGE_IDENTITY();\n\nvoid init_noise(void)\n{\n\tint i;\n\tm_image_create(&rand_image, M_FLOAT, 16, 16, 2);\n\tfor (i = 0; i < rand_image.size; i++)\n\t\t((float *)rand_image.data)[i] = (float)rand() / (float)RAND_MAX;\n}\n\nvoid destroy_noise(void)\n{\n\tm_image_destroy(&rand_image);\n}\n\nfloat fast_noise(float x, float y, float z)\n{\n\tfloat values[2];\n\tfloat i = z - floorf(z);\n\tm_image_sub_pixel(&rand_image, x + z + 8, y + z + 8, values);\n\treturn values[0] * (1.0f - i) + values[1] * i;\n}\n\n#define GET_RAY(ray, px, py, pz, hw, hh, ratio)\\\n{\\\n\tfloat3 pt = {((float)px - hw) / hw, (-((float)py - hh) / hh) * ratio, pz};\\\n\tfloat ptl = 1.0f / M_LENGHT3(pt);\\\n\tray.x = pt.x * ptl;\\\n\tray.y = pt.y * ptl;\\\n\tray.z = pt.z * ptl;\\\n}\n\nstatic void draw(void)\n{\n\tfloat *data = (float *)test_buffer.data;\n\tint w = test_buffer.width;\n\tint h = test_buffer.height;\n\tint y;\n\t\n\tfloat3 sphere_pos;\n\tfloat3 light_dir;\n\tfloat z_near = 1e-4;\n\tfloat ambient = 0.15f;\n\tfloat sphere_radius2;\n\tfloat sphere_tex_unit;\n\tfloat hw = w * 0.5f;\n\tfloat hh = h * 0.5f;\n\tfloat ratio = (float)test_height / (float)test_width;\n\t\n\t/* light */\n\tlight_dir.x = 0.5f;\n\tlight_dir.y = 0.25f;\n\tlight_dir.z = -0.5f;\n\t\n\t/* sphere */\n\tsphere_radius2 = 150;\n\tsphere_pos.x = cosf(test_t * 0.025f) * 20.0f;\n\tsphere_pos.y = 0.0f;\n\tsphere_pos.z = 50.0f + (sinf(test_t * 0.025f) + 1.0f) * 70.0f;\n\tsphere_tex_unit = 0.25f;\n\n\t/* clear */\n\tmemset(test_buffer.data, 0, test_buffer.size * sizeof(float));\n\t\n\t/* raytrace */\n\t#pragma omp parallel for schedule(dynamic, 8)\n\tfor (y = 0; y < h; y++) {\n\t\t\n\t\tfloat *pixel = data + y * w * 3;\n\t\tint x;\n\t\t\n\t\tfor (x = 0; x < w; x++) {\n\t\t\t\n\t\t\tfloat3 origin = {0, 0, 0};\n\t\t\tfloat3 ray, march_dir;\n\t\t\tfloat march_step;\n\t\t\tfloat idist, dist = 0, Z = 1e20;\n\t\t\t\n\t\t\t/* get ray from pixel position */\n\t\t\tGET_RAY(ray, x, y, 1.35f, hw, hh, ratio);\n\n\t\t\tmarch_step = 0.25f;\n\t\t\tmarch_dir.x = ray.x * march_step;\n\t\t\tmarch_dir.y = ray.y * march_step;\n\t\t\tmarch_dir.z = ray.z * march_step;\n\t\t\t\n\t\t\t/* sphere */\n\t\t\tm_3d_ray_sphere_intersection_in_out(&origin, &ray, &sphere_pos, sphere_radius2, &dist, &idist);\n\t\t\tif (dist > z_near) {\n\t\t\t\t\n\t\t\t\tif (dist < Z) {\n\t\t\t\t\t\n\t\t\t\t\tfloat3 rd = {ray.x * dist, ray.y * dist, ray.z * dist};\n\t\t\t\t\tfloat3 pos = {origin.x + rd.x, origin.y + rd.y, origin.z + rd.z};\n\t\t\t\t\t\n\t\t\t\t\t/* simple sphere */\n\t\t\t\t\t#ifndef USE_NOISE\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat3 normal;\n\t\t\t\t\t\tfloat diffuse;\n\t\t\t\t\t\tM_SUB3(normal, pos, sphere_pos);\n\t\t\t\t\t\tM_NORMALIZE3(normal, normal);\n\t\t\t\t\t\tdiffuse = M_DOT3(normal, light_dir);\n\t\t\t\t\t\tdiffuse = M_MAX(0, diffuse);\n\t\t\t\t\t\tpixel[0] = ambient + diffuse;\n\t\t\t\t\t\tpixel[1] = ambient + diffuse;\n\t\t\t\t\t\tpixel[2] = ambient + diffuse;\n\t\t\t\t\t\tZ = dist;\n\t\t\t\t\t}\n\t\t\t\t\t/* volumetric ray marching inside a sphere (perlin noise test) */\n\t\t\t\t\t#else\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat3 march = pos; /* starting at sphere intersection */\n\t\t\t\t\t\tint i;\n\n\t\t\t\t\t\tfor (i = 0; i < 256; i++) {\n\n\t\t\t\t\t\t\tfloat3 vcoord = {\n\t\t\t\t\t\t\t\t(march.x - sphere_pos.x) * sphere_tex_unit,\n\t\t\t\t\t\t\t\t(march.y - sphere_pos.y) * sphere_tex_unit,\n\t\t\t\t\t\t\t\t(march.z - sphere_pos.z) * sphere_tex_unit\n\t\t\t\t\t\t\t};\n\t\n\t\t\t\t\t\t\tfloat perlin = fast_noise(vcoord.x, vcoord.y, vcoord.z);\n\t\t\t\t\t\t\tif (perlin > 0.6f) {\n\n\t\t\t\t\t\t\t\t/* render */\n\t\t\t\t\t\t\t\tfloat3 normal;\n\t\t\t\t\t\t\t\tfloat diffuse;\n\n\t\t\t\t\t\t\t\tif (i == 0) {\n\t\t\t\t\t\t\t\t\t/* sphere normal */\n\t\t\t\t\t\t\t\t\tM_SUB3(normal, pos, sphere_pos);\n\t\t\t\t\t\t\t\t\tM_NORMALIZE3(normal, normal);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t/* volume normal */\n\t\t\t\t\t\t\t\t\tnormal.x = perlin - fast_noise(vcoord.x + 0.0001f, vcoord.y, vcoord.z);\n\t\t\t\t\t\t\t\t\tnormal.y = perlin - fast_noise(vcoord.x, vcoord.y + 0.0001f, vcoord.z);\n\t\t\t\t\t\t\t\t\tnormal.z = perlin - fast_noise(vcoord.x, vcoord.y, vcoord.z + 0.0001f);\n\t\t\t\t\t\t\t\t\tM_NORMALIZE3(normal, normal);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tdiffuse = M_DOT3(normal, light_dir);\n\t\t\t\t\t\t\t\tdiffuse = M_MAX(0, diffuse);\n\t\t\t\t\t\t\t\tpixel[0] = ambient + diffuse;\n\t\t\t\t\t\t\t\tpixel[1] = ambient + diffuse;\n\t\t\t\t\t\t\t\tpixel[2] = ambient + diffuse;\n\t\t\t\t\t\t\t\tZ = dist;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/* march */\n\t\t\t\t\t\t\tM_ADD3(march, march, march_dir);\n\t\t\t\t\t\t\tdist += march_step;\n\n\t\t\t\t\t\t\tif (dist > idist) /* out of the sphere */\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t#endif\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpixel += 3;\n\t\t}\n\t}\n}\n\nvoid main_loop(void)\n{\t\n\tdraw();\n\ttest_swap_buffer(&test_buffer);\n\ttest_update();\n}\n\nint main(int argc, char **argv)\n{\t\n\tif (! test_create(\"M - RaytracingTest\", 256, 256))\n\t\treturn EXIT_FAILURE;\n\t\n\tm_image_create(&test_buffer, M_FLOAT, 256, 256, 3);\n\tinit_noise();\n\n\t#ifdef __EMSCRIPTEN__\n\temscripten_set_main_loop(main_loop, 0, 1);\n\t#else\n\twhile (test_state) {\n\t\tmain_loop();\n\t\tthrd_yield();\n\t}\n\t#endif\n\t\n\tm_image_destroy(&test_buffer);\n\tdestroy_noise();\n\ttest_destroy();\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "tests/test.h",
    "content": "/*======================================================================\n Maratis Tiny C Library\n version 1.0\n------------------------------------------------------------------------\n Copyright (c) 2015 Anael Seghezzi <www.maratis3d.com>\n\n This software is provided 'as-is', without any express or implied\n warranty. In no event will the authors be held liable for any damages\n arising from the use of this software.\n\n Permission is granted to anyone to use this software for any purpose,\n including commercial applications, and to alter it and redistribute it\n freely, subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would\n    be appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must not\n    be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source\n    distribution.\n\n========================================================================*/\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <memory.h>\n#include <GLFW/glfw3.h>\n\n#ifdef __EMSCRIPTEN__\n#include <emscripten/emscripten.h>\n#else\n#include <tinycthread.h>\n#endif\n\n#ifdef WIN32\n#include <WinBase.h>\n#else\n#include <unistd.h>\n#endif\n\n/*\nfor (i = 0; i < 4096; i++)\n   _src[i] = ((float)i + 0.5f) / 4095.0f; \nm_color_linear_to_sRGB(_src, _dst, 4096);\nfor (i = 0; i < 4096; i++)\n   _m_srgb_table[i] = (int)(_dst[i] * 255.0f + 0.5f); */\nstatic uint8_t _m_srgb_table[4096] = {\n0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, \n22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, \n34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, \n42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 49, \n50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, \n56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, \n61, 61, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, \n66, 66, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 71, 71, \n71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, \n75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, \n79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, \n83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 86, 86, 86, 86, \n86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 90, 90, \n90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, \n93, 93, 93, 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, \n96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, 99, 99, 99, 99, 99, \n99, 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, 102, 102, 102, 102, 102, \n102, 102, 102, 102, 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, 105, 105, \n105, 105, 105, 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, \n108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 110, 110, 110, 110, 110, 110, 110, 110, \n110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, \n113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, 115, 115, 115, 115, 115, 115, \n115, 115, 115, 115, 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, \n118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, \n120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, \n122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, \n124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 127, 127, \n127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, \n129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, \n131, 131, 131, 131, 131, 131, 131, 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, 133, 133, 133, 133, 133, 133, \n133, 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 135, 135, 135, 135, 135, 135, 135, 135, \n135, 135, 135, 135, 135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, \n137, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 139, 139, 139, 139, 139, 139, 139, \n139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, 141, 141, \n141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 143, 143, 143, 143, \n143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 145, \n145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, \n146, 146, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, \n148, 148, 148, 148, 148, 148, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, 150, 150, 150, 150, 150, 150, 150, \n150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, 152, 152, \n152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, \n153, 153, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, \n155, 155, 155, 155, 155, 155, 155, 155, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, \n157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, \n158, 158, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, \n160, 160, 160, 160, 160, 160, 160, 160, 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 162, 162, \n162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, \n163, 163, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 165, 165, 165, 165, 165, 165, \n165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, \n166, 166, 166, 166, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, 168, 168, 168, 168, 168, 168, \n168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, \n169, 169, 169, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, 171, \n171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, \n172, 172, 172, 172, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, \n174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, \n175, 175, 175, 175, 175, 175, 175, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, 177, \n177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, \n178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, \n179, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 181, 181, 181, 181, 181, 181, 181, \n181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, \n182, 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 184, \n184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, \n185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, \n186, 186, 186, 186, 186, 186, 186, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 188, \n188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, \n189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, \n190, 190, 190, 190, 190, 190, 190, 190, 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, \n191, 191, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, 193, 193, \n193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, \n194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, \n195, 195, 195, 195, 195, 195, 195, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, \n196, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 198, 198, 198, 198, 198, \n198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, \n199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, \n200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, \n201, 201, 201, 201, 201, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, \n203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 204, 204, 204, 204, 204, \n204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, \n205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, \n206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, \n207, 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, \n208, 208, 208, 208, 208, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, \n209, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 211, 211, 211, \n211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, 212, 212, 212, 212, \n212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, \n213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, \n214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, \n215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, \n216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, \n217, 217, 217, 217, 217, 217, 217, 217, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, \n218, 218, 218, 218, 218, 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, \n219, 219, 219, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, \n220, 220, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, \n222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 223, 223, \n223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 224, 224, 224, \n224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225, \n225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 226, 226, 226, 226, \n226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 227, 227, 227, 227, 227, 227, \n227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 228, 228, 228, 228, 228, 228, 228, \n228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 229, 229, 229, 229, \n229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 230, 230, 230, 230, 230, 230, 230, 230, \n230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, 231, 231, 231, 231, 231, 231, \n231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, \n232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, 233, 233, 233, 233, 233, 233, \n233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 234, 234, 234, 234, 234, 234, 234, \n234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 235, 235, 235, 235, 235, 235, \n235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, 236, 236, 236, 236, 236, \n236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 237, 237, 237, 237, 237, \n237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 238, 238, 238, \n238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239, \n239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 240, \n240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, \n240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, \n241, 241, 241, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, \n242, 242, 242, 242, 242, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, \n243, 243, 243, 243, 243, 243, 243, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, \n244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, \n245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, \n246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, \n247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, \n248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, \n249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 250, 250, 250, 250, 250, 250, 250, \n250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 251, 251, 251, \n251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, \n252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, \n252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, \n253, 253, 253, 253, 253, 253, 253, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, \n254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255\n};\n\nstatic void m_image_float_to_srgb(struct m_image *dest, const struct m_image *src)\n{\n   float *src_data;\n   uint8_t *dest_data;\n   int i;\n\n   m_image_create(dest, M_UBYTE, src->width, src->height, src->comp);\n\n   src_data = (float *)src->data;\n   dest_data = (uint8_t *)dest->data;\n   for (i = 0; i < src->size; i++) {\n      float f = M_CLAMP(src_data[i], 0, 1);\n      short x = (short)(f * 4095);\n      dest_data[i] = _m_srgb_table[x];\n   }\n}\n\n\nGLFWwindow *test_glfw_window = NULL;\nchar test_title[256];\nint test_state = 1;\nint test_width = 0;\nint test_height = 0;\nint test_tex_width = 0;\nint test_tex_height = 0;\nfloat test_mouse_x = 0;\nfloat test_mouse_y = 0;\nunsigned long test_t = 0;\n\nGLuint test_texture;\n\n#define TEST_BUTTON_COUNT GLFW_KEY_LAST\nchar test_button[TEST_BUTTON_COUNT][2]; // (release, press), pressed\n\n#define TEST_MOUSE_BUTTON_COUNT GLFW_MOUSE_BUTTON_LAST\nchar test_mouse_button[TEST_MOUSE_BUTTON_COUNT][2];\n\n#define TEST_CHAR_MAX 256\nint test_char_count = 0;\nunsigned int test_char_queue[TEST_CHAR_MAX];\n\nstatic void close_callback(GLFWwindow * window)\n{\n\ttest_state = 0;\n}\n\nstatic void size_callback(GLFWwindow * window, int width, int height)\n{\n\ttest_width = width;\n\ttest_height = height;\n}\n\nstatic void cursorpos_callback(GLFWwindow * window, double x, double y)\n{\n\ttest_mouse_x = (float)x / (float)test_width;\n\ttest_mouse_y = (float)y / (float)test_height;\n}\n\nstatic void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)\n{\n\tif (key >=0 && key < TEST_BUTTON_COUNT) {\n\t\ttest_button[key][0] = action + 1;\n\t\ttest_button[key][1] = action;\n\t}\n}\n\nstatic void mousebutton_callback(GLFWwindow * window, int button, int action, int mods)\n{\n\tif (button >=0 && button < TEST_MOUSE_BUTTON_COUNT) {\n\t\ttest_mouse_button[button][0] = action + 1;\n\t\ttest_mouse_button[button][1] = action;\n\t}\n}\n\nstatic void char_callback(GLFWwindow * window, unsigned int key)\n{\n\tif (test_char_count < TEST_CHAR_MAX) {\n\t\ttest_char_queue[test_char_count] = key;\n\t\ttest_char_count++;\n\t}\n}\n\nint test_get_chars(unsigned int dest[TEST_CHAR_MAX])\n{\n\tif (test_char_count > 0)\n\t\tmemcpy(dest, test_char_queue, test_char_count * sizeof(int));\n\treturn test_char_count;\n}\n\nint test_key_press(int key)\n{\n\treturn (test_button[key][0] == 2);\n}\n\nint test_key_release(int key)\n{\n\treturn (test_button[key][0] == 1);\n}\n\nint test_key_pressed(int key)\n{\n\treturn (test_button[key][1] > 0);\n}\n\nint test_mouse_button_press(int button)\n{\n\treturn (test_mouse_button[button][0] == 2);\n}\n\nint test_mouse_button_release(int button)\n{\n\treturn (test_mouse_button[button][0] == 1);\n}\n\nint test_mouse_button_pressed(int button)\n{\n\treturn (test_mouse_button[button][1] > 0);\n}\n\nstatic void draw_texture(GLuint texture)\n{\n\tfloat vertices[8] = {0,0, 0,1, 1,0, 1,1};\n\n\tglEnable(GL_TEXTURE_2D);\n\tglEnableClientState(GL_VERTEX_ARRAY);\n\tglEnableClientState(GL_TEXTURE_COORD_ARRAY);\n\tglDisableClientState(GL_COLOR_ARRAY);\n\tglDisableClientState(GL_NORMAL_ARRAY);\n\t\n\tglTexCoordPointer(2, GL_FLOAT, 0, vertices);\n\tglVertexPointer(2, GL_FLOAT, 0, vertices);\n\t\n\tglBindTexture(GL_TEXTURE_2D, texture);\n\tglDrawArrays(GL_TRIANGLE_STRIP, 0, 4);\n}\n\nstatic void updateGL(void)\n{\n\tglClearColor(0.1f, 0.2f, 0.3f, 0.0f);\n \tglClear(GL_COLOR_BUFFER_BIT);\n\t\n\tglViewport(0, 0, test_width, test_height);\n\tglMatrixMode(GL_PROJECTION);\n\tglLoadIdentity();\n\tglOrtho(0, 1, 1, 0, 1, -1);\n\tglMatrixMode(GL_MODELVIEW);\n\tglLoadIdentity();\n\n\tglColor4f(1, 1, 1, 1);\n\tdraw_texture(test_texture);\n}\n\nvoid test_setup_texture(int width, int height)\n{\n\tglBindTexture(GL_TEXTURE_2D, test_texture);\n\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\n\tglTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);\n\ttest_tex_width = width;\n\ttest_tex_height = height;\n}\n\nvoid test_swap_buffer(struct m_image *image)\n{\n\tstatic struct m_image test_buffer_ubyte = M_IMAGE_IDENTITY();\n\n\tif (image) {\n\t\t\n\t\tif (image->width != test_tex_width || image->height != test_tex_height)\n\t\t\ttest_setup_texture(image->width, image->height);\n\n\t\tglBindTexture(GL_TEXTURE_2D, test_texture);\n\n\t\tif (image->type == M_FLOAT)\n\t\t{\n\t\t\tm_image_float_to_srgb(&test_buffer_ubyte, image);\n\t\t\tglTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, test_buffer_ubyte.width, test_buffer_ubyte.height, GL_RGB, GL_UNSIGNED_BYTE, test_buffer_ubyte.data);\n\t\t}\n\t\telse if (image->type == M_UBYTE)\n\t\t{\n\t\t\tglTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, image->width, image->height, GL_RGB, GL_UNSIGNED_BYTE, image->data);\n\t\t}\n\t\n\t\tupdateGL();\n\t}\n\t\n\tglfwSwapBuffers(test_glfw_window);\n}\n\ndouble test_get_time(void)\n{\n\treturn glfwGetTime();\n}\n\nvoid test_get_directory(char *dest, const char *src)\n{\n\tchar *s;\n    strcpy(dest, src);\n\t#ifdef WIN32\n\t\ts = strrchr(dest,'\\\\');\n\t#else\n\t\ts = strrchr(dest,'/');\n\t#endif\n    if (s) *s = '\\0';\n}\n\nvoid test_set_working_dir(const char *dir)\n{\n    #ifdef WIN32\n\t\tSetCurrentDirectory(dir);\n\t#else\n\t\tchdir(dir);\n\t#endif\n}\n\nvoid test_window_title(const char *title)\n{\n\tglfwSetWindowTitle(test_glfw_window, title);\n\tsprintf(test_title, \"%s\", title);\n}\n\nint test_window(const char *title, int fullscreen)\n{\n\tGLFWmonitor *monitor = NULL;\n\tGLFWwindow *win;\n\n\tif (fullscreen) {\n\t\tconst GLFWvidmode *mode;\n\t\tmonitor = glfwGetPrimaryMonitor();\n\t\tmode = glfwGetVideoMode(monitor);\n\t\t\n\t\tglfwWindowHint(GLFW_RED_BITS, mode->redBits);\n\t\tglfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);\n\t\tglfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);\n\t\tglfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);\n\t\t\n\t\ttest_width = mode->width;\n\t\ttest_height = mode->height;\n\t}\n\t\n\twin = glfwCreateWindow(test_width, test_height, title, monitor, test_glfw_window);\n\tif (win == NULL)\n\t\treturn 0;\n\t\n\tif (test_glfw_window)\n\t\tglfwDestroyWindow(test_glfw_window);\n\t\t\n\ttest_glfw_window = win;\n\tsprintf(test_title, \"%s\", title);\n\t\n\tglfwSetWindowCloseCallback(test_glfw_window, close_callback);\n\tglfwSetWindowSizeCallback(test_glfw_window, size_callback);\n\tglfwSetKeyCallback(test_glfw_window, key_callback);\n\tglfwSetMouseButtonCallback(test_glfw_window, mousebutton_callback);\n\tglfwSetCharCallback(test_glfw_window, char_callback);\n\tglfwSetCursorPosCallback(test_glfw_window, cursorpos_callback);\n\tglfwMakeContextCurrent(test_glfw_window);\n\t\n\tglPixelStorei(GL_UNPACK_ALIGNMENT, 1);\n\tglPixelStorei(GL_PACK_ALIGNMENT, 1);\n\tglEnable(GL_TEXTURE_2D);\n\t\n\treturn 1;\n}\n\nint test_create(const char *title, int width, int height)\n{\n\tmemset(test_button, 0, TEST_BUTTON_COUNT*2*sizeof(char));\n\tmemset(test_mouse_button, 0, TEST_MOUSE_BUTTON_COUNT*2*sizeof(char));\n\n\tglfwInit();\n\n\ttest_width = width;\n\ttest_height = height;\n\ttest_tex_width = width;\n\ttest_tex_height = height;\n\t\n\tif (! test_window(title, 0))\n\t\treturn 0;\n\t\n\tglGenTextures(1, &test_texture);\n\ttest_setup_texture(test_tex_width, test_tex_height);\n\t\n\treturn 1;\n}\n\nvoid test_window_size(int width, int height)\n{\n\tglfwSetWindowSize(test_glfw_window, width, height);\n\ttest_width = width;\n\ttest_height = height;\n}\n\nvoid test_destroy(void)\n{\n\tglDeleteTextures(1, &test_texture);\n\tglfwMakeContextCurrent(NULL);\n\tglfwTerminate();\n\ttest_glfw_window = NULL;\n}\n\nvoid test_update(void)\n{\n\tint i;\n\t// flush events\n\tfor (i = 0; i < TEST_BUTTON_COUNT; i++)\n\t\ttest_button[i][0] = 0;\n\tfor (i = 0; i < TEST_MOUSE_BUTTON_COUNT; i++)\n\t\ttest_mouse_button[i][0] = 0; \n\ttest_char_count = 0;\n\tglfwPollEvents();\n\ttest_t++;\n}\n"
  },
  {
    "path": "tests/vorogen/CMakeLists.txt",
    "content": "## Find source and headers\nFILE(GLOB HEADERS\n  *.h\n  ${MTCL_INCLUDE_DIR}/*.h\n  ${STB_INCLUDE_DIR}/*.h\n)\nFILE(GLOB SOURCES\n  *.c*\n)\n\nIF(CMAKE_HAS_SORT)\n  LIST(SORT HEADERS)\n  LIST(SORT SOURCES)\nENDIF(CMAKE_HAS_SORT)\n\n## Build\nINCLUDE_DIRECTORIES(\n  ## Maratis\n  ${MTCL_INCLUDE_DIR}\n\n  ## 3rdparty\n  ${GLFW_INCLUDE_DIR}\n  ${TINYCTHREAD_INCLUDE_DIR}\n  ${STB_INCLUDE_DIR}\n)\n\nADD_EXECUTABLE(Vorogen ${SOURCES} ${HEADERS})\n\nTARGET_LINK_LIBRARIES(Vorogen\n  ## 3rdparty\n  ${GLFW_LIBRARIES}\n  ${TINYCTHREAD_LIBRARIES}\n\n  ## System libraries\n  ${OPENGL_LIBRARIES}\n  ${PLATFORM_LIBRARIES}\n  ${OS_SPECIFIC_LIBRARIES}\n)\n\n## Install\nINSTALL(TARGETS Vorogen DESTINATION ${MTCL_INSTALL_DIR})\nINSTALL(DIRECTORY ../dataset DESTINATION ${MTCL_INSTALL_DIR})\n\nIF(APPLE)\n  SET_TARGET_PROPERTIES(\n    Vorogen\n    PROPERTIES\n    BUILD_WITH_INSTALL_RPATH 1\n    INSTALL_RPATH \"@loader_path/\"\n  )\nENDIF(APPLE)\n\nIF(UNIX AND NOT APPLE)\n  SET_TARGET_PROPERTIES(\n    Vorogen\n    PROPERTIES\n    BUILD_WITH_INSTALL_RPATH 1\n    INSTALL_RPATH \"$ORIGIN/\"\n  )\nENDIF(UNIX AND NOT APPLE)\n"
  },
  {
    "path": "tests/vorogen/main.c",
    "content": "/*======================================================================\n    Maratis Tiny C Library\n    version 1.0\n------------------------------------------------------------------------\n    Copyright (c) 2015 Anael Seghezzi <www.maratis3d.com>\n\n    This software is provided 'as-is', without any express or implied\n    warranty. In no event will the authors be held liable for any damages\n    arising from the use of this software.\n\n    Permission is granted to anyone to use this software for any purpose,\n    including commercial applications, and to alter it and redistribute it\n    freely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would\n    be appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not\n    be misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n\n========================================================================*/\n\n/* voronoi genetic algorithm painting */\n\n#define M_MATH_IMPLEMENTATION\n#define M_IMAGE_IMPLEMENTATION\n#define M_DIST_IMPLEMENTATION\n#include <m_math.h>\n#include <m_image.h>\n#include <m_dist.h>\n\n#define STB_IMAGE_IMPLEMENTATION\n#include <stb_image.h>\n\n#include \"../test.h\"\n\n#define POP_COUNT 128\n#define POINT_COUNT 64\n#define RANDF ((float)rand() / (float)RAND_MAX)\n\nstruct test_point\n{\n\tfloat2 pos;\n\tfloat3 col;\n};\n\nstatic struct m_image test_buffer = M_IMAGE_IDENTITY();\n\nstatic struct test_point population[POP_COUNT][POINT_COUNT];\nstatic struct test_point population_copy[POP_COUNT][POINT_COUNT];\n\nstatic struct m_image tmp_buffer = M_IMAGE_IDENTITY();\nstatic struct m_image tmpi = M_IMAGE_IDENTITY();\nstatic struct m_image src_image = M_IMAGE_IDENTITY();\nstatic struct m_image dest_image = M_IMAGE_IDENTITY();\n\n\nstatic int load_image(struct m_image *dest, const char *filename)\n{\n    int w, h, n;\n    unsigned char *data = stbi_load(filename, &w, &h, &n, 0);\n    if (data == NULL)\n    {\n        printf(\"unable to read image\\n\");\n        return 0;\n    }\n\n    m_image_destroy(dest);\n    dest->data = data;\n    dest->size = w * h * n;\n    dest->width = w;\n    dest->height = h;\n    dest->comp = n;\n    dest->type = M_UBYTE;\n    return 1;\n}\n\nstatic int get_best_tournament(float *error, int count, int tour_size)\n{\n\tint best = rand()%count; int i;\n\t\n\tfor (i = 1; i < tour_size; i++) {\n\t\tint id = rand()%count;\n\t\tif (error[id] < error[best])\n\t\t\tbest = id;\n\t}\n\t\n\treturn best;\n}\n\nstatic int get_best_dual(float *error, float *energy, int POP_SIZE, float p)\n{\n    float r = RANDF;\n    int id1 = rand() % POP_SIZE;\n    int id2 = rand() % POP_SIZE;\n\tint best = id1;\n\t\n\tif ((r > p) || (energy == NULL)) {\n\t\tif (error[id1] < error[id2])\n\t\t\tbest = id1;\n\t\telse if(error[id1] > error[id2])\n\t\t\tbest = id2;\n\t}\n\telse {\n\t\tif (! (error[id1] > error[id2] && energy[id1] > energy[id2])) {\n\t\t\tif(error[id1] < error[id2] || energy[id1] < energy[id2]) {\n\t\t\t\tbest = id1;\n\t\t\t}\n\t\t}\n\t\tif (! (error[id2] > error[id1] && energy[id2] > energy[id1])) {\n\t\t\tif(error[id2] < error[id1] || energy[id2] < energy[id1]) {\n\t\t\t\tbest = id2;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn best;\n}\n\nstatic int get_best_dual4(float *error, float *energy, int POP_SIZE, float p)\n{\n\tfloat er4[4];\n\tfloat en4[4];\n\tfloat er2[2];\n\tfloat en2[2];\n\tint id4[4];\n\tint id2[2];\n\tint i;\n\n\tfor (i = 0; i < 4; i++) {\n\t\tint best = get_best_dual(error, energy, POP_SIZE, p);\n\t\tid4[i] = best;\n\t\ter4[i] = error[best];\n\t\ten4[i] = energy[best];\n\t}\n\n\tfor (i = 0; i < 2; i++) {\n\t\tint best = get_best_dual(er4, en4, 4, p);\n\t\tid2[i] = id4[best];\n\t\ter2[i] = er4[best];\n\t\ten2[i] = en4[best];\n\t}\n\n\treturn id2[get_best_dual(er2, en2, 2, p)];\n}\n\nstatic void mate(float *data, float *src1, float *src2, int s, int c)\n{\n    int i;\n    \n\tfor (i = 0; i < s; i+=c) {\n\t   int j;\n\t   \n\t   if (RANDF < 0.5f) {\n\t       for (j = 0; j < c; j++)\n\t           data[j] = src1[j];\n\t   }\n\t   else {\n\t       for (j = 0; j < c; j++)\n\t           data[j] = src2[j];\n       }\n       \n\t   data += c;\n\t   src1 += c;\n\t   src2 += c;\n    }\n}\n\nstatic void mutate(struct test_point *pts, int size, struct m_image *src)\n{\n    float p = 2.0f / (float)size;\n    float s1 = 0.015f;\n    float s2 = 0.035f;\n    int w = src->width;\n    int h = src->height;\n    int wh = w*h;\n    int i;\n    \n    for (i = 0; i < size; i++) {\n        \n        if (RANDF < p*0.01f) {\n            pts[i].pos.x = RANDF;\n            pts[i].pos.y = RANDF;\n        }\n        \n        if (RANDF < p*0.01f) {\n            int id = rand() % wh;\n            float *src_pixel = (float *)src->data + id * src->comp;\n    \t\tpts[i].col.x = src_pixel[0];\n    \t\tpts[i].col.y = src_pixel[1];\n    \t\tpts[i].col.z = src_pixel[2];\n    \t\tm_RGB_to_HSL(&pts[i].col.x, &pts[i].col.x);\n        }\n        \n        if (RANDF < p) {\n            float2 pos = pts[i].pos;\n            pos.x += (RANDF - 0.5f) * s2;\n            pos.y += (RANDF - 0.5f) * s2;\n            if (pos.x > 0 && pos.x < 1 && pos.y > 0 && pos.y < 1)\n                pts[i].pos = pos;\n        }\n        \n        if (RANDF < p) {\n            float3 col = pts[i].col;\n            col.x += (RANDF - 0.5f) * s1*45;\n            col.y += (RANDF - 0.5f) * s1;\n            col.z += (RANDF - 0.5f) * s1;\n            if (col.x >= 0 && col.x <= 360 && col.y >= 0 && col.y <= 1 && col.y >= 0 && col.y <= 1)\n                pts[i].col = col;\n        }\n    }\n}\n\nstatic void gen(struct test_point *pts, struct m_image *src)\n{\n    float spt = sqrtf((float)POINT_COUNT);\n    int w = src->width;\n    int h = src->height;\n    int i;\n    \n    /* random points */\n\tfor (i = 0; i < POINT_COUNT; i++) {\n\t\t//pts[i].pos.x = RANDF;\n\t\t//pts[i].pos.y = RANDF;\n\t\tfloat y = i / spt;\n\t\tfloat x = i - (int)y * spt;\n\t\tpts[i].pos.x = ((x + 0.5f) / spt) + RANDF * 0.2f - 0.1f;\n\t\tpts[i].pos.y = ((y + 0.5f) / spt) + RANDF * 0.2f - 0.1f;\n\t\tpts[i].pos.x = M_CLAMP(pts[i].pos.x, 0, 1);\n\t\tpts[i].pos.y = M_CLAMP(pts[i].pos.y, 0, 1);\n\t}\n\t\n\t/* pick initial color */\n\tfor (i = 0; i < POINT_COUNT; i++) {\n\t\tint x = (int)(pts[i].pos.x * (w - 1));\n\t\tint y = (int)(pts[i].pos.y * (h - 1));\n\t\tfloat *src_pixel = (float *)src->data + (y * w + x) * src->comp;\n\t\tpts[i].col.x = src_pixel[0];\n\t\tpts[i].col.y = src_pixel[1];\n\t\tpts[i].col.z = src_pixel[2];\n\t\tm_RGB_to_HSL(&pts[i].col.x, &pts[i].col.x);\n\t} \n}\n\nstatic float get_originality(int id)\n{\n    struct test_point *ip = population[id];\n    float diff = 0;\n    int i;\n    \n    for (i = 0; i < POP_COUNT; i++) {\n        if (i != id) {\n            int j;\n            \n            for (j = 0; j <POINT_COUNT; j++) {\n             \n                diff += fabs(ip[j].pos.x - population[i][j].pos.x) * 16.0f;\n                diff += fabs(ip[j].pos.y - population[i][j].pos.y) * 16.0f;\n                \n                diff += fabs(ip[j].col.x - population[i][j].col.x) / 360.0f;\n                diff += fabs(ip[j].col.y - population[i][j].col.y);\n                diff += fabs(ip[j].col.z - population[i][j].col.z) * 2;\n            }\n        }\n    }\n    \n    return diff;\n}\n\nstatic float get_score(struct m_image *a, struct m_image *b)\n{\n    return m_chi_squared_distance((float *)a->data, (float *)b->data, a->size);\n    //return m_squared_distance((float *)a->data, (float *)b->data, a->size);\n}\n\nstatic void render(struct m_image *dest, struct test_point *pts, int pts_count)\n{\n    float *tmp_data;\n\tfloat *dest_data;\n\tint w = dest->width;\n\tint h = dest->height;\n\tint size = w * h;\n\tint i;\n\n\tm_image_create(&tmp_buffer, M_FLOAT, w, h, 1);\n\ttmp_data = (float *)tmp_buffer.data;\n\n\tfor (i = 0; i < size; i++)\n\t\ttmp_data[i] = M_DIST_MAX;\n\n\tfor (i = 0; i < pts_count; i++) {\n\n\t\t/* draw point */\n\t\tint x = (int)(pts[i].pos.x * (w - 1));\n\t\tint y = (int)(pts[i].pos.y * (h - 1));\n\n\t\t/* mask */\n\t\ttmp_data[y * w + x] = 0;\n\n\t\t/* color */\n\t\tdest_data = (float *)dest->data + (y * w + x) * dest->comp;\n\t\tdest_data[0] = pts[i].col.x;\n\t\tdest_data[1] = pts[i].col.y;\n\t\tdest_data[2] = pts[i].col.z;\n\t\tm_HSL_to_RGB(dest_data, dest_data);\n\t}\n\n\tm_image_voronoi_transform(&tmp_buffer, &tmpi, &tmp_buffer);\n\tm_image_voronoi_fill(dest, dest, &tmpi);    \n}\n\nstatic void init(void)\n{\n    struct m_image ubi = M_IMAGE_IDENTITY();\n    int i;\n    \n    if ((! load_image(&ubi, \"dataset/lena.tga\")) || (ubi.comp != 3))\n        exit(EXIT_FAILURE);\n   \n    m_image_ubyte_to_float(&src_image, &ubi);\n    m_sRGB_to_linear((float*)src_image.data, (float*)src_image.data, src_image.size);\n    \n    m_image_copy(&ubi, &src_image);\n    m_image_resize(&src_image, &ubi, 128, 128);\n    //m_image_gaussian_blur(&src_image, &src_image, 1, 1);\n    \n    m_image_create(&dest_image, M_FLOAT, src_image.width, src_image.height, 3);\n    \n    for (i = 0; i < POP_COUNT; i++)\n        gen(population[i], &src_image);\n    \n    m_image_destroy(&ubi);\n}\n\nstatic void clear(void)\n{\n    m_image_destroy(&src_image);\n\tm_image_destroy(&tmp_buffer);\n\tm_image_destroy(&tmpi);\n}\n\nstatic void draw(void)\n{\n    float error[POP_COUNT];\n    float energy[POP_COUNT];\n    float min_error;\n    int i, best = 0;\n    \n    for (i = 0; i < POP_COUNT; i++) {\n        render(&dest_image, population[i], POINT_COUNT);\n        m_image_gaussian_blur(&dest_image, &dest_image, 1, 1);\n        error[i] = get_score(&dest_image, &src_image);\n        #ifdef SELECT_DUAL\n        energy[i] = 1.0f / get_originality(i);\n        #endif\n    }\n    \n    min_error = error[best];\n    for (i = 1; i < POP_COUNT; i++) {\n        if (error[i] < min_error) {\n            min_error = error[i];\n            best = i;\n        }\n    }\n    \n    render(&test_buffer, population[best], POINT_COUNT);\n    m_image_gaussian_blur(&test_buffer, &test_buffer, 2, 2);\n    \n    /* copy */\n    memcpy(population_copy, population, sizeof(population));\n    \n    /* mate */\n    for (i = 0; i < POP_COUNT; i++) {\n        \n        #ifdef SELECT_DUAL\n        int i1 = get_best_dual4(error, energy, POP_COUNT, 0.2f);\n\t\tint i2 = get_best_dual4(error, energy, POP_COUNT, 0.2f);\n\t\t#else\n        int i1 = get_best_tournament(error, POP_COUNT, 3);\n\t\tint i2 = get_best_tournament(error, POP_COUNT, 3);\n\t\t#endif\n\t\t\n\t\tmate(\n\t\t\t&population[i][0].pos.x,\n\t\t\t&population_copy[i1][0].pos.x,\n\t\t\t&population_copy[i2][0].pos.x,\n\t\t\tPOINT_COUNT*5, 5\n\t\t\t);\n    }\n    \n    /* mutate */\n    for (i = 0; i < POP_COUNT; i++)\n        mutate(population[i], POINT_COUNT, &src_image);\n    \n    printf(\"score %f\\n\", min_error);\n}\n\nvoid main_loop(void)\n{\t\n\tdraw();\n    test_swap_buffer(&test_buffer);\n\ttest_update();\n}\n\nint main(int argc, char **argv)\n{\n    char dir[256];\n    test_get_directory(dir, argv[0]);\n    test_set_working_dir(dir);\n    \n\tif (! test_create(\"M - Vorogen\", 256, 256))\n\t\treturn EXIT_FAILURE;\n\n    m_image_create(&test_buffer, M_FLOAT, 256, 256, 3);\n\tinit();\n\n\t#ifdef __EMSCRIPTEN__\n\temscripten_set_main_loop(main_loop, 0, 1);\n\t#else\n\twhile (test_state) {\n\t\tmain_loop();\n\t\tthrd_yield();\n\t}\n\t#endif\n\n    m_image_destroy(&test_buffer);\n\tclear();\n\ttest_destroy();\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "tests/voronoi/CMakeLists.txt",
    "content": "## Find source and headers\nFILE(GLOB HEADERS\n  *.h\n  ${MTCL_INCLUDE_DIR}/*.h\n)\nFILE(GLOB SOURCES\n  *.c*\n)\n\nIF(CMAKE_HAS_SORT)\n  LIST(SORT HEADERS)\n  LIST(SORT SOURCES)\nENDIF(CMAKE_HAS_SORT)\n\n## Build\nINCLUDE_DIRECTORIES(\n  ## Maratis\n  ${MTCL_INCLUDE_DIR}\n\n  ## 3rdparty\n  ${GLFW_INCLUDE_DIR}\n  ${TINYCTHREAD_INCLUDE_DIR}\n)\n\nADD_EXECUTABLE(VoronoiTest ${SOURCES} ${HEADERS})\n\nTARGET_LINK_LIBRARIES(VoronoiTest\n  ## 3rdparty\n  ${GLFW_LIBRARIES}\n  ${TINYCTHREAD_LIBRARIES}\n\n  ## System libraries\n  ${OPENGL_LIBRARIES}\n  ${PLATFORM_LIBRARIES}\n  ${OS_SPECIFIC_LIBRARIES}\n)\n\n## Install\nINSTALL(TARGETS VoronoiTest DESTINATION ${MTCL_INSTALL_DIR})\n\nIF(APPLE)\n  SET_TARGET_PROPERTIES(\n    VoronoiTest\n    PROPERTIES\n    BUILD_WITH_INSTALL_RPATH 1\n    INSTALL_RPATH \"@loader_path/\"\n  )\nENDIF(APPLE)\n\nIF(UNIX AND NOT APPLE)\n  SET_TARGET_PROPERTIES(\n    VoronoiTest\n    PROPERTIES\n    BUILD_WITH_INSTALL_RPATH 1\n    INSTALL_RPATH \"$ORIGIN/\"\n  )\nENDIF(UNIX AND NOT APPLE)\n"
  },
  {
    "path": "tests/voronoi/main.c",
    "content": "/*======================================================================\n    Maratis Tiny C Library\n    version 1.0\n------------------------------------------------------------------------\n    Copyright (c) 2015 Anael Seghezzi <www.maratis3d.com>\n\n    This software is provided 'as-is', without any express or implied\n    warranty. In no event will the authors be held liable for any damages\n    arising from the use of this software.\n\n    Permission is granted to anyone to use this software for any purpose,\n    including commercial applications, and to alter it and redistribute it\n    freely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would\n    be appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not\n    be misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n\n========================================================================*/\n\n/* voronoi test */\n\n#define M_MATH_IMPLEMENTATION\n#define M_IMAGE_IMPLEMENTATION\n#define M_DIST_IMPLEMENTATION\n#include <m_math.h>\n#include <m_image.h>\n#include <m_dist.h>\n\n#include \"../test.h\"\n\n#define POINT_COUNT 64\n#define RANDF ((float)rand() / (float)RAND_MAX)\n\nstruct test_point\n{\n\tfloat2 pos;\n\tfloat2 dir;\n\tfloat3 col;\n};\n\nstatic struct m_image test_buffer = M_IMAGE_IDENTITY();\nstatic struct test_point points[POINT_COUNT];\nstatic struct m_image tmp_buffer = M_IMAGE_IDENTITY();\nstatic struct m_image tmpi = M_IMAGE_IDENTITY();\n\n\nstatic void init(void)\n{\n\tint i;\n\tfor (i = 0; i < POINT_COUNT; i++) {\n\t\tpoints[i].pos.x = RANDF;\n\t\tpoints[i].pos.y = RANDF;\n\t\tpoints[i].dir.x = RANDF - 0.5f;\n\t\tpoints[i].dir.y = RANDF - 0.5f;\n\t\tpoints[i].col.x = RANDF;\n\t\tpoints[i].col.y = RANDF;\n\t\tpoints[i].col.z = RANDF;\n\t}\n}\n\nstatic void clear(void)\n{\n\tm_image_destroy(&tmp_buffer);\n\tm_image_destroy(&tmpi);\n}\n\nstatic void animate(void)\n{\n    int i;\n    for (i = 0; i < POINT_COUNT; i++) {\n\n\t\t/* move point */\n\t\tpoints[i].pos.x += points[i].dir.x * 0.01f;\n\t\tpoints[i].pos.y += points[i].dir.y * 0.01f;\n\n\t\t/* bounce x */\n\t\tif (points[i].pos.x > 1) {\n\t\t\tpoints[i].pos.x = 1;\n\t\t\tpoints[i].dir.x = -points[i].dir.x;\n\t\t}\n\t\telse if (points[i].pos.x < 0) {\n\t\t\tpoints[i].pos.x = 0;\n\t\t\tpoints[i].dir.x = -points[i].dir.x;\n\t\t}\n\t\t\n\t\t/* bounce y */\n\t\tif (points[i].pos.y > 1) {\n\t\t\tpoints[i].pos.y = 1;\n\t\t\tpoints[i].dir.y = -points[i].dir.y;\n\t\t}\n\t\telse if (points[i].pos.y < 0) {\n\t\t\tpoints[i].pos.y = 0;\n\t\t\tpoints[i].dir.y = -points[i].dir.y;\n\t\t}\n    }  \n}\n\nstatic void draw(void)\n{\n\tfloat *tmp_data;\n\tfloat *test_data;\n\tint w = test_buffer.width;\n\tint h = test_buffer.height;\n\tint size = w * h;\n\tint i;\n\n\tm_image_create(&tmp_buffer, M_FLOAT, w, h, 1);\n\ttmp_data = (float *)tmp_buffer.data;\n\n\tfor (i = 0; i < size; i++)\n\t\ttmp_data[i] = M_DIST_MAX;\n\n\tfor (i = 0; i < POINT_COUNT; i++) {\n\n\t\t/* draw point */\n\t\tint x = (int)(points[i].pos.x * (w - 1));\n\t\tint y = (int)(points[i].pos.y * (h - 1));\n\n\t\t/* mask */\n\t\ttmp_data[y * w + x] = 0;\n\n\t\t/* color */\n\t\ttest_data = (float *)test_buffer.data + (y * w + x) * test_buffer.comp;\n\t\ttest_data[0] = points[i].col.x;\n\t\ttest_data[1] = points[i].col.y;\n\t\ttest_data[2] = points[i].col.z;\n\t}\n\n\tm_image_voronoi_transform(&tmp_buffer, &tmpi, &tmp_buffer);\n\tm_image_voronoi_fill(&test_buffer, &test_buffer, &tmpi);\n}\n\nvoid main_loop(void)\n{\t\n    animate();\n\tdraw();\n\ttest_swap_buffer(&test_buffer);\n\ttest_update();\n}\n\nint main(int argc, char **argv)\n{\t\n\tif (! test_create(\"M - VoronoiTest\", 256, 256))\n\t\treturn EXIT_FAILURE;\n\n\tm_image_create(&test_buffer, M_FLOAT, 256, 256, 3);\n\tinit();\n\n\t#ifdef __EMSCRIPTEN__\n\temscripten_set_main_loop(main_loop, 0, 1);\n\t#else\n\twhile (test_state) {\n\t\tmain_loop();\n\t\tthrd_yield();\n\t}\n\t#endif\n\n\tm_image_destroy(&test_buffer);\n\tclear();\n\ttest_destroy();\n\treturn EXIT_SUCCESS;\n}\n"
  }
]